From patchwork Fri Feb 23 16:47:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129458 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp813896lja; Fri, 23 Feb 2018 08:50:07 -0800 (PST) X-Google-Smtp-Source: AG47ELsepXYQSwgS5TG/lLEBhBPS4VPuyvrYOhekqt2MMs/GLt46JLvG1H0jxi2WeEsMpHx3fm36 X-Received: by 10.36.157.213 with SMTP id f204mr3107518itd.26.1519404607770; Fri, 23 Feb 2018 08:50:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519404607; cv=none; d=google.com; s=arc-20160816; b=oxlGgvxTGqhWX36TewN7whiDu1I7KKErTao2vBCSR6dHm66sq81nDl0e6qcVRCzs+g 2yov3F+twiTePlDM87f0Qnqau6nNpylAZM+a+ci+mZ0rMzDa+JdWRpCLIlqCjw8ISEzl NUMwMeqC+cIeiLPscqxd3O0R6zvTXbf/ix7fxPgEfDvjgbHIoZPLSLgPDj7xsO1VXUqh vdJ970ryyL5OEXtyY23cMwaqRAgG8mOB8M0+cG5dxwMFFOXgbLS5aCRVvaYJcglopIlr T7F04jOK/RXCeNd2Jf1IHY9ujOlB02x7WOuNhKR6xbHLKlnbQHokvjh8GCwy+hSxc84G oryQ== 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=uPwbeDSBnqpBAC1UWK41FRLJiu+G5+8+KUUtGjn1vmI=; b=Qi+koaxRQTKSJRJNoGfhb0MtY50hxXpzYA3GWuybCAYuboOB6643uPiac/0aChyO+L 7nwGagjYLxw8kj42PcvHOMyRf09JgrEi78DLXwv8vJ1Ln4i8f9vNbs0hP48FJntyRR+v f6tx3N8TjmiSYjQvtNNreci41IJ63Zmtgs/2Up/LsRuTOTRUaI+C9cd1domELMqRxqd3 MGOgkmQhlzyjBKolAv6D7dp0yQL6auNEjnsbh4uZj7USLzLR8YQHpyHTXQL31hof2pjy SNdeGd5xMwL0oVnpG5txjGNWPRuTyRYp7yK8pZPxDc9HxlA0MQE26QXw48IAqPidvJ03 qzxw== 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 z29si1443917ita.20.2018.02.23.08.50.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 08:50:07 -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 1epGW9-0003VC-Bi; Fri, 23 Feb 2018 16:48:17 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epGW8-0003Sg-4P for xen-devel@lists.xen.org; Fri, 23 Feb 2018 16:48:16 +0000 X-Inumbo-ID: 39bbee2c-18b9-11e8-ba59-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 39bbee2c-18b9-11e8-ba59-bc764e045a96; Fri, 23 Feb 2018 17:47:25 +0100 (CET) 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 30ED815AD; Fri, 23 Feb 2018 08:48:15 -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 1BA153F25C; Fri, 23 Feb 2018 08:48:13 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 23 Feb 2018 16:47:41 +0000 Message-Id: <20180223164753.27311-8-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180223164753.27311-1-julien.grall@arm.com> References: <20180223164753.27311-1-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, volodymyr_babchuk@epam.com, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v4 07/19] 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 Babcuk Acked-by: Stefano Stabellini --- Changes in v4: - Add Stefano's acked-by Changes in v3: - Add Volodymyr's reviewed-by 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 c243521ed4..8d5f8d372a 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);