[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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Fri, 26 Sep 2025 09:45:49 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N8ayv8MzhWLcUDGe5sHhGVo9rUojz+kJ07hGrIQs6og=; b=uFf563sDTT3u7BYKM3Ir80Fjr33w6hNi+N4kCucYEbGKsjjOFZOBa3xhCMNlQnha56xtHu5TH6pxiAv6xtYxJhTgeKur/vRqdfU/MSUoTd/+5dWSQhIAkZM/BjCUXMa85/udyJbB0stCylURVEGjzuPa6JDDbrVppWTGvZBipwPpROiMUYT+ZTbiarpXdjv6R+6inxIhGZfUveUTKTbbaUIcZQAUCWIFcrqdShRFBpQwYcp8scE8movLniNzBxAc+0PuoFs2v/JJlksvjOQE02zUhPv+EhrfJQkifndNQ1kgVr5UllatK+PrOVQYS4zlM1drPJSC9/HJtUB5L7Peow==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iDXp5Fh0K51BKR1v8GAqIuiEKsJrWuBK98ii/Igpx2rQBqklH4bEshgyAZVrDk8olbqjZUVrtF+NEpL0U7qSTCyjx7yaBWoGk/1m4DSX4SkU6ddtGngJyvV2X2zOAuRspB3ntfLDpMTh72XVOvLA8nHrsAve0LsdIvaAjRZxo2f5Cc6Vd5fDz2UAWbsMO7S72Vmta3RBD8SvdUm5/GLColWrPK35/FoeHbY7dg71+BiY7G05sOOFOBMJuN4CpEucEYZnCUSqYukldVfdwZQAx2LgiB+X9iEcH2vsPf9gwCD12MeVyetlpF9/VxuK5HtGnnJFq2/fQMVWxW3MqyPeLw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • 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" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 26 Sep 2025 09:46:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=True;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-09-26T09:03:32.0000000Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=3;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged
  • Thread-index: AQHcIiYdoRXj4d7euECxgRPy0m3CSbSN4o2AgBdh+wA=
  • Thread-topic: [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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.