[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v12 1/7] passthrough: don't migrate pirq when it is delivered through VT-d PI
>>> On 07.04.17 at 06:07, <chao.gao@xxxxxxxxx> wrote: > Cc: kevin > > On Fri, Apr 07, 2017 at 04:38:00AM -0600, Jan Beulich wrote: >>>>> On 06.04.17 at 02:30, <chao.gao@xxxxxxxxx> wrote: >>> --- a/xen/arch/x86/hvm/hvm.c >>> +++ b/xen/arch/x86/hvm/hvm.c >>> @@ -438,6 +438,9 @@ static int hvm_migrate_pirq(struct domain *d, struct > hvm_pirq_dpci *pirq_dpci, >>> struct vcpu *v = arg; >>> >>> if ( (pirq_dpci->flags & HVM_IRQ_DPCI_MACH_MSI) && >>> + (pirq_dpci->flags & HVM_IRQ_DPCI_GUEST_MSI) && >>> + /* Needn't migrate pirq if this pirq is delivered to guest > directly.*/ >>> + (!pirq_dpci->gmsi.posted) && >>> (pirq_dpci->gmsi.dest_vcpu_id == v->vcpu_id) ) >>> { >> >>I don't think I've seen you address Kevin's comment on this for v11, >>and like Kevin I can't immediately see why the above addition would >>be correct. Do you perhaps mean >> >> if ( (pirq_dpci->flags & HVM_IRQ_DPCI_MACH_MSI) && >> /* Needn't migrate pirq if this pirq is delivered to guest >> directly.*/ >> (!pirq_dpci->gmsi.posted || >> <whatever is appropriate here, if anything>) && >> (pirq_dpci->gmsi.dest_vcpu_id == v->vcpu_id) ) > > Sorry to Kevin. And thanks to point it out. > But I thought we had discussed this in > https://lists.xenproject.org/archives/html/xen-devel/2017-03/msg04383.html. I > did think you agreed with me. > gmsi is invalid when pirq_dpci is not GUEST_MSI, is there something I have > ignored? You've been talking about GUEST_PCI there, which I did (and do) agree we can't handle here. So for the purposes of your series, simply adding the gmsi.posted check would be the right thing imo. I don't think I see anything wrong with the ->gmsi accesses here: The GUEST_PCI code simply doesn't set them, so dest_vcpu_id will still be -1 (from pt_pirq_init()). So I don't see any bug being fixed here with the extra other check you add. If you agree, I can take that line and the commit message sentence out while committing. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |