SSB fixup patch #1
Subsystems (2)
PATCH 1/1 SSB fixup patch #1
Cast val and (val >> 32) to uintptr_t, so that they fit in a general-purpose register in both 32-bit and 64-bit code.
--- arch/x86/include/asm/nospec-branch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/nospec-branch.h +2 -2
@@ -265,8 +265,8 @@ void alternative_msr_write(unsigned int msr, u64 val, unsigned int feature) { asm volatile(ALTERNATIVE("", "wrmsr", %c[feature]) : : "c" (msr), - "a" (val), - "d" (val >> 32), + "a" ((uintptr_t)val), + "d" ((uintptr_t)(val >> 32)), [feature] "i" (feature) : "memory"); }
Signature · 1 line
2.14.3
Quoted 17 lines · speck for konrad.wilk_at_oracle.com
x86/cpu: Make
alternative_msr_writework for 32-bit codeCast val and (val >> 32) to
uintptr_t, so that they fit in a general-purpose register in both 32-bit and 64-bit code.Fixes c65732e4f721 ("x86/cpu: Restore CPUID_8000_0008_EBX reload")Signed-off-by Jim Mattson <[email protected]>Signed-off-by Konrad Rzeszutek Wilk <[email protected]>--- arch/x86/include/asm/nospec-branch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/x86/include/asm/nospec-branch.h +0
-0
arch/x86/include/asm/nospec-branch.h void alternative_msr_write(unsigned int msr, u64 val, unsigned int feature) · line 269
Quoted 7 lines
arch/x86/include/asm/nospec-branch.h +2
-2@@ -265,8 +265,8 @@ void alternative_msr_write(unsigned int msr, u64 val, unsigned int feature) { asm volatile(ALTERNATIVE("", "wrmsr", %c[feature]) : : "c" (msr), -"a" (val), - "d" (val >> 32), +"a" ((uintptr_t )val), + "d" ((uintptr_t)(val >> 32)),
Make those casts (u32) simply as the rest of the MSR code does.
Signature · 5 lines
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- Quoted 2 lines · speck for Borislav Petkov
Make those casts (u32) simply as the rest of the MSR code does.
Yeah, that's probably the right type.
Linus
Quoted 5 lines · speck for Linus Torvalds
Quoted 2 lines · speck for Borislav Petkov
Make those casts (u32) simply as the rest of the MSR code does.
Yeah, that's probably the right type.
Indeed. I fixed it up and applied it.
Thanks,
tglx
Quoted 3 lines · speck for konrad.wilk_at_oracle.com
Cast val and (val >> 32) to
uintptr_t, so that they fit in a general-purpose register in both 32-bit and 64-bit code.
Fair enough. Except why "uintptr_t"? That feels like an odd choice. The values have nothing to do with pointers.
It's a fine type, and I guess it approximates "native register size", but so does "long".
So "Ack", albeit with a query about why that particular type was chosen..
Linus