x86/pmu: Fix compilation on 32-bit hosts
PATCH 1/1 x86/pmu: Fix compilation on 32-bit hosts
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.
--- x86/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
x86/pmu.c +1 -1
@@ -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;
Signature · 1 line
2.18.1
Quoted 8 lines · Thomas Huth
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 typeUse the correct suffix to avoid this problem.
Signed-off-by Thomas Huth <[email protected]>
Thanks, I admit I did not test it on a 32-bit host.
Quoted 17 lines
--- x86/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)x86/pmu.c +1
-1@@ -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;
Quoted 11 lines · Like
Quoted 8 lines · Thomas Huth
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 typeUse the correct suffix to avoid this problem.
Signed-off-by Thomas Huth <[email protected]>Thanks, I admit I did not test it on a 32-bit host.
No problem, that's what the CI is good for :-)
(if you have a github or gitlab account, you can also run the tests there before submitting a patch)
Thomas
Paolo Bonzini
maintainerQuoted 18 lines · Thomas Huth
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 typeUse the correct suffix to avoid this problem.
Signed-off-by Thomas Huth <[email protected]>--- x86/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)x86/pmu.c +0
-0
x86/pmu.c static void do_unsupported_width_counter_write(void *index) · line 493
Quoted 8 lines
x86/pmu.c +1
-1@@ -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;
Oh ok, applied. Thanks,
Paolo