[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 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.

> @@ -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.

> --- 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);

Please dump all 64 bits here.

Jan



 


Rackspace

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