perf/x86/intel/pt: Fix the 32-bit build
authorIngo Molnar <[email protected]>
Thu, 2 Apr 2015 15:57:59 +0000 (17:57 +0200)
committerIngo Molnar <[email protected]>
Thu, 2 Apr 2015 15:58:45 +0000 (17:58 +0200)
On a 32-bit build I got:

  arch/x86/kernel/cpu/perf_event_intel_pt.c:413:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  arch/x86/kernel/cpu/perf_event_intel_bts.c:162:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Fix it. The code should probably be (re-)tested on 32-bit systems to make
sure all is fine.

Cc: Alexander Shishkin <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Kaixu Xia <[email protected]>
Cc: [email protected]
Cc: Peter Zijlstra (Intel) <[email protected]>
Cc: Robert Richter <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/cpu/perf_event_intel_bts.c
arch/x86/kernel/cpu/perf_event_intel_pt.c

index fb1a4c28f3e14bb68cf7f8ffcbab8671b6e8f458..ac1f0c55f3796e17bdaddc5f946a41509890e446 100644 (file)
@@ -159,7 +159,7 @@ bts_config_buffer(struct bts_buffer *buf)
                        thresh = end;
        }
 
-       ds->bts_buffer_base = (u64)page_address(page) + phys->displacement;
+       ds->bts_buffer_base = (u64)(long)page_address(page) + phys->displacement;
        ds->bts_index = ds->bts_buffer_base + index;
        ds->bts_absolute_maximum = ds->bts_buffer_base + end;
        ds->bts_interrupt_threshold = !buf->snapshot
index a9a1092cf836a931929228856a40174817bb9dea..f5a3afc653711264b68154a2d7b6314113844b85 100644 (file)
@@ -409,8 +409,8 @@ static void pt_topa_dump(struct pt_buffer *buf)
        list_for_each_entry(topa, &buf->tables, list) {
                int i;
 
-               pr_debug("# table @%p (%p), off %llx size %zx\n", topa->table,
-                        (void *)topa->phys, topa->offset, topa->size);
+               pr_debug("# table @%p (%016Lx), off %llx size %zx\n", topa->table,
+                        topa->phys, topa->offset, topa->size);
                for (i = 0; i < TENTS_PER_PAGE; i++) {
                        pr_debug("# entry @%p (%lx sz %u %c%c%c) raw=%16llx\n",
                                 &topa->table[i],