Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2018 15:56:24 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335064 - head/sys/arm64/arm64
Message-ID:  <201806131556.w5DFuOcc012186@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Wed Jun 13 15:56:24 2018
New Revision: 335064
URL: https://svnweb.freebsd.org/changeset/base/335064

Log:
  Switch to the SMCCC function for branch predictor hardening. The previous
  method may not have worked as the firmware checks for the ARCH_WORKAROUND_1
  function ID.
  
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/arm64/arm64/cpu_errata.c

Modified: head/sys/arm64/arm64/cpu_errata.c
==============================================================================
--- head/sys/arm64/arm64/cpu_errata.c	Wed Jun 13 15:41:22 2018	(r335063)
+++ head/sys/arm64/arm64/cpu_errata.c	Wed Jun 13 15:56:24 2018	(r335064)
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
 
 #include <machine/cpu.h>
 
-#include <dev/psci/psci.h>
+#include <dev/psci/smccc.h>
 
 typedef void (cpu_quirk_install)(void);
 struct cpu_quirks {
@@ -79,7 +79,10 @@ static void
 install_psci_bp_hardening(void)
 {
 
-	PCPU_SET(bp_harden, psci_get_version);
+	if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_1) != SMCCC_RET_SUCCESS)
+		return;
+
+	PCPU_SET(bp_harden, smccc_arch_workaround_1);
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806131556.w5DFuOcc012186>