From patchwork Thu Feb 8 19:21:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 127729 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1793830ljc; Thu, 8 Feb 2018 11:24:25 -0800 (PST) X-Google-Smtp-Source: AH8x225JKC6eNW9yLEofXHZkRg6qYtkLe5MNw8NMklGCuoKYKGhO5vLdrW3k2/wZsCFVl4xbFGYp X-Received: by 10.107.53.164 with SMTP id k36mr147790ioo.292.1518117865533; Thu, 08 Feb 2018 11:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518117865; cv=none; d=google.com; s=arc-20160816; b=JJvQLDfYmLzjgbNfhPbq8hsTT56DyD3XD2GlebwBDpmmIRSAPAsPY3hdYl1mHyEVNQ qYdTDHj3q2pOxVYF8JfGO1r8pZ98Z8yjbIlm/1PSQ5s0XLrE4SxsZaRg1xSm7JIhOoF8 dCZX0GeIZ0But19SnllP4qiM6pBvxsieMHXcpU7aZJqT4CnlxfE3MuF/UslpeIXgCqXP PvW5dq5/BBGyTVRPHwoWrkAG6ne43vSxnfQyCNpmHfG2J/Sr2l9MJqCLGPHaI6da4p/y PYqGHoUeKVv5Wa63gpZ1YHXOJ/ggUYhwUhCUELsJ5F+IpfbwAr3XSVVMHvPGZ4NlPuqM HnZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=gGqqNb797kmxgSBpGqNaWBC+DsJcHJivLvDL1o6V4W0=; b=BBJ7489VwAXPsfflf7+dOku7/SkR7d1Hr/6Jd+wtmjwcSLaX5iyLv+fMdEoNv5+fiE oU0MgTrVU+J/PmAGimAicKLAEZzPYGFEqeKbTeA5w22RSUDWTfMIwSQZt4f3NXdJxe1q 8uCIQMssrFiGl32rt3wAWDiMbq6CWFONUe+oapiurcupZF1nHB9FZw3tRmkIW1MUUjaQ 9duG75CzHkxeHw1BsHydxJn7HZzlars9lodWkh++1+cTYQoKmA/yfihcS08yssAMKW8R ksbF672QbdcRGPExngsYfH6sujIE88QDUGrCcsRqYIFv6EESAZ03DOlz30pmxh2yq7NR bdGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id r132si431100itd.136.2018.02.08.11.24.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 11:24:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejrm7-0006L7-RQ; Thu, 08 Feb 2018 19:22:27 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejrm7-0006GN-5J for xen-devel@lists.xen.org; Thu, 08 Feb 2018 19:22:27 +0000 X-Inumbo-ID: 83932795-0d05-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 83932795-0d05-11e8-b9b1-635ca7ef6cff; Thu, 08 Feb 2018 19:23:16 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 11C3380D; Thu, 8 Feb 2018 11:22:21 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 02D163F24D; Thu, 8 Feb 2018 11:22:19 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 8 Feb 2018 19:21:55 +0000 Message-Id: <20180208192203.9556-8-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180208192203.9556-1-julien.grall@arm.com> References: <20180208192203.9556-1-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, volodymyr_babchuk@epam.com, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v2 07/15] xen/arm64: Print a per-CPU message with the BP hardening method used X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This will make easier to know whether BP hardening has been enabled for a CPU and which method is used. Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk --- Changes in v2: - Patch added --- xen/arch/arm/cpuerrata.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c index 9c7458ef06..6704648b26 100644 --- a/xen/arch/arm/cpuerrata.c +++ b/xen/arch/arm/cpuerrata.c @@ -79,7 +79,8 @@ static bool copy_hyp_vect_bpi(unsigned int slot, const char *hyp_vec_start, static bool __maybe_unused install_bp_hardening_vec(const struct arm_cpu_capabilities *entry, const char *hyp_vec_start, - const char *hyp_vec_end) + const char *hyp_vec_end, + const char *desc) { static int last_slot = -1; static DEFINE_SPINLOCK(bp_lock); @@ -94,6 +95,9 @@ install_bp_hardening_vec(const struct arm_cpu_capabilities *entry, if ( !entry->matches(entry) ) return true; + printk(XENLOG_INFO "CPU%u will %s on exception entry\n", + smp_processor_id(), desc); + /* * No need to install hardened vector when the processor has * ID_AA64PRF0_EL1.CSV2 set. @@ -157,7 +161,8 @@ static int enable_psci_bp_hardening(void *data) */ if ( psci_ver >= PSCI_VERSION(0, 2) ) ret = install_bp_hardening_vec(data, __psci_hyp_bp_inval_start, - __psci_hyp_bp_inval_end); + __psci_hyp_bp_inval_end, + "call PSCI get version"); else if ( !warned ) { ASSERT(system_state < SYS_STATE_active);