mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 05:41:55 +00:00
x86/fpu: Use unsigned long long shift in xfeature_uncompacted_offset()
The xfeature mask is 64-bit so a shift from a number to its mask should have ULL suffix or else bits above position 31 will be lost. This is not a problem now but should XFEATURE_MASK_SUPERVISOR gain a bit >31 then this check won't catch it. Use BIT_ULL() to compute a mask from a number. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Rik van Riel <riel@surriel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: "Jason A. Donenfeld" <Jason@zx2c4.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: kvm ML <kvm@vger.kernel.org> Cc: x86-ml <x86@kernel.org> Link: https://lkml.kernel.org/r/20181128222035.2996-2-bigeasy@linutronix.de
This commit is contained in:
parent
2595646791
commit
d084523901
@ -444,7 +444,7 @@ static int xfeature_uncompacted_offset(int xfeature_nr)
|
||||
* format. Checking a supervisor state's uncompacted offset is
|
||||
* an error.
|
||||
*/
|
||||
if (XFEATURE_MASK_SUPERVISOR & (1 << xfeature_nr)) {
|
||||
if (XFEATURE_MASK_SUPERVISOR & BIT_ULL(xfeature_nr)) {
|
||||
WARN_ONCE(1, "No fixed offset for xstate %d\n", xfeature_nr);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user