All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zachary Amsden <zach@vmware.com>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Chris Wright <chrisw@sous-sol.org>,
	Jan Beulich <JBeulich@novell.com>,
	Xen-devel <xen-devel@lists.xensource.com>,
	Virtualization Mailing List <virtualization@lists.osdl.org>
Subject: Re: [RFC, PATCH 12/24] i386 Vmi processor header
Date: Thu, 16 Mar 2006 09:47:13 -0800	[thread overview]
Message-ID: <4419A4A1.9030509@vmware.com> (raw)
In-Reply-To: <200603161133_MC3-1-BACA-4C6C@compuserve.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Zachary Amsden <zach@vmware.com>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: Chris Wright <chrisw@sous-sol.org>,
	Virtualization Mailing List <virtualization@lists.osdl.org>,
	Xen-devel <xen-devel@lists.xensource.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Jan Beulich <JBeulich@novell.com>
Subject: Re: [RFC, PATCH 12/24] i386 Vmi processor header
Date: Thu, 16 Mar 2006 09:47:13 -0800	[thread overview]
Message-ID: <4419A4A1.9030509@vmware.com> (raw)
In-Reply-To: <200603161133_MC3-1-BACA-4C6C@compuserve.com>

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

  reply	other threads:[~2006-03-16 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-16 16:30 [RFC, PATCH 12/24] i386 Vmi processor header Chuck Ebbert
2006-03-16 17:47 ` Zachary Amsden [this message]
2006-03-16 17:47   ` Zachary Amsden
  -- strict thread matches above, loose matches on Subject: below --
2006-03-13 18:08 Zachary Amsden
2006-03-13 18:08 ` Zachary Amsden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4419A4A1.9030509@vmware.com \
    --to=zach@vmware.com \
    --cc=76306.1226@compuserve.com \
    --cc=JBeulich@novell.com \
    --cc=chrisw@sous-sol.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.osdl.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.