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

Re: [Xen-devel] [PATCH] SVM: Add union intstat_t for offset 68h in vmcb struct



On 2020/3/24 17:08, Jan Beulich wrote:
> On 24.03.2020 05:52, Pu Wen wrote:
>> --- a/xen/arch/x86/hvm/svm/nestedsvm.c
>> +++ b/xen/arch/x86/hvm/svm/nestedsvm.c
>> @@ -508,7 +508,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, 
>> struct cpu_user_regs *regs)
>>       }
>>   
>>       /* Shadow Mode */
>> -    n2vmcb->interrupt_shadow = ns_vmcb->interrupt_shadow;
>> +    n2vmcb->int_stat.intr_shadow = ns_vmcb->int_stat.intr_shadow;
> 
> While bit 1 is irrelevant to VMRUN, I still wonder whether you
> shouldn't copy "raw" here.

Ok, will copy the whole "raw" as suggested, thanks.

>> @@ -1058,7 +1058,7 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct 
>> cpu_user_regs *regs)
>>           ns_vmcb->_vintr.fields.intr_masking = 0;
>>   
>>       /* Shadow mode */
>> -    ns_vmcb->interrupt_shadow = n2vmcb->interrupt_shadow;
>> +    ns_vmcb->int_stat.intr_shadow = n2vmcb->int_stat.intr_shadow;
> 
> Same here, or at the very least you want to also copy bit 1 here.

Ok, will change to:
     /* Interrupt state */
     ns_vmcb->int_stat = n2vmcb->int_stat;

>> --- a/xen/arch/x86/hvm/svm/svmdebug.c
>> +++ b/xen/arch/x86/hvm/svm/svmdebug.c
>> @@ -51,9 +51,9 @@ void svm_vmcb_dump(const char *from, const struct 
>> vmcb_struct *vmcb)
>>       printk("iopm_base_pa = %#"PRIx64" msrpm_base_pa = %#"PRIx64" 
>> tsc_offset = %#"PRIx64"\n",
>>              vmcb_get_iopm_base_pa(vmcb), vmcb_get_msrpm_base_pa(vmcb),
>>              vmcb_get_tsc_offset(vmcb));
>> -    printk("tlb_control = %#x vintr = %#"PRIx64" interrupt_shadow = 
>> %#"PRIx64"\n",
>> +    printk("tlb_control = %#x vintr = %#"PRIx64" interrupt_shadow = %#x\n",
>>              vmcb->tlb_control, vmcb_get_vintr(vmcb).bytes,
>> -           vmcb->interrupt_shadow);
>> +           vmcb->int_stat.intr_shadow);

OK, will dump like this:
     printk("tlb_control = %#x vintr = %#"PRIx64" int_stat = %#"PRIx64"\n",
            vmcb->tlb_control, vmcb_get_vintr(vmcb).bytes,
            vmcb->int_stat.raw);
        
Thx.

-- 
Regards,
Pu Wen

 


Rackspace

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