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

Re: [Xen-devel] [PATCH v1 2/2] hvm/svm: Implement CPUID events



On 02/19/2018 05:25 PM, Tamas K Lengyel wrote:
> On Mon, Feb 19, 2018 at 6:07 AM, Alexandru Isaila
> <aisaila@xxxxxxxxxxxxxxx> wrote:
>> At this moment the CPUID events for the AMD architecture are not
>> forwarded to the monitor layer.
>>
>> This patch adds the CPUID event to the common capabilities and then
>> forwards the event to the monitor layer.
>>
>> Signed-off-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
>> ---
>>  xen/arch/x86/hvm/svm/svm.c    | 8 +++++++-
>>  xen/include/asm-x86/monitor.h | 2 +-
>>  2 files changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
>> index e36ad05..0f1c57d 100644
>> --- a/xen/arch/x86/hvm/svm/svm.c
>> +++ b/xen/arch/x86/hvm/svm/svm.c
>> @@ -1804,6 +1804,7 @@ static void svm_vmexit_do_cpuid(struct cpu_user_regs 
>> *regs)
>>      struct vcpu *curr = current;
>>      unsigned int inst_len;
>>      struct cpuid_leaf res;
>> +    int rc = 0;
>>
>>      if ( (inst_len = __get_instruction_length(curr, INSTR_CPUID)) == 0 )
>>          return;
>> @@ -1822,7 +1823,12 @@ static void svm_vmexit_do_cpuid(struct cpu_user_regs 
>> *regs)
>>      regs->rcx = res.c;
>>      regs->rdx = res.d;
>>
>> -    __update_guest_eip(regs, inst_len);
>> +    rc = hvm_monitor_cpuid(inst_len, regs->eax, regs->ecx);
>> +
>> +    if ( !rc )
> 
> Missing the rc < 0 case handling.
> 
>> +    {
>> +        __update_guest_eip(regs, inst_len);
>> +    }

Please also lose the unnecessary scope here.


Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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