From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Keir Fraser <keir@xen.org>,
George Dunlap <george.dunlap@eu.citrix.com>,
Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH 2/2] pvh: set only minimal cr0 and cr4 flags in order to use paging
Date: Tue, 19 Nov 2013 13:34:48 +0100 [thread overview]
Message-ID: <1384864488-5194-3-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1384864488-5194-1-git-send-email-roger.pau@citrix.com>
Right now Xen sets the WP and NE flags on cr0 for PVH, which are not
needed in order to boot with paging enabled. The same happens with
cr4, at least on my system OSFXSR, OSXMMEXCPT and MCE are enabled by
default when there's no need.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Mukesh Rathor <mukesh.rathor@oracle.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>
---
xen/arch/x86/hvm/vmx/vmcs.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 290b42f..33e2544 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -28,7 +28,6 @@
#include <asm/msr.h>
#include <asm/xstate.h>
#include <asm/hvm/hvm.h>
-#include <asm/hvm/nestedhvm.h>
#include <asm/hvm/io.h>
#include <asm/hvm/support.h>
#include <asm/hvm/vmx/vmx.h>
@@ -1089,13 +1088,11 @@ static int construct_vmcs(struct vcpu *v)
/* PVH domains always start in paging mode */
if ( is_pvh_domain(d) )
- v->arch.hvm_vcpu.guest_cr[0] |= X86_CR0_PG | X86_CR0_NE | X86_CR0_WP;
+ v->arch.hvm_vcpu.guest_cr[0] |= X86_CR0_PG;
hvm_update_guest_cr(v, 0);
- v->arch.hvm_vcpu.guest_cr[4] = is_pvh_domain(d) ?
- (real_cr4_to_pv_guest_cr4(mmu_cr4_features)
- & ~HVM_CR4_GUEST_RESERVED_BITS(v)) : 0;
+ v->arch.hvm_vcpu.guest_cr[4] = is_pvh_domain(d) ? X86_CR4_PAE : 0;
hvm_update_guest_cr(v, 4);
if ( cpu_has_vmx_tpr_shadow )
--
1.7.7.5 (Apple Git-26)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2013-11-19 12:35 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-19 12:34 [PATCH 1/2] pvh: proposed BSP/AP bringup changes Roger Pau Monne
2013-11-19 12:34 ` [PATCH 1/2] pvh: clearly specify used parameters in vcpu_guest_context Roger Pau Monne
2013-11-19 13:32 ` Jan Beulich
2013-11-19 15:04 ` Roger Pau Monné
2013-11-19 15:34 ` Jan Beulich
2013-11-19 16:42 ` Roger Pau Monné
2013-11-19 16:53 ` Jan Beulich
2013-11-20 9:18 ` Roger Pau Monné
2013-11-20 9:28 ` Jan Beulich
2013-11-20 9:37 ` Roger Pau Monné
2013-11-20 9:54 ` Jan Beulich
2013-11-20 10:29 ` Roger Pau Monné
2013-11-20 18:19 ` George Dunlap
2013-11-20 18:24 ` Roger Pau Monné
2013-11-20 21:19 ` Mukesh Rathor
2013-11-22 17:38 ` George Dunlap
2013-11-21 13:16 ` Tim Deegan
2013-11-19 12:34 ` Roger Pau Monne [this message]
2013-11-19 13:34 ` [PATCH 2/2] pvh: set only minimal cr0 and cr4 flags in order to use paging Jan Beulich
2013-11-25 13:25 ` Jan Beulich
2013-11-25 14:53 ` George Dunlap
2013-11-25 22:39 ` Mukesh Rathor
2013-11-26 0:29 ` Dong, Eddie
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=1384864488-5194-3-git-send-email-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=JBeulich@suse.com \
--cc=george.dunlap@eu.citrix.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).