Re: [PATCH] KVM: x86 emulator: reject SYSENTER in compatibility mode on AMD guests

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

 



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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux