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

Re: [PATCH v2 4/8] x86/acpi: separate AMD-Vi and VT-d specific functions


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 12 Jan 2023 12:37:51 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=LFq1SuO2v0RB+u4AyJ9axFl5wmBeX6LwrzPowh4qFCw=; b=edGQJ2Ix2jOeUZDmKzyX1V5mHduawwr87FSehtRjuR3yykEch0q6N/YUDJvlyCsUtxFj9xQnYZBvPrjgWlrfOeGKaToXm75K2ZVI4xAoJ2NqmuoYvayC/nbx3DRCeXBjrex3xQkEdMEyhvnIXN69uV0+L3NkY8BdyWtLJU42c0fsQyq50cSb7us+GWW72465lWwQx+8OQMypVzptfrf2KBN4izhG2jHH6dyATBPCwAn88Q1I4kwzyC980NO23F3efBoD7JlRO5xHklRTxcpnoFO9mQ7qtRn5Rc6Vc2g538zAMTrKFtzF6NwzXNSiKKY4dVtvoDZXurWu/MLQxCw+Wg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bm2TzNmG86VyTb+YkVJHeWy7eZjV+fMTAt4aEfXTZ+/jCWWJAq5vZUrICDvPBNHyPCBK2C9OE+nTmKv3/1nAycAZrhwE6yGfuzRvMrvwlUMc0T0RiedEEKA1+M0A5s4YckAW1CyqePLBCh0y4nBxcoV757ovESQ+Tn60+KmcaPPFLqQz5XSlBIW+Fxi2hkPE3JyHA3seaHJTVSHXMuDD4jmudOWuVXD/pN02Ip0LqqkkhegHb/hVrsWoxoNSaVo0vYR+6D9A2VO6z4m5aARtqszWW8hNK844o7bSrc2YxyJQLUcH47Eb94VGmFEsJbu28j5xbDrRb3REFhedmEjEYg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 12 Jan 2023 11:38:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.01.2023 09:44, Xenia Ragiadakou wrote:
> The functions acpi_dmar_init() and acpi_dmar_zap/reinstate() are
> VT-d specific while the function acpi_ivrs_init() is AMD-Vi specific.
> To eliminate dead code, they need to be guarded under CONFIG_INTEL_IOMMU
> and CONFIG_AMD_IOMMU, respectively.
> 
> Instead of adding #ifdef guards around the function calls, implement them
> as empty static inline functions.
> 
> Take the opportunity to move the declarations of acpi_dmar_zap/reinstate() to
> the arch specific header.
> 
> No functional change intended.
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>

While I'm not opposed to ack the change in this form, I have a question
first:

> --- a/xen/arch/x86/include/asm/acpi.h
> +++ b/xen/arch/x86/include/asm/acpi.h
> @@ -140,8 +140,22 @@ extern u32 pmtmr_ioport;
>  extern unsigned int pmtmr_width;
>  
>  void acpi_iommu_init(void);
> +
> +#ifdef CONFIG_INTEL_IOMMU
>  int acpi_dmar_init(void);
> +void acpi_dmar_zap(void);
> +void acpi_dmar_reinstate(void);
> +#else
> +static inline int acpi_dmar_init(void) { return -ENODEV; }
> +static inline void acpi_dmar_zap(void) {}
> +static inline void acpi_dmar_reinstate(void) {}
> +#endif

Leaving aside my request to drop that part of patch 3, you've kept
declarations for VT-d in the common header there. Which I consider
correct, knowing that VT-d was also used on IA-64 at the time. As
a result I would suppose movement might better be done in the other
direction here.

> +#ifdef CONFIG_AMD_IOMMU
>  int acpi_ivrs_init(void);
> +#else
> +static inline int acpi_ivrs_init(void) { return -ENODEV; }
> +#endif

For AMD, otoh, without there being a 2nd architecture re-using
their IOMMU, moving into the x86-specific header is certainly fine,
no matter that there's a slim chance that this may need moving the
other direction down the road.

Jan



 


Rackspace

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