>>> On 31.03.17 at 01:01, <chao....@intel.com> wrote: > On Fri, Mar 31, 2017 at 01:46:33PM +0800, Tian, Kevin wrote: >>> From: Gao, Chao >>> Sent: Wednesday, March 29, 2017 1:12 PM >>> --- a/xen/drivers/passthrough/io.c >>> +++ b/xen/drivers/passthrough/io.c >>> @@ -618,6 +618,8 @@ int pt_irq_destroy_bind( >>> else >>> what = "bogus"; >>> } >>> + else if ( iommu_intpost && pirq && pirq_dpci->gmsi.posted ) >> >>No need to check iommu_intpost. Just keep later conditions. > > ok. Is it for if posted is set, the iommu_intpost should be true? > >> >>btw isn't the condition be " (pirq_dpci && pirq_dpci->gmsi.posted)"? > > I don't think so. pirq, not pirq_dpci, is consumed by pi_update_irte. > Furthermore if pirq_dpci is null, pirq is also null. But it is not true > in turn.
With pirq_dpci = pirq_dpci(pirq); it _is_ the other way around, which can then also be expressed as "if pirq_dpci is non-NULL, pirq is non-NULL too", which is the precondition you need to consume (dereference) pirq. There is a reason other code around here also only ever checks pirq_dpci (even when using pirq). Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel