On 02/01/12 11:50, Avi Kivity wrote:
> On 02/01/2012 12:45 PM, Stephan Bärwolf wrote:
>> On 02/01/12 11:27, Avi Kivity wrote:
>>>  
>>> +static bool vendor_intel(struct x86_emulate_ctxt *ctxt)
>>> +{
>>> +   u32 eax, ebx, ecx, edx;
>> Just to be clean:
>>
>> Shouldn't eax and ecx be initialized to zero?
> Either get_cpuid() initializes them and returns true, or it returns
> false and we never evaluate them.
This isn't what I mean.

CPUID will only return back the VENDOR (in ebx..edx) if you call it
with eax=0x00000000 and ecx=0x00000000 (see cpu docs).

Of course the compiler should set these two vars to zero (?)
But what if somebody wants to read this code sometime later ??
(The compiler will optimize the "set to zero" away...)

regards Stephan
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to