From: Christoph Egger <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Subject: Re: [PATCH] xen: merge MSR_EFER
Date: Mon, 6 Sep 2010 16:47:21 +0200 [thread overview]
Message-ID: <201009061647.21979.Christoph.Egger@amd.com> (raw)
In-Reply-To: <201009061247.37850.Christoph.Egger@amd.com>
[-- Attachment #1: Type: text/plain, Size: 589 bytes --]
On Monday 06 September 2010 12:47:37 Christoph Egger wrote:
> Hi!
>
> Attached patch moves SVM and VMX specific MSR_EFER handling into hvm
> as neither SVM nor VMX do anything arch specific things.
>
Previous patch did not compile for 32bit. New version attached.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_merge_efer.diff --]
[-- Type: text/x-diff, Size: 3311 bytes --]
diff -r c6cee1d030fc xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c Thu Sep 02 17:42:19 2010 +0200
+++ b/xen/arch/x86/hvm/hvm.c Mon Sep 06 16:45:53 2010 +0200
@@ -2039,6 +2039,10 @@ int hvm_msr_read_intercept(unsigned int
switch ( msr )
{
+ case MSR_EFER:
+ *msr_content = v->arch.hvm_vcpu.guest_efer;
+ break;
+
case MSR_IA32_TSC:
*msr_content = hvm_get_guest_tsc(v);
break;
@@ -2138,6 +2142,11 @@ int hvm_msr_write_intercept(unsigned int
switch ( msr )
{
+ case MSR_EFER:
+ if ( hvm_set_efer(msr_content) )
+ return X86EMUL_EXCEPTION;
+ break;
+
case MSR_IA32_TSC:
hvm_set_guest_tsc(v, msr_content);
break;
diff -r c6cee1d030fc xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c Thu Sep 02 17:42:19 2010 +0200
+++ b/xen/arch/x86/hvm/svm/svm.c Mon Sep 06 16:45:53 2010 +0200
@@ -116,11 +116,6 @@ long_mode_do_msr_write(unsigned int msr,
switch ( msr )
{
- case MSR_EFER:
- if ( hvm_set_efer(msr_content) )
- return HNDL_exception_raised;
- break;
-
case MSR_IA32_MC4_MISC: /* Threshold register */
case MSR_F10_MC4_MISC1 ... MSR_F10_MC4_MISC3:
/*
@@ -1042,10 +1037,6 @@ static int svm_msr_read_intercept(unsign
switch ( msr )
{
- case MSR_EFER:
- *msr_content = v->arch.hvm_vcpu.guest_efer;
- break;
-
case MSR_IA32_SYSENTER_CS:
*msr_content = v->arch.hvm_svm.guest_sysenter_cs;
break;
diff -r c6cee1d030fc xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c Thu Sep 02 17:42:19 2010 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c Mon Sep 06 16:45:53 2010 +0200
@@ -172,10 +172,6 @@ long_mode_do_msr_read(unsigned int msr,
switch ( msr )
{
- case MSR_EFER:
- *msr_content = v->arch.hvm_vcpu.guest_efer;
- break;
-
case MSR_FS_BASE:
*msr_content = __vmread(GUEST_FS_BASE);
break;
@@ -224,11 +220,6 @@ long_mode_do_msr_write(unsigned int msr,
switch ( msr )
{
- case MSR_EFER:
- if ( hvm_set_efer(msr_content) )
- goto exception_raised;
- break;
-
case MSR_FS_BASE:
case MSR_GS_BASE:
case MSR_SHADOW_GS_BASE:
@@ -270,7 +261,6 @@ long_mode_do_msr_write(unsigned int msr,
uncanonical_address:
HVM_DBG_LOG(DBG_LEVEL_0, "Not cano address of msr write %x", msr);
vmx_inject_hw_exception(TRAP_gp_fault, 0);
- exception_raised:
return HNDL_exception_raised;
}
@@ -351,36 +341,13 @@ void vmx_save_host_msrs(void) {}
static enum handler_return
long_mode_do_msr_read(unsigned int msr, uint64_t *msr_content)
{
- struct vcpu *v = current;
-
- switch ( msr )
- {
- case MSR_EFER:
- *msr_content = v->arch.hvm_vcpu.guest_efer;
- break;
-
- default:
- return HNDL_unhandled;
- }
-
- return HNDL_done;
+ return HNDL_unhandled;
}
static enum handler_return
long_mode_do_msr_write(unsigned int msr, uint64_t msr_content)
{
- switch ( msr )
- {
- case MSR_EFER:
- if ( hvm_set_efer(msr_content) )
- return HNDL_exception_raised;
- break;
-
- default:
- return HNDL_unhandled;
- }
-
- return HNDL_done;
+ return HNDL_unhandled;
}
#endif /* __i386__ */
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
prev parent reply other threads:[~2010-09-06 14:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-06 10:47 [PATCH] xen: merge MSR_EFER Christoph Egger
2010-09-06 14:47 ` Christoph Egger [this message]
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=201009061647.21979.Christoph.Egger@amd.com \
--to=christoph.egger@amd.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.