From: Keir Fraser <keir.fraser@eu.citrix.com>
To: "Nakajima, Jun" <jun.nakajima@intel.com>,
Gianluca Guida <gianluca.guida@eu.citrix.com>
Cc: "Li, Haicheng" <haicheng.li@intel.com>,
"'xen-devel@lists.xensource.com'" <xen-devel@lists.xensource.com>,
"Li, Xin" <xin.li@intel.com>
Subject: Re: Weekly VMX status report. Xen: #18846 & Xen0: #749
Date: Mon, 15 Dec 2008 13:02:24 +0000 [thread overview]
Message-ID: <C56C05E1.CD5%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <0B53E02A2965CE4F9ADB38B34501A3A16825BA99@orsmsx505.amr.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 568 bytes --]
On 13/12/2008 22:43, "Nakajima, Jun" <jun.nakajima@intel.com> wrote:
>> I think you agree that we don't need to keep guest 'actual' EFER.NX in
>> sync with its 'shadow' EFER.NX?
>>
>
> That should be okay. The fact we see the NX bit in the shadow page tables
> means at least the BSP enabled NX. And I don't expect other processors would
> do otherwise. In other words, such out-of-sync situations be transient anyway.
Attached is my proposed patch. Does it look okay to everyone? Haicheng:
could you test if it gets rid of the HVM Solaris crash?
Thanks,
Keir
[-- Attachment #2: nx-patch --]
[-- Type: application/octet-stream, Size: 2383 bytes --]
diff -r f827181eadd4 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c Mon Dec 15 11:37:14 2008 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c Mon Dec 15 12:59:57 2008 +0000
@@ -306,9 +306,6 @@ static void vmx_restore_host_msrs(void)
wrmsrl(msr_index[i], host_msr_state->msrs[i]);
clear_bit(i, &host_msr_state->flags);
}
-
- if ( cpu_has_nx && !(read_efer() & EFER_NX) )
- write_efer(read_efer() | EFER_NX);
}
static void vmx_save_guest_msrs(struct vcpu *v)
@@ -342,39 +339,23 @@ static void vmx_restore_guest_msrs(struc
clear_bit(i, &guest_flags);
}
- if ( (v->arch.hvm_vcpu.guest_efer ^ read_efer()) & (EFER_NX | EFER_SCE) )
+ if ( (v->arch.hvm_vcpu.guest_efer ^ read_efer()) & EFER_SCE )
{
HVM_DBG_LOG(DBG_LEVEL_2,
"restore guest's EFER with value %lx",
v->arch.hvm_vcpu.guest_efer);
- write_efer((read_efer() & ~(EFER_NX | EFER_SCE)) |
- (v->arch.hvm_vcpu.guest_efer & (EFER_NX | EFER_SCE)));
+ write_efer((read_efer() & ~EFER_SCE) |
+ (v->arch.hvm_vcpu.guest_efer & EFER_SCE));
}
}
#else /* __i386__ */
#define vmx_save_host_msrs() ((void)0)
-
-static void vmx_restore_host_msrs(void)
-{
- if ( cpu_has_nx && !(read_efer() & EFER_NX) )
- write_efer(read_efer() | EFER_NX);
-}
+#define vmx_restore_host_msrs() ((void)0)
#define vmx_save_guest_msrs(v) ((void)0)
-
-static void vmx_restore_guest_msrs(struct vcpu *v)
-{
- if ( (v->arch.hvm_vcpu.guest_efer ^ read_efer()) & EFER_NX )
- {
- HVM_DBG_LOG(DBG_LEVEL_2,
- "restore guest's EFER with value %lx",
- v->arch.hvm_vcpu.guest_efer);
- write_efer((read_efer() & ~EFER_NX) |
- (v->arch.hvm_vcpu.guest_efer & EFER_NX));
- }
-}
+#define vmx_restore_guest_msrs(v) ((void)0)
static enum handler_return long_mode_do_msr_read(struct cpu_user_regs *regs)
{
@@ -1190,8 +1171,8 @@ static void vmx_update_guest_efer(struct
#endif
if ( v == current )
- write_efer((read_efer() & ~(EFER_NX|EFER_SCE)) |
- (v->arch.hvm_vcpu.guest_efer & (EFER_NX|EFER_SCE)));
+ write_efer((read_efer() & ~EFER_SCE) |
+ (v->arch.hvm_vcpu.guest_efer & EFER_SCE));
}
static void vmx_flush_guest_tlbs(void)
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2008-12-15 13:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E88DD564E9DC5446A76B2B47C3BCCA1540A67C2A@pdsmsx503.ccr.corp.intel.com>
2008-12-07 8:41 ` Weekly VMX status report. Xen: #18846 & Xen0: #749 Keir Fraser
2008-12-08 3:00 ` Cui, Dexuan
2008-12-12 20:37 ` Gianluca Guida
2008-12-12 23:22 ` Keir Fraser
2008-12-12 23:30 ` Gianluca Guida
2008-12-13 14:06 ` Keir Fraser
2008-12-13 15:14 ` Nakajima, Jun
2008-12-13 15:40 ` Keir Fraser
2008-12-13 22:43 ` Nakajima, Jun
2008-12-13 23:21 ` Keir Fraser
2008-12-15 13:02 ` Keir Fraser [this message]
2008-12-16 5:54 ` Li, Haicheng
2008-12-16 7:24 ` Li, Haicheng
2008-12-16 11:55 ` Keir Fraser
[not found] <E88DD564E9DC5446A76B2B47C3BCCA15432C0FC2@pdsmsx503.ccr.corp.intel.com>
2008-12-16 12:29 ` Keir Fraser
2008-12-16 12:33 ` Li, Xin
2008-12-06 11:45 Li, Haicheng
2008-12-06 12:16 ` Keir Fraser
2008-12-06 12:21 ` Li, Haicheng
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=C56C05E1.CD5%keir.fraser@eu.citrix.com \
--to=keir.fraser@eu.citrix.com \
--cc=gianluca.guida@eu.citrix.com \
--cc=haicheng.li@intel.com \
--cc=jun.nakajima@intel.com \
--cc=xen-devel@lists.xensource.com \
--cc=xin.li@intel.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.