On 12/02/2025 9:18 am, Luca Fancellu wrote: > When Xen is built without HAS_PASSTHROUGH, there are some parts > in arm and x86 where iommu_* functions are called in the codebase, > but their implementation is under xen/drivers/passthrough that is > not built. > > So provide some stub for these functions in order to build Xen > when !HAS_PASSTHROUGH, which is the case for example on systems > with MPU support. > > Signed-off-by: Luca Fancellu <luca.fance...@arm.com> > --- > xen/arch/arm/include/asm/grant_table.h | 8 ++++++ > xen/include/xen/iommu.h | 40 +++++++++++++++++++++++--- > 2 files changed, 44 insertions(+), 4 deletions(-) > > diff --git a/xen/arch/arm/include/asm/grant_table.h > b/xen/arch/arm/include/asm/grant_table.h > index d3c518a926b9..e21634b752df 100644 > --- a/xen/arch/arm/include/asm/grant_table.h > +++ b/xen/arch/arm/include/asm/grant_table.h > @@ -73,9 +73,17 @@ int replace_grant_host_mapping(uint64_t gpaddr, mfn_t > frame, > #define gnttab_status_gfn(d, t, i) \ > page_get_xenheap_gfn(gnttab_status_page(t, i)) > > +#ifdef CONFIG_HAS_PASSTHROUGH > + > #define gnttab_need_iommu_mapping(d) \ > (is_domain_direct_mapped(d) && is_iommu_enabled(d)) > > +#else > + > +#define gnttab_need_iommu_mapping(d) (false)
This doesn't evaluate d, which can lead to other build problems. Instead of providing two, you should insert "IS_ENABLED(CONFIG_HAS_PASSTHROUGH) &&" into the existing gnttab_need_iommu_mapping(). The same applies to several other hunks too. ~Andrew