All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][P2M] check whether hap mode is enabled before using 2mb pages
@ 2009-06-18 20:51 Wei Huang
  0 siblings, 0 replies; only message in thread
From: Wei Huang @ 2009-06-18 20:51 UTC (permalink / raw)
  To: 'xen-devel@lists.xensource.com', Chris Lalancette,
	Sarathy, Bhavna

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

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@redhat.com>
Cc: Sarathy, Bhavna <Bhavna.Sarathy@amd.com>
Signed-off-by: Wei Huang <wei.huang2@amd.com>




[-- Attachment #2: superpage_checks_hap_enabled.txt --]
[-- Type: text/plain, Size: 676 bytes --]

diff -r 55ca7ef865b4 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Tue Jun 16 11:01:17 2009 +0100
+++ b/xen/arch/x86/mm/p2m.c	Thu Jun 18 13:07:10 2009 -0500
@@ -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 )

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-18 20:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-18 20:51 [PATCH][P2M] check whether hap mode is enabled before using 2mb pages Wei Huang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.