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

Re: [PATCH 10/10] iommu/arm: Remove code duplication in all IOMMU drivers


  • To: Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Wed, 15 Dec 2021 03:03:59 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=PNlgJe5sHL16Fjk0h3qwhjw73UXpZVLLuyzLp/gpKrg=; b=GGIHJavY51dp6isyU2bM/iVRs06rLLkF47mHf14RYHXqhZFKLXRFRlPPM1kG8n86ueudRGu0l8exaWnhf/vaW8b7yqxW+JEL4CWou1kKmmHjXW3bT9PqmL3oClZcbjbXn1OT3hSxPKHO1DHBEJVpUP+m7zHjI+KdHjKhUuujVzd89C6ojLDo79NEXN6JJPPcyf1v8DOICtVJPOCy49DjGc9OqLqdKIqoxYXwC7kMy4/GwKCJNRlPrt0ScWnuetIHLRXtFn5ReEbGUbX661xO/wnbHCzNXJOVjzAvWaZTm0C7TAG3gnvfUCPY0jIzjtOLdgxX9Um9hdTH2J9zSBGD/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TioPVD1zwXOrsf1ZwAGRWrgp1IkGJZuFokuzqj+8T4RoFu6hw6tS3B0I3PtZDY25+qCvuKrdnPPG7JI//ximLfrkeD/foXnsNfJpG+iucC3UNgRU5HybZvoq215q1Kqsi2ezOVjOrkE8Degi1N909wSMuHuqYLnmMp4S/NTeRNeumiLII2P8tMA+YqTQh3HYoVPtaKdKcwXwEETkcOOLHNh15jSwCeQhia506ctQ7SnucF03kBCsJFKhEOgwh9ybokMAd2x/Ih5A2z/buR/utTvDy/joHq22Y06EyyvTjff/AsvKhOiJobAUH9h+9tG4lZRA9E2QkImQ6VXG7WWuWA==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
  • Delivery-date: Wed, 15 Dec 2021 03:04:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHX47d9oHPrGhwq2Umum7HnvXtv26wy+BMA
  • Thread-topic: [PATCH 10/10] iommu/arm: Remove code duplication in all IOMMU drivers

Oleksandr,

Oleksandr Tyshchenko <olekstysh@xxxxxxxxx> writes:

> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
>
> All IOMMU drivers on Arm perform almost the same generic actions in
> hwdom_init callback. Move this code to common arch_iommu_hwdom_init()
> in order to get rid of code duplication.
>
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

> ---
>  xen/drivers/passthrough/arm/iommu.c      |  7 +++++++
>  xen/drivers/passthrough/arm/ipmmu-vmsa.c |  8 --------
>  xen/drivers/passthrough/arm/smmu-v3.c    | 10 ----------
>  xen/drivers/passthrough/arm/smmu.c       | 10 ----------
>  4 files changed, 7 insertions(+), 28 deletions(-)
>
> diff --git a/xen/drivers/passthrough/arm/iommu.c 
> b/xen/drivers/passthrough/arm/iommu.c
> index ee653a9..fc45318 100644
> --- a/xen/drivers/passthrough/arm/iommu.c
> +++ b/xen/drivers/passthrough/arm/iommu.c
> @@ -134,6 +134,13 @@ void arch_iommu_domain_destroy(struct domain *d)
>  
>  void __hwdom_init arch_iommu_hwdom_init(struct domain *d)
>  {
> +    /* Set to false options not supported on ARM. */
> +    if ( iommu_hwdom_inclusive )
> +        printk(XENLOG_WARNING "map-inclusive dom0-iommu option is not 
> supported on ARM\n");
> +    iommu_hwdom_inclusive = false;
> +    if ( iommu_hwdom_reserved == 1 )
> +        printk(XENLOG_WARNING "map-reserved dom0-iommu option is not 
> supported on ARM\n");
> +    iommu_hwdom_reserved = 0;
>  }
>  
>  /*
> diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c 
> b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> index 32609f8..451fc21 100644
> --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> @@ -1336,14 +1336,6 @@ static int ipmmu_iommu_domain_init(struct domain *d)
>  
>  static void __hwdom_init ipmmu_iommu_hwdom_init(struct domain *d)
>  {
> -    /* Set to false options not supported on ARM. */
> -    if ( iommu_hwdom_inclusive )
> -        printk(XENLOG_WARNING "ipmmu: map-inclusive dom0-iommu option is not 
> supported on ARM\n");
> -    iommu_hwdom_inclusive = false;
> -    if ( iommu_hwdom_reserved == 1 )
> -        printk(XENLOG_WARNING "ipmmu: map-reserved dom0-iommu option is not 
> supported on ARM\n");
> -    iommu_hwdom_reserved = 0;
> -
>      arch_iommu_hwdom_init(d);
>  }
>  
> diff --git a/xen/drivers/passthrough/arm/smmu-v3.c 
> b/xen/drivers/passthrough/arm/smmu-v3.c
> index d115df7..ca8b5c7 100644
> --- a/xen/drivers/passthrough/arm/smmu-v3.c
> +++ b/xen/drivers/passthrough/arm/smmu-v3.c
> @@ -3404,16 +3404,6 @@ static int arm_smmu_iommu_xen_domain_init(struct 
> domain *d)
>  
>  static void __hwdom_init arm_smmu_iommu_hwdom_init(struct domain *d)
>  {
> -     /* Set to false options not supported on ARM. */
> -     if (iommu_hwdom_inclusive)
> -             printk(XENLOG_WARNING
> -             "map-inclusive dom0-iommu option is not supported on ARM\n");
> -     iommu_hwdom_inclusive = false;
> -     if (iommu_hwdom_reserved == 1)
> -             printk(XENLOG_WARNING
> -             "map-reserved dom0-iommu option is not supported on ARM\n");
> -     iommu_hwdom_reserved = 0;
> -
>       arch_iommu_hwdom_init(d);
>  }
>  
> diff --git a/xen/drivers/passthrough/arm/smmu.c 
> b/xen/drivers/passthrough/arm/smmu.c
> index c9dfc4c..ec18df7 100644
> --- a/xen/drivers/passthrough/arm/smmu.c
> +++ b/xen/drivers/passthrough/arm/smmu.c
> @@ -2851,16 +2851,6 @@ static int arm_smmu_iommu_domain_init(struct domain *d)
>  
>  static void __hwdom_init arm_smmu_iommu_hwdom_init(struct domain *d)
>  {
> -     /* Set to false options not supported on ARM. */
> -     if ( iommu_hwdom_inclusive )
> -             printk(XENLOG_WARNING
> -             "map-inclusive dom0-iommu option is not supported on ARM\n");
> -     iommu_hwdom_inclusive = false;
> -     if ( iommu_hwdom_reserved == 1 )
> -             printk(XENLOG_WARNING
> -             "map-reserved dom0-iommu option is not supported on ARM\n");
> -     iommu_hwdom_reserved = 0;
> -
>       arch_iommu_hwdom_init(d);
>  }


-- 
Volodymyr Babchuk at EPAM


 


Rackspace

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