From b9d1d77c001507c4c414b83666a3f59e327364c3 Mon Sep 17 00:00:00 2001 From: George Dunlap Date: Mon, 15 Feb 2016 14:58:29 +0000 Subject: [PATCH] xen/p2m: Make dump table printing less clever Rather than detecting whether to print out the numerical value of the memory type based on whether the second byte of the stringified value is a null character, just always print out both. Signed-off-by: George Dunlap --- CC: Andrew Cooper CC: Jan Beulich CC: Tim Deegan --- xen/arch/x86/mm/p2m-ept.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index 3cb6868..be528e7 100644 --- a/xen/arch/x86/mm/p2m-ept.c +++ b/xen/arch/x86/mm/p2m-ept.c @@ -1204,7 +1204,7 @@ void ept_p2m_uninit(struct p2m_domain *p2m) static const char *memory_type_to_str(unsigned int x) { - static const char memory_types[8][3] = { + static const char *memory_types[8] = { [MTRR_TYPE_UNCACHABLE] = "UC", [MTRR_TYPE_WRCOMB] = "WC", [MTRR_TYPE_WRTHROUGH] = "WT", @@ -1262,14 +1262,13 @@ static void ept_dump_p2m_table(unsigned char key) if ( ept_entry->sa_p2mt == p2m_populate_on_demand ) printk("gfn: %13lx order: %2d PoD\n", gfn, order); else - printk("gfn: %13lx order: %2d mfn: %13lx %c%c%c %c%c%c\n", + printk("gfn: %13lx order: %2d mfn: %13lx %c%c%c %s(%d)%c\n", gfn, order, ept_entry->mfn + 0UL, ept_entry->r ? 'r' : ' ', ept_entry->w ? 'w' : ' ', ept_entry->x ? 'x' : ' ', - memory_type_to_str(ept_entry->emt)[0], - memory_type_to_str(ept_entry->emt)[1] - ?: ept_entry->emt + '0', + memory_type_to_str(ept_entry->emt), + ept_entry->emt, c ?: ept_entry->ipat ? '!' : ' '); if ( !(record_counter++ % 100) ) -- 2.1.4