[RFC, PATCH 12/24] i386 Vmi processor header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux