On 10.09.2025 09:38, Penny Zheng wrote: > Function iommu_do_domctl() is the main entry for all iommu-related domctl-op, > and shall be wrapped with CONFIG_MGMT_HYPERCALLS. > Tracking its calling chain, the following functions shall all be wrapped > with CONFIG_MGMT_HYPERCALLS: > - iommu_do_pci_domctl > - iommu_get_device_group > - amd_iommu_group_id/intel_iommu_group_id > - device_assigned > - assign_device > - intel_iommu_assign_device/amd_iommu_assign_device > - deassign_device > - reassign_device_ownership/reassign_device > - iommu_do_dt_domctl > - iommu_deassign_dt_device > - arm_smmu_reassign_dev/arm_smmu_reassign_dev > - ipmmu_reassign_dev > - ipmmu_deassign_dev > - ipmmu_detach_dev > - dt_find_node_by_gpath > Wrap XEN_DOMCTL_assign_device{test_assign_device,deassign_device, > get_device_group}-case transiently with CONFIG_MGMT_HYPERCALLS, > and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the whole > domctl.c in the last. > > Signed-off-by: Penny Zheng <penny.zh...@amd.com>
Apart from all of the above another aspect becomes apparent here: Some code is called at boot time only once management hypercalls are compiled out. Such code should then move to .init.text, so we may need to gain something like __init_or_mgmt. Imo that would want dealing with right here, but I can imagine opinions to differ on this. Furthermore, while looking around, I noticed that there's dt_overlay_sysctl(), entirely unguarded despite the earlier sysctl series. Yet if that work (and Misra checking) assumed OVERLAY_DTB=n, then there's iommu_remove_dt_device() which is only used when OVERLAY_DTB=y. Jan