All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/Intel: drop another 32-bit leftover
@ 2017-12-06 16:18 Jan Beulich
  2017-12-20 19:25 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2017-12-06 16:18 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper

None of the models MISC_ENABLE MSR access is excluded for support 64-bit
mode - drop the conditional from early_init_intel(). Also convert
pointless rdmsr_safe() elsewhere to rdmsrl().

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -285,31 +285,29 @@ static void __init noinline intel_init_l
 
 static void early_init_intel(struct cpuinfo_x86 *c)
 {
+	u64 misc_enable, disable;
+
 	/* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */
 	if (c->x86 == 15 && c->x86_cache_alignment == 64)
 		c->x86_cache_alignment = 128;
 
 	/* Unmask CPUID levels and NX if masked: */
-	if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
-		u64 misc_enable, disable;
+	rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
 
-		rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
+	disable = misc_enable & (MSR_IA32_MISC_ENABLE_LIMIT_CPUID |
+				 MSR_IA32_MISC_ENABLE_XD_DISABLE);
+	if (disable) {
+		wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable & ~disable);
+		bootsym(trampoline_misc_enable_off) |= disable;
+	}
 
-		disable = misc_enable & (MSR_IA32_MISC_ENABLE_LIMIT_CPUID |
-					 MSR_IA32_MISC_ENABLE_XD_DISABLE);
-		if (disable) {
-			wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable & ~disable);
-			bootsym(trampoline_misc_enable_off) |= disable;
-		}
-
-		if (disable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID)
-			printk(KERN_INFO "revised cpuid level: %d\n",
-			       cpuid_eax(0));
-		if (disable & MSR_IA32_MISC_ENABLE_XD_DISABLE) {
-			write_efer(read_efer() | EFER_NX);
-			printk(KERN_INFO
-			       "re-enabled NX (Execute Disable) protection\n");
-		}
+	if (disable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID)
+		printk(KERN_INFO "revised cpuid level: %d\n",
+		       cpuid_eax(0));
+	if (disable & MSR_IA32_MISC_ENABLE_XD_DISABLE) {
+		write_efer(read_efer() | EFER_NX);
+		printk(KERN_INFO
+		       "re-enabled NX (Execute Disable) protection\n");
 	}
 
 	/* CPUID workaround for Intel 0F33/0F34 CPU */
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -928,8 +928,7 @@ static int read_msr(unsigned int reg, ui
         goto normal;
 
     case MSR_IA32_MISC_ENABLE:
-        if ( rdmsr_safe(reg, *val) )
-            break;
+        rdmsrl(reg, *val);
         *val = guest_misc_enable(*val);
         return X86EMUL_OKAY;
 
@@ -1098,8 +1097,7 @@ static int write_msr(unsigned int reg, u
         return X86EMUL_OKAY;
 
     case MSR_IA32_MISC_ENABLE:
-        if ( rdmsr_safe(reg, temp) )
-            break;
+        rdmsrl(reg, temp);
         if ( val != guest_misc_enable(temp) )
             goto invalid;
         return X86EMUL_OKAY;




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/Intel: drop another 32-bit leftover
  2017-12-06 16:18 [PATCH] x86/Intel: drop another 32-bit leftover Jan Beulich
@ 2017-12-20 19:25 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2017-12-20 19:25 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

On 06/12/17 16:18, Jan Beulich wrote:
> None of the models MISC_ENABLE MSR access is excluded for support 64-bit
> mode - drop the conditional from early_init_intel(). Also convert
> pointless rdmsr_safe() elsewhere to rdmsrl().
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-20 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06 16:18 [PATCH] x86/Intel: drop another 32-bit leftover Jan Beulich
2017-12-20 19:25 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.