Commit 5f2b745f authored by Jim Mattson's avatar Jim Mattson Committed by Thomas Gleixner

x86/cpu: Make alternative_msr_write work for 32-bit code

Cast val and (val >> 32) to (u32), so that they fit in a
general-purpose register in both 32-bit and 64-bit code.

[ tglx: Made it u32 instead of uintptr_t ]

Fixes: c65732e4 ("x86/cpu: Restore CPUID_8000_0008_EBX reload")
Signed-off-by: default avatarJim Mattson <jmattson@google.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ffed645e
...@@ -265,8 +265,8 @@ void alternative_msr_write(unsigned int msr, u64 val, unsigned int feature) ...@@ -265,8 +265,8 @@ void alternative_msr_write(unsigned int msr, u64 val, unsigned int feature)
{ {
asm volatile(ALTERNATIVE("", "wrmsr", %c[feature]) asm volatile(ALTERNATIVE("", "wrmsr", %c[feature])
: : "c" (msr), : : "c" (msr),
"a" (val), "a" ((u32)val),
"d" (val >> 32), "d" ((u32)(val >> 32)),
[feature] "i" (feature) [feature] "i" (feature)
: "memory"); : "memory");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment