>>> On 07.08.18 at 10:05, <paul.durr...@citrix.com> wrote: >> From: Tian, Kevin [mailto:kevin.t...@intel.com] >> Sent: 07 August 2018 03:56 >> > From: Paul Durrant [mailto:paul.durr...@citrix.com] >> > Sent: Saturday, August 4, 2018 1:22 AM >> > if ( need_iommu(p2m->domain) && >> > (lpae_valid(orig_pte) || lpae_valid(*entry)) ) >> > + { >> > rc = iommu_iotlb_flush(p2m->domain, _bfn(gfn_x(sgfn)), >> > 1UL << page_order); >> > + if ( unlikely(rc) && !is_hardware_domain(p2m->domain) ) >> > + domain_crash(p2m->domain); >> > + } >> >> to reduce duplication, does it make sense to introduce a wrapper >> like domain_crash_nd ('nd' indicate !is_hardware_domain, and >> becomes a nop for hardware domain)? Then it becomes: >> >> if ( unlikely(rc) ) >> domain_crash_nd(p2m->domain); > > That's a bigger change and I'd like to defer to the other maintainers as to > whether they think it is a good idea. I'm happy to change this in v6 if > anyone gives me a +1.
Well, if this is a common idiom, then yes, I think a helper would be desirable. However - what is the _nd suffix supposed to stand for? I'm inclined to suggest domu_crash(). Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel