From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 3/8] x86/EPT: also dump permissions and memory types Date: Thu, 27 Mar 2014 13:06:23 +0000 Message-ID: <5334224F.2070308@citrix.com> References: <5332FF1902000078000027A2@nat28.tlf.novell.com> <5333017D02000078000027EB@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1638524187516127155==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WTA1C-0006lR-C4 for xen-devel@lists.xenproject.org; Thu, 27 Mar 2014 13:06:50 +0000 In-Reply-To: <5333017D02000078000027EB@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: Jan Beulich Cc: Kevin Tian , Keir Fraser , Tim Deegan , Eddie Dong , Jun Nakajima , Yang Z Zhang , xen-devel List-Id: xen-devel@lists.xenproject.org --===============1638524187516127155== Content-Type: multipart/alternative; boundary="------------000308050105020908000304" --------------000308050105020908000304 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 26/03/14 15:34, Jan Beulich wrote: > 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 > unsigned long record_counter = 0; > struct p2m_domain *p2m; > struct ept_data *ept; > + static const char memoryTypes[8][2] = { > + [0 ... 7] = "?", > + [MTRR_TYPE_UNCACHABLE] = "UC", > + [MTRR_TYPE_WRCOMB] = "WC", > + [MTRR_TYPE_WRTHROUGH] = "WT", > + [MTRR_TYPE_WRPROT] = "WP", > + [MTRR_TYPE_WRBACK] = "WB", > + }; Dont we have an identical structure somewhere else in Xen already? ~Andrew > > for_each_domain(d) > { > @@ -759,8 +767,15 @@ static void ept_dump_p2m_table(unsigned > 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\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 ? '!' : ' '); > > if ( !(record_counter++ % 100) ) > process_pending_softirqs(); > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------000308050105020908000304 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
On 26/03/14 15:34, Jan Beulich wrote:
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- 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 
     unsigned long record_counter = 0;
     struct p2m_domain *p2m;
     struct ept_data *ept;
+    static const char memoryTypes[8][2] = {
+        [0 ... 7] = "?",
+        [MTRR_TYPE_UNCACHABLE]     = "UC",
+        [MTRR_TYPE_WRCOMB]         = "WC",
+        [MTRR_TYPE_WRTHROUGH]      = "WT",
+        [MTRR_TYPE_WRPROT]         = "WP",
+        [MTRR_TYPE_WRBACK]         = "WB",
+    };

Dont we have an identical structure somewhere else in Xen already?

~Andrew

 
     for_each_domain(d)
     {
@@ -759,8 +767,15 @@ static void ept_dump_p2m_table(unsigned 
                 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\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 ? '!' : ' ');
 
                 if ( !(record_counter++ % 100) )
                     process_pending_softirqs();





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--------------000308050105020908000304-- --===============1638524187516127155== 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 --===============1638524187516127155==--