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

Re: [Xen-devel] [PATCH v3 1/4] xen/libxc: Allow changes to hypervisor CPUID leaf from config file



>>> On 14.03.14 at 16:41, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> wrote:
> On 03/14/2014 04:09 AM, Jan Beulich wrote:
>>>>> On 13.03.14 at 19:08, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> wrote:
>>> @@ -43,22 +45,29 @@ static int hypervisor_is_64bit(xc_interface *xch)
>>>   static void cpuid(const unsigned int *input, unsigned int *regs)
>>>   {
>>>       unsigned int count = (input[1] == XEN_CPUID_INPUT_UNUSED) ? 0 : 
> input[1];
>>> +    uint8_t is_hyp = IS_HYPERVISOR_LEAF(input[0]);
>>>   #ifdef __i386__
>>>       /* Use the stack to avoid reg constraint failures with some gcc flags 
> */
>>>       asm (
>>>           "push %%ebx; push %%edx\n\t"
>>> -        "cpuid\n\t"
>>> +        "testb $0xff,%5\n\t"
>>> +        "jz 1f\n\t"
>>> +        XEN_EMULATE_PREFIX
>>> +        "1: cpuid\n\t"
>>>           "mov %%ebx,4(%4)\n\t"
>>>           "mov %%edx,12(%4)\n\t"
>>>           "pop %%edx; pop %%ebx\n\t"
>>>           : "=a" (regs[0]), "=c" (regs[2])
>>> -        : "0" (input[0]), "1" (count), "S" (regs)
>>> +        : "0" (input[0]), "1" (count), "S" (regs), "m" (is_hyp)
>> All inputs must be in registers here, since memory references might
>> use %esp and hence be off by 2 stack slots due to the pushes/pops
>> surrounding the actual operation. Since you evaluate the flag prior
>> to the CPUID, using "db" as constraint would seem possible here.
> 
> gcc for some reason rejects "b" as inconsistent (but "d" works fine).

And I guess "q" or "Q" could be it, then.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.