[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH v4 14/24] xen/domctl: wrap pci-subset iommu-related domctl op with CONFIG_MGMT_HYPERCALLS


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Mon, 1 Dec 2025 08:53:46 +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=mQ+a5g+YtArrRSTJGHzBJ8/9SvIuV61iAPhwfeK451s=; b=MFf23QqnsChV8/lIyLzou3Jc+qXWBb/7EJcRikJ4g+8+pejA2GQwhyaYQASEDo3W/Zq+L6b96vuTmV6LrW+w4qwqhyTvx3Vbf5qZtDTmj4vVnH7XeaVhQI3roxiiqFUzIZyACG5fqsAQOxEDMmfFj6K2wufM0NCNtVEQjN0rQib7Qf7EkIbEFIL3bCLCHOMyxXWMmcMv0gX5/XW6rx4ADpXPEhqPpTTlO/5Di8/hy3TFORcZmA0xgtYSoexuj+cDM2odziRSZ1XC2h4KfgaZ+iTRE2t20f7wnQkHrdH5PchZ+NPBatBBgFwrlSwLukUaDxihIV8c0HWVNg2eSPTN5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=topv71GpBOuZUJs1G0i1VUMrB3O/4hP7lkjmy+eSxUwrdexm0Uj3mS9G+h+B/J5Uapub92FzX/70Cw2ndwgLfko3wqd45vQqlJEEYyoCbD7ehJWd9zXvLv+P3slnYJ3u4Xhr/s0L6s2oC+0gXBMfhtfZymh9zpjJgFkqLahyjYebQseSUWLGu9ThsWrK19Bvc9+3kK102Px6s7VQEAAwzsbnrL0hblvki4l670AkBz3Yha5OKuudkF/OL+ZTvHzmGLGO5to8eqeI625o9zZWpgb4yQ0AF6geIwNQXcq7k0caqiyK7IGt9a8ty5l120/UBAJEl3wKgH9qL32075lJoA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, "grygorii_strashko@xxxxxxxx" <grygorii_strashko@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Andryuk, Jason" <Jason.Andryuk@xxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 01 Dec 2025 08:53:59 +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-12-01T08:53:39.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: AQHcWtXdwWaFTRetvk29bNPbH/CVXLUDjQOAgAjznsA=
  • Thread-topic: [PATCH v4 14/24] xen/domctl: wrap pci-subset iommu-related domctl op with CONFIG_MGMT_HYPERCALLS

[Public]

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Tuesday, November 25, 2025 11:37 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; grygorii_strashko@xxxxxxxx; Andrew
> Cooper <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>;
> Andryuk, Jason <Jason.Andryuk@xxxxxxx>; Daniel P. Smith
> <dpsmith@xxxxxxxxxxxxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v4 14/24] xen/domctl: wrap pci-subset iommu-related domctl
> op with CONFIG_MGMT_HYPERCALLS
>
> On 21.11.2025 11:57, Penny Zheng wrote:
> >  xen/drivers/passthrough/amd/pci_amd_iommu.c | 20 ++++----
> >  xen/drivers/passthrough/pci.c               | 52 +++++++++++----------
> >  xen/drivers/passthrough/vtd/iommu.c         |  6 ++-
> >  xen/include/xsm/dummy.h                     |  6 ++-
> >  xen/include/xsm/xsm.h                       | 12 +++--
> >  xen/xsm/dummy.c                             |  6 ++-
> >  xen/xsm/flask/hooks.c                       | 12 +++--
> >  7 files changed, 68 insertions(+), 46 deletions(-)
>
> With this diffstat and there being quite a few HAS_PCI under
> xen/drivers/passthrough/arm/, what's the (PCI) deal there?

In arm, we have the following select chain:
HAS_VPCI_GUEST_SUPPORT if PCI_PASSTHROUGH -> HAS_VPCI -> HAS_PCI
So if we make PCI_PASSTHROUGH later depend on MGMT_HYPERCALLS, the PCI-subset 
for arm will also be guarded too.
I'll add description in commit message

> > --- a/xen/include/xsm/dummy.h
> > +++ b/xen/include/xsm/dummy.h
> > @@ -407,7 +407,8 @@ static XSM_INLINE int cf_check xsm_get_vnumainfo(
> >      return xsm_default_action(action, current->domain, d);  }
> >
> > -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
> > +#if defined(CONFIG_HAS_PASSTHROUGH) &&
> > +defined(CONFIG_MGMT_HYPERCALLS) #ifdef CONFIG_HAS_PCI
>
> Why the separate #ifdef? Can't that be folded with the #if? Are there further 
> changes
> to be put inside the outer #if? (Applies again further down as well.)
>

Because later in DT-subset, we want something like the following:
```
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_MGMT_HYPERCALLS)
#ifdef CONFIG_HAS_PCI
...
#endif
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
...
#endif
#endif /* HAS_PASSTHROUGH  && MGMT_HYPERCALLS  */
Letting HAS_PASSTHROUGH  && MGMT_HYPERCALLS being outer wrapper and a separate 
#ifdef CONFIG_HAS_PCI here could avoid extra changes in DT commit.

> >  static XSM_INLINE int cf_check xsm_get_device_group(
> >      XSM_DEFAULT_ARG uint32_t machine_bdf)  { @@ -429,7 +430,8 @@
> > static XSM_INLINE int cf_check xsm_deassign_device(
> >      return xsm_default_action(action, current->domain, d);  }
> >
> > -#endif /* HAS_PASSTHROUGH && HAS_PCI */
> > +#endif /* CONFIG_HAS_PCI */
> > +#endif /* HAS_PASSTHROUGH && MGMT_HYPERCALLS */
> >
> >  #if defined(CONFIG_HAS_PASSTHROUGH) &&
> > defined(CONFIG_HAS_DEVICE_TREE_DISCOVERY)
> >  static XSM_INLINE int cf_check xsm_assign_dtdevice(
>
> The DT counterpart, otoh, is separate anyway.
>
> Jan

 


Rackspace

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