Re: [kvm-unit-tests PATCH] x86/pmu: Fix compilation on 32-bit hosts

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

 



On 2020/6/16 18:59, Thomas Huth wrote:
When building for 32-bit hosts, the compiler currently complains:

  x86/pmu.c: In function 'check_gp_counters_write_width':
  x86/pmu.c:490:30: error: left shift count >= width of type

Use the correct suffix to avoid this problem.

Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
Thanks, I admit I did not test it on a 32-bit host.
---
  x86/pmu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/x86/pmu.c b/x86/pmu.c
index 57a2b23..91a6fb4 100644
--- a/x86/pmu.c
+++ b/x86/pmu.c
@@ -487,7 +487,7 @@ static void do_unsupported_width_counter_write(void *index)
  static void  check_gp_counters_write_width(void)
  {
  	u64 val_64 = 0xffffff0123456789ull;
-	u64 val_32 = val_64 & ((1ul << 32) - 1);
+	u64 val_32 = val_64 & ((1ull << 32) - 1);
  	u64 val_max_width = val_64 & ((1ul << eax.split.bit_width) - 1);
  	int i;




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux