WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86, hap: Track max_mapped_pfn better whe

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86, hap: Track max_mapped_pfn better when using 2MB p2m mappings.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Oct 2008 07:00:11 -0700
Delivery-date: Thu, 23 Oct 2008 07:00:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224673100 -3600
# Node ID 96d8b7f40dc71aeb5f630fcedefd47e724aa3ec8
# Parent  066c84c7018accc44fbec78d3618d12147d7ab54
x86, hap: Track max_mapped_pfn better when using 2MB p2m mappings.

The test for when to increase it was not quite right; also on EPT
the value it was set to didn't count the top 511 frames.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---
 xen/arch/x86/mm/hap/p2m-ept.c |    8 +++++---
 xen/arch/x86/mm/p2m.c         |    3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff -r 066c84c7018a -r 96d8b7f40dc7 xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c     Wed Oct 22 11:56:44 2008 +0100
+++ b/xen/arch/x86/mm/hap/p2m-ept.c     Wed Oct 22 11:58:20 2008 +0100
@@ -157,9 +157,6 @@ ept_set_entry(struct domain *d, unsigned
     {
         if ( mfn_valid(mfn_x(mfn)) || (p2mt == p2m_mmio_direct) )
         {
-            /* Track the highest gfn for which we have ever had a valid 
mapping */
-            if ( gfn > d->arch.p2m->max_mapped_pfn )
-                d->arch.p2m->max_mapped_pfn = gfn;
             ept_entry->emt = epte_get_entry_emt(d, gfn, mfn_x(mfn));
             ept_entry->sp_avail = walk_level ? 1 : 0;
 
@@ -233,6 +230,11 @@ ept_set_entry(struct domain *d, unsigned
 
         unmap_domain_page(split_table);
     }
+
+    /* Track the highest gfn for which we have ever had a valid mapping */
+    if ( mfn_valid(mfn_x(mfn))
+         && (gfn + (1UL << order) - 1 > d->arch.p2m->max_mapped_pfn) )
+        d->arch.p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
     /* Success */
     rv = 1;
diff -r 066c84c7018a -r 96d8b7f40dc7 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Wed Oct 22 11:56:44 2008 +0100
+++ b/xen/arch/x86/mm/p2m.c     Wed Oct 22 11:58:20 2008 +0100
@@ -322,7 +322,8 @@ p2m_set_entry(struct domain *d, unsigned
     }
 
     /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( mfn_valid(mfn) && (gfn > d->arch.p2m->max_mapped_pfn) )
+    if ( mfn_valid(mfn) 
+         && (gfn + (1UL << page_order) - 1 > d->arch.p2m->max_mapped_pfn) )
         d->arch.p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1;
 
     if ( iommu_enabled && (is_hvm_domain(d) || need_iommu(d)) )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86, hap: Track max_mapped_pfn better when using 2MB p2m mappings., Xen patchbot-unstable <=