aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Durrant <paul.durrant@citrix.com>2011-07-08 09:02:03 +0100
committerPaul Durrant <paul.durrant@citrix.com>2011-07-08 09:02:03 +0100
commit8a9f9fa06d63c37b0b9131550dc218d98486ed1b (patch)
treeec838560c0eb36bbc6ef5ee657506c230d28c6e9
parent30733ac2942b2ab52a3363aff051c64dd47b1348 (diff)
downloadxen-8a9f9fa06d63c37b0b9131550dc218d98486ed1b.tar.gz
xen-8a9f9fa06d63c37b0b9131550dc218d98486ed1b.tar.bz2
xen-8a9f9fa06d63c37b0b9131550dc218d98486ed1b.zip
x86/hvm: Don't expose CPUID time leaf when not using PVRDTSCP
Some versions of Oracle's Solaris PV drivers make a check that the maximal Xen hypervisor CPUID leaf is <= base leaf + 2 and refuse to work if this is not the case. The addition of the time leaf makes the maximal leaf == base leaf + 3 so this patch introduces a workaround that obscures the time leaf unless PVRDTSCP is in operation. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> xen-unstable changeset: 23661:8fe6f4be18aa xen-unstable date: Fri Jul 08 08:31:10 2011 +0100
-rw-r--r--xen/arch/x86/traps.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e11036f903..f57b673a6b 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -686,15 +686,23 @@ int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
struct domain *d = current->domain;
/* Optionally shift out of the way of Viridian architectural leaves. */
uint32_t base = is_viridian_domain(d) ? 0x40000100 : 0x40000000;
+ uint32_t limit;
idx -= base;
- if ( idx > 3 )
+
+ /*
+ * Some Solaris PV drivers fail if max > base + 2. Help them out by
+ * hiding the PVRDTSCP leaf if PVRDTSCP is disabled.
+ */
+ limit = (d->arch.tsc_mode < TSC_MODE_PVRDTSCP) ? 2 : 3;
+
+ if ( idx > limit )
return 0;
switch ( idx )
{
case 0:
- *eax = base + 3; /* Largest leaf */
+ *eax = base + limit; /* Largest leaf */
*ebx = XEN_CPUID_SIGNATURE_EBX;
*ecx = XEN_CPUID_SIGNATURE_ECX;
*edx = XEN_CPUID_SIGNATURE_EDX;