Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2018 15:30:31 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329214 - in head/sys/x86: include x86
Message-ID:  <201802131530.w1DFUVJ3029950@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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