From: Arun Sharma <arun.sharma@intel.com>
To: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>,
Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: [PATCH] sysenter-msr.patch
Date: Tue, 14 Jun 2005 15:51:56 -0700 [thread overview]
Message-ID: <20050614225156.GA17720@intel.com> (raw)
Handle MSR reads/writes to sysenter related MSRs.
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Chengyuan Li <chengyuan.li@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
--- a/xen/arch/x86/vmx.c Tue Jun 14 21:00:58 2005
+++ b/xen/arch/x86/vmx.c Tue Jun 14 15:46:17 2005
@@ -1009,10 +1009,50 @@
VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read: ecx=%lx, eax=%lx, edx=%lx",
(unsigned long)regs->ecx, (unsigned long)regs->eax,
(unsigned long)regs->edx);
-
- rdmsr(regs->ecx, regs->eax, regs->edx);
+ switch (regs->ecx) {
+ case MSR_IA32_SYSENTER_CS:
+ __vmread(GUEST_SYSENTER_CS, ®s->eax);
+ regs->edx = 0;
+ break;
+ case MSR_IA32_SYSENTER_ESP:
+ __vmread(GUEST_SYSENTER_ESP, ®s->eax);
+ regs->edx = 0;
+ break;
+ case MSR_IA32_SYSENTER_EIP:
+ __vmread(GUEST_SYSENTER_EIP, ®s->eax);
+ regs->edx = 0;
+ break;
+ default:
+ rdmsr(regs->ecx, regs->eax, regs->edx);
+ break;
+ }
VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read returns: "
+ "ecx=%lx, eax=%lx, edx=%lx",
+ (unsigned long)regs->ecx, (unsigned long)regs->eax,
+ (unsigned long)regs->edx);
+}
+
+static inline void vmx_do_msr_write(struct cpu_user_regs *regs)
+{
+ VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_write: ecx=%lx, eax=%lx, edx=%lx",
+ (unsigned long)regs->ecx, (unsigned long)regs->eax,
+ (unsigned long)regs->edx);
+ switch (regs->ecx) {
+ case MSR_IA32_SYSENTER_CS:
+ __vmwrite(GUEST_SYSENTER_CS, regs->eax);
+ break;
+ case MSR_IA32_SYSENTER_ESP:
+ __vmwrite(GUEST_SYSENTER_ESP, regs->eax);
+ break;
+ case MSR_IA32_SYSENTER_EIP:
+ __vmwrite(GUEST_SYSENTER_EIP, regs->eax);
+ break;
+ default:
+ break;
+ }
+
+ VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_write returns: "
"ecx=%lx, eax=%lx, edx=%lx",
(unsigned long)regs->ecx, (unsigned long)regs->eax,
(unsigned long)regs->edx);
@@ -1332,9 +1372,7 @@
break;
case EXIT_REASON_MSR_WRITE:
__vmread(GUEST_RIP, &eip);
- VMX_DBG_LOG(DBG_LEVEL_1, "MSR_WRITE: eip=%lx, eax=%lx, edx=%lx",
- eip, (unsigned long)regs.eax, (unsigned long)regs.edx);
- /* just ignore this point */
+ vmx_do_msr_write(®s);
__get_instruction_length(inst_len);
__update_guest_eip(inst_len);
break;
reply other threads:[~2005-06-14 22: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=20050614225156.GA17720@intel.com \
--to=arun.sharma@intel.com \
--cc=Ian.Pratt@cl.cam.ac.uk \
--cc=Keir.Fraser@cl.cam.ac.uk \
--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.