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

Re: [RFC 2/7] x86/iommu: amd_iommu_perdev_intremap is AMD-Vi specific


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 20 Dec 2022 18:04: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=IPnoIUI7ai8RRkcJ0ThqqrK6GDgOyZu6/wXjv4DcAWs=; b=MApmmJ131euaf9KKz8f0KIe5R8VWxvYcOUVo2AA57yerOG0pa+95SmWBNyBKUN3zLAjowA7lvkaYwqjijrUUyViEI3fFn7lZpBpmmoMclQjRfWWV/FMDxWJfgGQeJEmmI6gfs/NVBJbIhL0vAvrHlV7Z1koqdAtd8rxmWQ62pMjScV7VBok4vGAImRSGAz+fPYi5BRLpTSBZejnspYH3rSIbIaA6vrDYpnJfV6detCpwfzE3gWGihPkO+7hidnpwfi26g1oJcvypL5DS+kV14rpBRhJF+GcBh0jBxYx9OtzOIokO3PrXhjM/ZO5RRDv6Qn6DRdfytth/FT/qWQhBtA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ashzqsfKp2TF3YE7Iuvl6Sj2pV+yYe4hO7XZpQv6oOSt1y9uLBwoCyWF8KrKLdgWEL6BNq2le3dt91LrzCeOPFcbuj8cH+CoZOy2qsVQfVe/oz+nUn2vC4cRmfXD4AYdoYj4rg21/Hz6LKPoOOCM2xAqmvyHGMfYg7k5QPeaW99wY6EsC/6phUjAjuJRLh7H6zkE2pwQHGaSiT0nAJybq4g355jOsooB1X1v3cNbR2FaDE805bhnzIywYCatj5ax0/CTOPhiK1bsQBWmZTkWU3VooZ81EH2vTFLEnEjtuwCNVFGlS3k3xEOHr9Kii6vawUbH4xgOGeltzF1lvKrPxw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 20 Dec 2022 17:04:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.12.2022 07:34, Xenia Ragiadakou wrote:
> Move its definition to the AMD-Vi driver and use CONFIG_AMD_IOMMU
> to guard its usage in common code.
> 
> Take the opportunity to replace bool_t with bool and 1 with true.

Please further take the opportunity and use ...

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -36,6 +36,8 @@ static struct radix_tree_root ivrs_maps;
>  LIST_HEAD_READ_MOSTLY(amd_iommu_head);
>  bool_t iommuv2_enabled;
>  
> +bool __read_mostly amd_iommu_perdev_intremap = true;

... __ro_after_init here.

> --- a/xen/include/xen/iommu.h
> +++ b/xen/include/xen/iommu.h
> @@ -104,7 +104,9 @@ static inline void clear_iommu_hap_pt_share(void)
>  }
>  
>  extern bool_t iommu_debug;
> -extern bool_t amd_iommu_perdev_intremap;
> +#ifdef CONFIG_AMD_IOMMU
> +extern bool amd_iommu_perdev_intremap;
> +#endif

We try to avoid such #ifdef-ary: There's no real harm from the declaration
being in scope; in the worst case the build will fail not at the compile,
but at the linking stage.

Jan



 


Rackspace

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