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] P2M: check whether hap mode is enabled be

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] P2M: check whether hap mode is enabled before using 2mb pages
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Jun 2009 00:57:08 -0700
Delivery-date: Fri, 19 Jun 2009 01:10:57 -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 1245397378 -3600
# Node ID c3a94ac4c03172d31eab8899013f9253592fe20f
# Parent  78962f85c56279118b96f64f4042b591f5b85e26
P2M: check whether hap mode is enabled before using 2mb pages

This small patch checks whether hap mode is enabled when guest is
trying to allocate 2MB pages inside P2M. This prevents potential
errors when hap is disabled.

Cc: Chris Lalancette <clalance@xxxxxxxxxx>
Cc: Sarathy, Bhavna <Bhavna.Sarathy@xxxxxxx>
Signed-off-by: Wei Huang <wei.huang2@xxxxxxx>
---
 xen/arch/x86/mm/p2m.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -r 78962f85c562 -r c3a94ac4c031 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Fri Jun 19 08:41:50 2009 +0100
+++ b/xen/arch/x86/mm/p2m.c     Fri Jun 19 08:42:58 2009 +0100
@@ -1499,7 +1499,11 @@ int set_p2m_entry(struct domain *d, unsi
 
     while ( todo )
     {
-        order = (((gfn | mfn_x(mfn) | todo) & ((1ul << 9) - 1)) == 0) ? 9 : 0;
+        if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled )
+            order = (((gfn | mfn_x(mfn) | todo) & ((1ul << 9) - 1)) == 0) ?
+                9 : 0;
+        else
+            order = 0;
         rc = d->arch.p2m->set_entry(d, gfn, mfn, order, p2mt);
         gfn += 1ul << order;
         if ( mfn_x(mfn) != INVALID_MFN )

_______________________________________________
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] P2M: check whether hap mode is enabled before using 2mb pages, Xen patchbot-unstable <=