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

Re: [Xen-devel] [PATCH] vmx/monitor: CPUID events



On Sun, Jul 10, 2016 at 9:00 PM, Tian, Kevin <kevin.tian@xxxxxxxxx> wrote:
>> From: Tamas K Lengyel [mailto:tamas.lengyel@xxxxxxxxxxxx]
>> Sent: Friday, July 08, 2016 10:32 AM
>>
>> This patch implements sending notification to a monitor subscriber when an
>> x86/vmx guest executes the CPUID instruction.
>>
>> Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxxxxx>
>
>
>> @@ -3525,10 +3527,23 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
>>          hvm_task_switch((uint16_t)exit_qualification, reasons[source], 
>> ecode);
>>          break;
>>      }
>> -    case EXIT_REASON_CPUID:
>> -        is_pvh_vcpu(v) ? pv_cpuid(regs) : vmx_do_cpuid(regs);
>> -        update_guest_eip(); /* Safe: CPUID */
>> +    case EXIT_REASON_CPUID: {
>> +        int rc;
>> +
>> +        if ( is_pvh_vcpu(v) )
>> +        {
>> +            pv_cpuid(regs);
>> +            rc = 0;
>> +        }
>> +        else
>> +            rc = vmx_do_cpuid(regs);
>> +
>> +        if ( rc < 0 )
>> +            goto exit_and_crash;
>> +        if ( !rc )
>> +            update_guest_eip(); /* Safe: CPUID */
>
> favor a simple comment to explain policies on various
> rc values, as you have done in other places.

Certainly.

Thanks,
Tamas

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

 


Rackspace

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