From: "Jan Beulich" Subject: [PATCH 3/8] x86/EPT: also dump permissions and memory types Date: Wed, 26 Mar 2014 15:34:05 +0000 Message-ID: <5333017D02000078000027EB@nat28.tlf.novell.com> References: <5332FF1902000078000027A2@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part87B5EB7D.1__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WSpqD-00014d-Cd for xen-devel@lists.xenproject.org; Wed, 26 Mar 2014 15:34:09 +0000 In-Reply-To: <5332FF1902000078000027A2@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Kevin Tian , Keir Fraser , Tim Deegan , Eddie Dong , Jun Nakajima , Yang Z Zhang List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part87B5EB7D.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm/p2m-ept.c +++ b/xen/arch/x86/mm/p2m-ept.c @@ -730,6 +730,14 @@ static void ept_dump_p2m_table(unsigned=20 unsigned long record_counter =3D 0; struct p2m_domain *p2m; struct ept_data *ept; + static const char memoryTypes[8][2] =3D { + [0 ... 7] =3D "?", + [MTRR_TYPE_UNCACHABLE] =3D "UC", + [MTRR_TYPE_WRCOMB] =3D "WC", + [MTRR_TYPE_WRTHROUGH] =3D "WT", + [MTRR_TYPE_WRPROT] =3D "WP", + [MTRR_TYPE_WRBACK] =3D "WB", + }; =20 for_each_domain(d) { @@ -759,8 +767,15 @@ static void ept_dump_p2m_table(unsigned=20 if ( ept_entry->sa_p2mt =3D=3D p2m_populate_on_demand ) printk("gfn: %13lx order: %2d PoD\n", gfn, order); else - printk("gfn: %13lx order: %2d mfn: %13lx\n", - gfn, order, ept_entry->mfn + 0UL); + printk("gfn: %13lx order: %2d mfn: %13lx %c%c%c = %c%c%c\n", + gfn, order, ept_entry->mfn + 0UL, + ept_entry->r ? 'r' : ' ', + ept_entry->w ? 'w' : ' ', + ept_entry->x ? 'x' : ' ', + memoryTypes[ept_entry->emt][0], + memoryTypes[ept_entry->emt][1] + ?: ept_entry->emt + '0', + ept_entry->ipat ? '!' : ' '); =20 if ( !(record_counter++ % 100) ) process_pending_softirqs(); --=__Part87B5EB7D.1__= Content-Type: text/plain; name="EPT-dump-types.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="EPT-dump-types.patch" x86/EPT: also dump permissions and memory types=0A=0ASigned-off-by: Jan = Beulich =0A=0A--- a/xen/arch/x86/mm/p2m-ept.c=0A+++ = b/xen/arch/x86/mm/p2m-ept.c=0A@@ -730,6 +730,14 @@ static void ept_dump_p2m= _table(unsigned =0A unsigned long record_counter =3D 0;=0A struct = p2m_domain *p2m;=0A struct ept_data *ept;=0A+ static const char = memoryTypes[8][2] =3D {=0A+ [0 ... 7] =3D "?",=0A+ [MTRR_TYPE= _UNCACHABLE] =3D "UC",=0A+ [MTRR_TYPE_WRCOMB] =3D = "WC",=0A+ [MTRR_TYPE_WRTHROUGH] =3D "WT",=0A+ [MTRR_TYPE= _WRPROT] =3D "WP",=0A+ [MTRR_TYPE_WRBACK] =3D = "WB",=0A+ };=0A =0A for_each_domain(d)=0A {=0A@@ -759,8 +767,15 = @@ static void ept_dump_p2m_table(unsigned =0A if ( = ept_entry->sa_p2mt =3D=3D p2m_populate_on_demand )=0A = printk("gfn: %13lx order: %2d PoD\n", gfn, order);=0A = else=0A- printk("gfn: %13lx order: %2d mfn: %13lx\n",=0A= - gfn, order, ept_entry->mfn + 0UL);=0A+ = printk("gfn: %13lx order: %2d mfn: %13lx %c%c%c %c%c%c\n",=0A+ = gfn, order, ept_entry->mfn + 0UL,=0A+ = ept_entry->r ? 'r' : ' ',=0A+ = ept_entry->w ? 'w' : ' ',=0A+ ept_entry->x ? 'x' = : ' ',=0A+ memoryTypes[ept_entry->emt][0],=0A+ = memoryTypes[ept_entry->emt][1]=0A+ = ?: ept_entry->emt + '0',=0A+ ept_entry-= >ipat ? '!' : ' ');=0A =0A if ( !(record_counter++ % 100) = )=0A process_pending_softirqs();=0A --=__Part87B5EB7D.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part87B5EB7D.1__=--