So far only applied in a couple obvious places, where temporary prefixes were already used. Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx> --- x86/apic.c | 8 ++++++-- x86/pmu.c | 24 ++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/x86/apic.c b/x86/apic.c index 2619d85941907..365c281547331 100644 --- a/x86/apic.c +++ b/x86/apic.c @@ -121,19 +121,23 @@ static void test_apicbase(void) wrmsr(MSR_IA32_APICBASE, orig_apicbase & ~(APIC_EN | APIC_EXTD)); wrmsr(MSR_IA32_APICBASE, ALTERNATE_APIC_BASE | APIC_BSP | APIC_EN); + report_prefix_push("apicbase"); + report("relocate apic", *(volatile u32 *)(ALTERNATE_APIC_BASE + APIC_LVR) == lvr); value = orig_apicbase | (1UL << cpuid_maxphyaddr()); - report("apicbase: reserved physaddr bits", + report("reserved physaddr bits", test_for_exception(GP_VECTOR, do_write_apicbase, &value)); value = orig_apicbase | 1; - report("apicbase: reserved low bits", + report("reserved low bits", test_for_exception(GP_VECTOR, do_write_apicbase, &value)); wrmsr(MSR_IA32_APICBASE, orig_apicbase); apic_write(APIC_SPIV, 0x1ff); + + report_prefix_pop(); } static void eoi(void) diff --git a/x86/pmu.c b/x86/pmu.c index f116bafebf424..56fe1e3d9d301 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -309,6 +309,8 @@ static void check_counter_overflow(void) /* clear status before test */ wrmsr(MSR_CORE_PERF_GLOBAL_OVF_CTRL, rdmsr(MSR_CORE_PERF_GLOBAL_STATUS)); + report_prefix_push("overflow"); + for (i = 0; i < num_counters + 1; i++, cnt.ctr++) { uint64_t status; int idx; @@ -321,14 +323,16 @@ static void check_counter_overflow(void) idx = event_to_global_idx(&cnt); cnt.count = 1 - count; measure(&cnt, 1); - report("overflow-%d", cnt.count == 1, i); + report("cntr-%d", cnt.count == 1, i); status = rdmsr(MSR_CORE_PERF_GLOBAL_STATUS); - report("overflow status-%d", status & (1ull << idx), i); + report("status-%d", status & (1ull << idx), i); wrmsr(MSR_CORE_PERF_GLOBAL_OVF_CTRL, status); status = rdmsr(MSR_CORE_PERF_GLOBAL_STATUS); - report("overflow status clear-%d", !(status & (1ull << idx)), i); - report("overflow irq-%d", check_irq() == (i % 2), i); + report("status clear-%d", !(status & (1ull << idx)), i); + report("irq-%d", check_irq() == (i % 2), i); } + + report_prefix_pop(); } static void check_gp_counter_cmask(void) @@ -348,20 +352,24 @@ static void check_rdpmc(void) uint64_t val = 0x1f3456789ull; int i; + report_prefix_push("rdpmc"); + for (i = 0; i < num_counters; i++) { uint64_t x = (val & 0xffffffff) | ((1ull << (eax.split.bit_width - 32)) - 1) << 32; wrmsr(MSR_IA32_PERFCTR0 + i, val); - report("rdpmc-%d", rdpmc(i) == x, i); - report("rdpmc fast-%d", rdpmc(i | (1<<31)) == (u32)val, i); + report("cntr-%d", rdpmc(i) == x, i); + report("fast-%d", rdpmc(i | (1<<31)) == (u32)val, i); } for (i = 0; i < edx.split.num_counters_fixed; i++) { uint64_t x = (val & 0xffffffff) | ((1ull << (edx.split.bit_width_fixed - 32)) - 1) << 32; wrmsr(MSR_CORE_PERF_FIXED_CTR0 + i, val); - report("rdpmc fixed-%d", rdpmc(i | (1 << 30)) == x, i); - report("rdpmc fixed fast-%d", rdpmc(i | (3<<30)) == (u32)val, i); + report("fixed cntr-%d", rdpmc(i | (1 << 30)) == x, i); + report("fixed fast-%d", rdpmc(i | (3<<30)) == (u32)val, i); } + + report_prefix_pop(); } int main(int ac, char **av) -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html