From: Wei Huang <wei.huang2@amd.com>
To: "'xen-devel@lists.xensource.com'" <xen-devel@lists.xensource.com>,
Chris Lalancette <clalance@redhat.com>,
"Sarathy, Bhavna" <Bhavna.Sarathy@amd.com>
Subject: [PATCH][P2M] check whether hap mode is enabled before using 2mb pages
Date: Thu, 18 Jun 2009 15:51:30 -0500 [thread overview]
Message-ID: <4A3AA8D2.6050301@amd.com> (raw)
[-- 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
reply other threads:[~2009-06-18 20:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A3AA8D2.6050301@amd.com \
--to=wei.huang2@amd.com \
--cc=Bhavna.Sarathy@amd.com \
--cc=clalance@redhat.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.