Author: kib
Date: Tue Feb 13 15:30:31 2018
New Revision: 329214
URL: https://svnweb.freebsd.org/changeset/base/329214

Log:
  Fix build with gas.
  
  Do not use C constant suffixes.  Bit values are small enough to not
  require typing, despite they are used for 64bit MSR writes.  The added
  cast in hw_ibrs_recalculate() is redundand but I prefer to add it for
  clarity.
  
  Reported by:  bde
  Sponsored by: The FreeBSD Foundation
  MFC after:    1 week

Modified:
  head/sys/x86/include/specialreg.h
  head/sys/x86/x86/cpu_machdep.c

Modified: head/sys/x86/include/specialreg.h
==============================================================================
--- head/sys/x86/include/specialreg.h   Tue Feb 13 15:18:11 2018        
(r329213)
+++ head/sys/x86/include/specialreg.h   Tue Feb 13 15:30:31 2018        
(r329214)
@@ -702,8 +702,8 @@
  * document 336996-001 Speculative Execution Side Channel Mitigations.
  */
 /* MSR IA32_SPEC_CTRL */
-#define        IA32_SPEC_CTRL_IBRS     0x0000000000000001ULL
-#define        IA32_SPEC_CTRL_STIBP    0x0000000000000002ULL
+#define        IA32_SPEC_CTRL_IBRS     0x00000001
+#define        IA32_SPEC_CTRL_STIBP    0x00000002
 
 /* MSR IA32_PRED_CMD */
 #define        IA32_PRED_CMD_IBPB_BARRIER      0x0000000000000001ULL

Modified: head/sys/x86/x86/cpu_machdep.c
==============================================================================
--- head/sys/x86/x86/cpu_machdep.c      Tue Feb 13 15:18:11 2018        
(r329213)
+++ head/sys/x86/x86/cpu_machdep.c      Tue Feb 13 15:30:31 2018        
(r329214)
@@ -592,7 +592,7 @@ hw_ibrs_recalculate(void)
        if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_IBRS_ALL) != 0) {
                if (hw_ibrs_disable) {
                        v= rdmsr(MSR_IA32_SPEC_CTRL);
-                       v &= ~IA32_SPEC_CTRL_IBRS;
+                       v &= ~(uint64_t)IA32_SPEC_CTRL_IBRS;
                        wrmsr(MSR_IA32_SPEC_CTRL, v);
                } else {
                        v= rdmsr(MSR_IA32_SPEC_CTRL);
_______________________________________________
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