[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: [PATCH v2 20/26] xen/domctl: wrap iommu-related domctl op with CONFIG_MGMT_HYPERCALLS
[Public] > -----Original Message----- > From: Jan Beulich <jbeulich@xxxxxxxx> > Sent: Thursday, September 11, 2025 7:59 PM > To: Penny, Zheng <penny.zheng@xxxxxxx> > Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Stefano Stabellini > <sstabellini@xxxxxxxxxx>; Julien Grall <julien@xxxxxxx>; Bertrand Marquis > <bertrand.marquis@xxxxxxx>; Orzel, Michal <Michal.Orzel@xxxxxxx>; Andrew > Cooper <andrew.cooper3@xxxxxxxxxx>; Anthony PERARD > <anthony.perard@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>; > Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>; Rahul Singh > <rahul.singh@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx > Subject: Re: [PATCH v2 20/26] xen/domctl: wrap iommu-related domctl op with > CONFIG_MGMT_HYPERCALLS > > 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.Zheng@xxxxxxx> > > 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. > Like handle_device() -> iommu_assign_dt_device(), once MGMT_HYPERCALLS=n compiled out toolstack scenario, we only have usage at boot time for dom0less on arm. And also set_global_virq_handler() in the previous commit... And domain_create()/domain_teardown()... I remembered that when checking each switch-case-block under do_domctl(), for some of it, the references could be simply divided into two ways: toolstack and boot-time. I suggest to do it on a follow-up patch serie to go through do_domctl() all over again. > 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. > The whole file dt-overlay.c is guarded by CONFIG_SYSCTL, as it is compiled under CONFIG_OVERLAY_DTB which depends on CONFIG_SYSCTL. So, dt_overlay_sysctl() is guarded. While, yes, I forgot iommu_remove_dt_device(). > Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |