WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Don't expose CPUID time leaf when not using PVRDTSCP

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Don't expose CPUID time leaf when not using PVRDTSCP
From: Paul Durrant <paul.durrant@xxxxxxxxxx>
Date: Mon, 4 Jul 2011 17:18:38 +0100
Cc: paul.durrant@xxxxxxxxxx
Delivery-date: Mon, 04 Jul 2011 09:20:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Paul Durrant <paul.durrant@xxxxxxxxxx>
# Date 1309796247 -3600
# Node ID 6ce0dbc6f955707bf814d62a16a2b4382d957332
# Parent  7e4404a8f5f9bc111a80f15a2bce35378b39f2f1
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@xxxxxxxxxx>

diff -r 7e4404a8f5f9 -r 6ce0dbc6f955 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Mon Jul 04 07:57:32 2011 +0100
+++ b/xen/arch/x86/traps.c      Mon Jul 04 17:17:27 2011 +0100
@@ -704,15 +704,19 @@ int cpuid_hypervisor_leaves( uint32_t id
     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 ) 
+
+    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;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Don't expose CPUID time leaf when not using PVRDTSCP, Paul Durrant <=