[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/CPUID: don't use UB shift when library is built as 32-bit



commit db1a9fdd554cb1d8a7099af7925318fc06c6875b
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Nov 10 14:39:03 2020 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Nov 10 14:39:03 2020 +0100

    x86/CPUID: don't use UB shift when library is built as 32-bit
    
    At least the insn emulator test harness will continue to be buildable
    (and ought to continue to be usable) also as a 32-bit binary. (Right now
    the CPU policy test harness is, too, but there it may be less relevant
    to keep it functional, just like e.g. we don't support fuzzing the insn
    emulator in 32-bit mode.) Hence the library code needs to cope with
    this.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/lib/x86/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/lib/x86/cpuid.c b/xen/lib/x86/cpuid.c
index c7a0508148..8eb88314f5 100644
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -165,7 +165,7 @@ void x86_cpuid_policy_fill_native(struct cpuid_policy *p)
         for ( i = 2; i < min_t(unsigned int, 63,
                                ARRAY_SIZE(p->xstate.raw)); ++i )
         {
-            if ( xstates & (1ul << i) )
+            if ( xstates & (1ull << i) )
                 cpuid_count_leaf(0xd, i, &p->xstate.raw[i]);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.