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] Re: [RFC, PATCH 12/24] i386 Vmi processor header

To: Chuck Ebbert <76306.1226@xxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [RFC, PATCH 12/24] i386 Vmi processor header
From: Zachary Amsden <zach@xxxxxxxxxx>
Date: Thu, 16 Mar 2006 09:47:13 -0800
Cc: Chris Wright <chrisw@xxxxxxxxxxxx>, Virtualization Mailing List <virtualization@xxxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
Delivery-date: Thu, 16 Mar 2006 18:22:36 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <200603161133_MC3-1-BACA-4C6C@xxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <200603161133_MC3-1-BACA-4C6C@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5 (X11/20051201)
Chuck Ebbert wrote:

+/* Some CPUID calls want 'count' to be placed in ecx */
+static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
+             int *edx)
+{
+     asm volatile(""::"c"(count));
+     vmi_cpuid(op, eax, ebx, ecx, edx);
+}

You can't assume those last two statements will stay together.
>From the gcc 4.0.2 info file:

I know. I've abused this a bit. When we originally wrote the cpuid call, there were no ecx dependencies on cpuid. Never got around to fixing it properly.
<...> you can't expect a sequence of volatile `asm' instructions
to remain perfectly consecutive.  If you want consecutive output, use a
single `asm'.

Maybe you could make vmi_cpuid always take a 'count' param, then just make cpuid
do:

        vmi_cpuid(op, 0, eax, ebx, ecx, edx);

and cpuid_count do:

        vmi_cpuid(op, count, eax, ebx, ecx, edx);

That is the proper fix.  I'll put that in the next round.


(And sorry about trimming the cc: but I'm reading from a digest and that list
is too long to enter manually.)

N.P.

Thanks for looking at my code,
Zach

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

<Prev in Thread] Current Thread [Next in Thread>