Re: [PATCH 4/5] selftests: KVM: Add support for posted interrupt handling in L2

From: Mingwei Zhang
Date: Sun Aug 28 2022 - 15:30:27 EST


On Thu, Aug 25, 2022, Sean Christopherson wrote:
> > +
> > +void prepare_virtual_apic(struct vmx_pages *vmx, struct kvm_vm *vm)
> > +{
> > + vmx->virtual_apic = (void *)vm_vaddr_alloc_page(vm);
> > + vmx->virtual_apic_hva = addr_gva2hva(vm, (uintptr_t)vmx->virtual_apic);
> > + vmx->virtual_apic_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->virtual_apic);
> > +}
> > +
> > +void prepare_posted_intr_desc(struct vmx_pages *vmx, struct kvm_vm *vm)
> > +{
> > + vmx->posted_intr_desc = (void *)vm_vaddr_alloc_page(vm);
> > + vmx->posted_intr_desc_hva =
> > + addr_gva2hva(vm, (uintptr_t)vmx->posted_intr_desc);
> > + vmx->posted_intr_desc_gpa =
> > + addr_gva2gpa(vm, (uintptr_t)vmx->posted_intr_desc);
>
> Let these poke out, or capture the field in a local var. Actually, posted_intr_desc
> is a void *, is casting even necessary?
>
Will do. Yeah, casting is necessary here because add_ga2gpa takes
'vm_vaddr_t' which is the 'long unsigned int', so we have to cast it.
>
> > +}
> > --
> > 2.37.1.455.g008518b4e5-goog
> >