From patchwork Fri Feb 23 18:57:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129484 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp984716edc; Fri, 23 Feb 2018 10:59:53 -0800 (PST) X-Google-Smtp-Source: AH8x225fgGW8h0HbIiL2RFx6WFzAav7aeEesbRHuSknPRE2s4Vmda28ZyOGDVG4mJubYeAxvZAwe X-Received: by 10.107.174.14 with SMTP id x14mr2937794ioe.67.1519412393094; Fri, 23 Feb 2018 10:59:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519412393; cv=none; d=google.com; s=arc-20160816; b=DQkxMEbiHfekExn9X2jIqFZ/b48L0w88L3WwJBB/2smdpdvK9knNDPE19/yOkJq27V ngbzFUmuQn/AhLGd8NLBEZR8LwYXesKBsMiI588KYw8Al76QfMNaDzwgsAosafD/cJae FYLbgb5J2zbHrJ+4ZYR0ZUM4MnwppQKFWc/QtKdVeDHMKfGYnRrvGfN7LlBQ/1ETjSyU iuhmckiXO2+uqzQKYcFOXeKMW8fUEgUVkcjIl0IlQDLp42qsP0AIu0hYDTjcFnuVeNFp so3CZOl7OtlnwC2gXzEBOhR+/QHxwCn1DF/4x9Iheo5FomkWynCc3OQaaJyZaoONq8pw sUWw== 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=PolP0fhHMoiY0T0Xaa9pBrNUY8b6/UK6hRRYujpaL8Lr9QvGfY1iwSy+NBjTqGCyBi E4V0+avLD/vqndrKTcxdfz4fa3e2UFkkRQmwKpUXSvQb05RI0CkuTq1kxWh5u9G1kx0e nmx5sCdYtmGuFsVFSQ6FSUVaGvpDb6bKmk1fSvCKv2McViMn4kz7zYIFTXP4np2fAtDk UyeHvaxb2V0m8Q6Dgik6jgp4iUkSaevSVYGfeF2t4PqGZ8+iJgqSs2Usu/9CuFvM/yEO 8LyfzGMmx+73+MEX262YWt8qVtGieiNNTByVNkDMzfRVC1rhthIBXsug3r6aCCCD4IxQ UqFg== 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 n15si1927170iob.258.2018.02.23.10.59.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 10:59:53 -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 1epIXZ-0002yE-TA; Fri, 23 Feb 2018 18:57:53 +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 1epIXZ-0002t5-Cy for xen-devel@lists.xen.org; Fri, 23 Feb 2018 18:57:53 +0000 X-Inumbo-ID: ad75ebd4-18cb-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id ad75ebd4-18cb-11e8-b9b1-635ca7ef6cff; Fri, 23 Feb 2018 18:59:30 +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 CB06180D; Fri, 23 Feb 2018 10:57:46 -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 BBC4E3F25C; Fri, 23 Feb 2018 10:57:45 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 23 Feb 2018 18:57:18 +0000 Message-Id: <20180223185729.8780-8-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180223185729.8780-1-julien.grall@arm.com> References: <20180223185729.8780-1-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, volodymyr_babchuk@epam.com, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v5 07/18] 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);