From patchwork Mon Jul 27 15:19:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 247193 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp4892143ilg; Mon, 27 Jul 2020 08:21:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3FpfOhtgtqyc8kXjn2VF/B0KqChR36blewk1cagUSWrK8EB4ozCzi4EC5ahLytvU4jDo0 X-Received: by 2002:a25:248d:: with SMTP id k135mr10938418ybk.386.1595863317752; Mon, 27 Jul 2020 08:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595863317; cv=none; d=google.com; s=arc-20160816; b=0m8873oyTwCx4r9V+jxbpUZrEyQGV6o47Nj/o/5x36LnqMV5ehJsp+XalBkceK1D4y GbF/rpXNWCZA/YqnYOqpjAXEHFZspIzfLIHWuRRDzm6WLG3UkQITMsRt1cmnfi6n8q16 I0Ss6EKX8zH2gS89kAiQCcYMPZ6wcOEHvH+6jjUJuGMc0y5HwvjdMgFTjaRWWVlRq3wW y28LcfytCS5sA3Pkzt+GyD6sYo7Sll6xXSSsBzatOXJSmaDm1rjhAZI5yS7wwBjaVO7M rypyLaVzOW1HMe9pP6zPl7jfkIAzLLHAdJmZXnJ15wV5xHbc87rq0z63q6wM2rIN3Wht NwvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=CzXyfsRq8ddGHiV45tDKp7Cox+Mr2SFib9wJfNHDSi4=; b=EzLEwXSTagRI7LUsVSc35Zqufwmm7AixkyIIKbeLPSCfpUPL+RNomAJC0GdGM01eqv 2tY2uToN+2YuvjpEycFMW3ptCJmHfqCQzfhXKEdexdOXUUqvAN1OKwgJdc5Sr44eoKk0 tJsz615ks94ANthZaBIgUWO71AeOghBmcXZRq+qpEAlopD19SchbcGQR/KkyWAkqLZkD u+EHpVybo2OTCjeR67W4rUY/Dg2QoWsIEyQPzS/QGIHa7eYYii885o89CFikyeX4Gl+u D9tTCE3BnJCaw4tazEVSY21Wbn1LTHAEn31emj+1d3HFpa5fe+hGoNK3mHL9lZ2rZ6BN 9eBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=etTSnAIc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 144si10377089ybn.444.2020.07.27.08.21.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jul 2020 08:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=etTSnAIc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k04wv-0004NG-53 for patch@linaro.org; Mon, 27 Jul 2020 11:21:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k04ub-0001cb-WE for qemu-devel@nongnu.org; Mon, 27 Jul 2020 11:19:34 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:52486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k04ua-0001Mf-GV for qemu-devel@nongnu.org; Mon, 27 Jul 2020 11:19:33 -0400 Received: by mail-wm1-x344.google.com with SMTP id x5so13952236wmi.2 for ; Mon, 27 Jul 2020 08:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CzXyfsRq8ddGHiV45tDKp7Cox+Mr2SFib9wJfNHDSi4=; b=etTSnAIcnkE58iV63GVt7f+pQvl++n4MBYszFGoo0BLUkj5ZdQSZr1UO/YbWnAP6i3 ZCGE5WKoyOw9lt+Bs7s1ioTvDmlNpUNkYm2T3GLokhk2jYBHsMc8ijFZ8o7m+Te8iK3F MA4PYJXFme4mfJlSBAHfCcmJ5yd7VVn1FbzKnEc0C+wPHMcfP1TwC1KLQvYSRPOiR9iY ElrHnLLUhzO0Pv361GKKSx30GsQM2DBanZ3LFIYiYF1ysrPXmRwgvTsGMebktdUrxLT0 yDyL5YAZ9PuXmaASp3JSatLlBR9HYe9ey6yaK8wqnGOATeDneAjHU7DTJuCtYh4P+MQC 6SFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CzXyfsRq8ddGHiV45tDKp7Cox+Mr2SFib9wJfNHDSi4=; b=dDgeFEsZ5EN5P/TTwMDRKRntv6Us6Z96o+BnH1BUjsaN+YfW+L9bP3kRIT0cpep+lY GRS+QZH0Fs/TUwo0jJhkLXt0wCme7n6LQubLonFBxcoGounYhxLZNfFXeDZslmiP3IOu 7hfSqz/Wtqybs6HDaQ9+vyWK8353r/mzGcKVOFIJtyqJg9Y1p/yFKqkXJI6rk93f6PAs OW6QAf2lTq5qK2J9l0VfrwmWbiVqsO7pIPVFbuGvzzhRoGmZlcgMR0sVFuFJsoYxRcQR cPT40l45RcuFSlmcJ0P2zb2yH7RnBhVDQkEFQ4pqZC4KTdYC3+I04HgCeO+f4+hP3h14 zdNA== X-Gm-Message-State: AOAM5309dAH5t4f489bpLBDRmLYv3DzkzSNsT9CRAEotcPwvqzfYE79/ qVq2LXXHVd9gYAMKCCkFKUd9f5265Cjecw== X-Received: by 2002:a1c:28a:: with SMTP id 132mr20619330wmc.109.1595863170533; Mon, 27 Jul 2020 08:19:30 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id h199sm18744996wme.42.2020.07.27.08.19.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 08:19:29 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 5/7] hw/arm/boot: Fix PAUTH for EL3 direct kernel boot Date: Mon, 27 Jul 2020 16:19:18 +0100 Message-Id: <20200727151920.19150-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200727151920.19150-1-peter.maydell@linaro.org> References: <20200727151920.19150-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson When booting an EL3 cpu with -kernel, we set up EL3 and then drop down to EL2. We need to enable access to v8.3-PAuth keys and instructions at EL3 before doing so. Signed-off-by: Richard Henderson Message-id: 20200724163853.504655-2-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/arm/boot.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1 diff --git a/hw/arm/boot.c b/hw/arm/boot.c index fef4072db16..c44fd3382dd 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -736,6 +736,9 @@ static void do_cpu_reset(void *opaque) } else { env->pstate = PSTATE_MODE_EL1h; } + if (cpu_isar_feature(aa64_pauth, cpu)) { + env->cp15.scr_el3 |= SCR_API | SCR_APK; + } /* AArch64 kernels never boot in secure mode */ assert(!info->secure_boot); /* This hook is only supported for AArch32 currently: