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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to