All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/CPUID: don't use UB shift when library is built as 32-bit
@ 2020-11-09 10:53 Jan Beulich
  2020-11-09 10:54 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2020-11-09 10:53 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné

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@suse.com>

--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -165,7 +165,7 @@ void x86_cpuid_policy_fill_native(struct
         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]);
         }
     }


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

* Re: [PATCH] x86/CPUID: don't use UB shift when library is built as 32-bit
  2020-11-09 10:53 [PATCH] x86/CPUID: don't use UB shift when library is built as 32-bit Jan Beulich
@ 2020-11-09 10:54 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2020-11-09 10:54 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Wei Liu, Roger Pau Monné

On 09/11/2020 10:53, Jan Beulich wrote:
> 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@suse.com>

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


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

end of thread, other threads:[~2020-11-09 10:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 10:53 [PATCH] x86/CPUID: don't use UB shift when library is built as 32-bit Jan Beulich
2020-11-09 10:54 ` 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.