* [PATCH 12/18] Nested Virtualization: MSR
@ 2010-04-15 12:36 Christoph Egger
0 siblings, 0 replies; only message in thread
From: Christoph Egger @ 2010-04-15 12:36 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_nh12_msr.diff --]
[-- Type: text/x-diff, Size: 1521 bytes --]
# HG changeset patch
# User cegger
# Date 1271330306 -7200
Emulate MSRs needed for Nested Virtualization
diff -r 01758c6195f4 -r 9731aece91ac xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2097,14 +2097,21 @@ int hvm_msr_read_intercept(struct cpu_us
break;
default:
+ ret = nestedhvm_rdmsr(v, ecx, &msr_content);
+ if ( ret < 0 )
+ goto gp_fault;
+ else if ( ret )
+ break;
+
+ BUG_ON( ret );
ret = mce_rdmsr(ecx, &msr_content);
if ( ret < 0 )
goto gp_fault;
else if ( ret )
break;
- /* ret == 0, This is not an MCE MSR, see other MSRs */
- else if (!ret)
- return hvm_funcs.msr_read_intercept(regs);
+
+ BUG_ON( ret );
+ return hvm_funcs.msr_read_intercept(regs);
}
regs->eax = (uint32_t)msr_content;
@@ -2196,13 +2203,21 @@ int hvm_msr_write_intercept(struct cpu_u
break;
default:
+ ret = nestedhvm_wrmsr(v, ecx, msr_content);
+ if ( ret < 0 )
+ goto gp_fault;
+ else if ( ret )
+ break;
+
+ BUG_ON( ret );
ret = mce_wrmsr(ecx, msr_content);
if ( ret < 0 )
goto gp_fault;
else if ( ret )
break;
- else if (!ret)
- return hvm_funcs.msr_write_intercept(regs);
+
+ BUG_ON( ret );
+ return hvm_funcs.msr_write_intercept(regs);
}
return X86EMUL_OKAY;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-04-15 12:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-15 12:36 [PATCH 12/18] Nested Virtualization: MSR Christoph Egger
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.