* [PATCH 8/15] Nested Virtualization: cpuid
@ 2010-06-03 16:14 Christoph Egger
0 siblings, 0 replies; only message in thread
From: Christoph Egger @ 2010-06-03 16:14 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 341 bytes --]
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: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_nh08_cpuid.diff --]
[-- Type: text/x-diff, Size: 1579 bytes --]
# HG changeset patch
# User cegger
# Date 1275382029 -7200
Pass cpuid feature bits to guest
diff -r 06a332fd936d -r c3ca485ecfbe xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2021,12 +2021,38 @@ void hvm_cpuid(unsigned int input, unsig
}
}
break;
+ case 0x80000000:
+ if ( !nestedhvm_enabled(v->domain) )
+ break;
+ if (*eax < 0x8000000a)
+ *eax = 0x8000000a;
+ break;
case 0x80000001:
/* We expose RDTSCP feature to guest only when
tsc_mode == TSC_MODE_DEFAULT and host_tsc_is_safe() returns 1 */
if ( v->domain->arch.tsc_mode != TSC_MODE_DEFAULT ||
!host_tsc_is_safe() )
*edx &= ~bitmaskof(X86_FEATURE_RDTSCP);
+
+ /* Don't expose SVM feature bit when host does not run with
+ * nested paging enabled. This check is needed as long as
+ * we don't support shadow-on-shadow.
+ */
+ if ( !paging_mode_hap(v->domain) )
+ *ecx &= ~bitmaskof(X86_FEATURE_SVME);
+
+ /* Don't expose SVM feature bit when nestedhvm is disabled. */
+ if ( !nestedhvm_enabled(v->domain) )
+ *ecx &= ~bitmaskof(X86_FEATURE_SVME);
+ break;
+ case 0x8000000a:
+ /* Don't expose SVM feature bits when nestedhvm is disabled. */
+ if ( !nestedhvm_enabled(v->domain) ) {
+ *eax = *ebx = *ecx = *edx = 0;
+ break;
+ }
+
+ hvm_nestedhvm_vcpu_features(v, eax, ebx, ecx, edx);
break;
}
}
[-- 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-06-03 16:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-03 16:14 [PATCH 8/15] Nested Virtualization: cpuid Christoph Egger
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).