Allow the compiler a little more room on DCE by moving the compile-time- constant condition into the predicate (from the one place where it was added in an open-coded fashion for XSA-450).
Signed-off-by: Jan Beulich <jbeul...@suse.com> --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -438,7 +438,7 @@ static paddr_t domain_pgd_maddr(struct d if ( pgd_maddr ) /* nothing */; - else if ( IS_ENABLED(CONFIG_HVM) && iommu_use_hap_pt(d) ) + else if ( iommu_use_hap_pt(d) ) { pagetable_t pgt = p2m_get_pagetable(p2m_get_hostp2m(d)); --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -381,7 +381,8 @@ struct domain_iommu { #define iommu_clear_feature(d, f) clear_bit(f, dom_iommu(d)->features) /* Are we using the domain P2M table as its IOMMU pagetable? */ -#define iommu_use_hap_pt(d) (dom_iommu(d)->hap_pt_share) +#define iommu_use_hap_pt(d) (IS_ENABLED(CONFIG_HVM) && \ + dom_iommu(d)->hap_pt_share) /* Does the IOMMU pagetable need to be kept synchronized with the P2M */ #ifdef CONFIG_HAS_PASSTHROUGH