All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
To: Tirumalesh Chalamarla
	<tchalamarla-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
Cc: mark.rutland-5wv7dgnIgG8@public.gmane.org,
	Geethasowjanya.Akula-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH V4] iommu/arm-smmu-v2: Workaround for ThunderX errata#27704
Date: Fri, 4 Mar 2016 16:02:21 +0000	[thread overview]
Message-ID: <20160304160221.GC7886@arm.com> (raw)
In-Reply-To: <1457063043-10623-1-git-send-email-tchalamarla-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>

On Thu, Mar 03, 2016 at 07:44:03PM -0800, Tirumalesh Chalamarla wrote:
> Due to Errata#27704 CN88xx SMMUv2,supports  only shared ASID and VMID
> namespaces; specifically within a given node SMMU0 and SMMU1 share,
> as does SMMU2 and SMMU3.
> 
> This patch make sures ASID and VMID space is unique across cavium SMMUv2.
> 
> changes from V3:
> 	- Removed redundent variable.

[...]

> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 247a469..bfe38f3 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -326,6 +326,11 @@ struct arm_smmu_device {
> 
>  	struct list_head		list;
>  	struct rb_root			masters;
> +	/*
> +	 *The following fields are specific to Cavium, Thunder
> +	 */
> +	u32				cavium_id_base;
> +
>  };
> 
>  struct arm_smmu_cfg {
> @@ -335,8 +340,8 @@ struct arm_smmu_cfg {
>  };
>  #define INVALID_IRPTNDX			0xff
> 
> -#define ARM_SMMU_CB_ASID(cfg)		((cfg)->cbndx)
> -#define ARM_SMMU_CB_VMID(cfg)		((cfg)->cbndx + 1)
> +#define ARM_SMMU_CB_ASID(smmu, cfg) ((u16)(smmu)->cavium_id_base + (cfg)->cbndx)
> +#define ARM_SMMU_CB_VMID(smmu, cfg) ((u16)(smmu)->cavium_id_base + (cfg)->cbndx + 1)
> 
>  enum arm_smmu_domain_stage {
>  	ARM_SMMU_DOMAIN_S1 = 0,
> @@ -364,6 +369,8 @@ struct arm_smmu_option_prop {
>  	const char *prop;
>  };
> 
> +static u32 cavium_smmu_context_count;

I thought you were going to make this an atomic_t?

Will

WARNING: multiple messages have this Message-ID (diff)
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V4] iommu/arm-smmu-v2: Workaround for ThunderX errata#27704
Date: Fri, 4 Mar 2016 16:02:21 +0000	[thread overview]
Message-ID: <20160304160221.GC7886@arm.com> (raw)
In-Reply-To: <1457063043-10623-1-git-send-email-tchalamarla@caviumnetworks.com>

On Thu, Mar 03, 2016 at 07:44:03PM -0800, Tirumalesh Chalamarla wrote:
> Due to Errata#27704 CN88xx SMMUv2,supports  only shared ASID and VMID
> namespaces; specifically within a given node SMMU0 and SMMU1 share,
> as does SMMU2 and SMMU3.
> 
> This patch make sures ASID and VMID space is unique across cavium SMMUv2.
> 
> changes from V3:
> 	- Removed redundent variable.

[...]

> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 247a469..bfe38f3 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -326,6 +326,11 @@ struct arm_smmu_device {
> 
>  	struct list_head		list;
>  	struct rb_root			masters;
> +	/*
> +	 *The following fields are specific to Cavium, Thunder
> +	 */
> +	u32				cavium_id_base;
> +
>  };
> 
>  struct arm_smmu_cfg {
> @@ -335,8 +340,8 @@ struct arm_smmu_cfg {
>  };
>  #define INVALID_IRPTNDX			0xff
> 
> -#define ARM_SMMU_CB_ASID(cfg)		((cfg)->cbndx)
> -#define ARM_SMMU_CB_VMID(cfg)		((cfg)->cbndx + 1)
> +#define ARM_SMMU_CB_ASID(smmu, cfg) ((u16)(smmu)->cavium_id_base + (cfg)->cbndx)
> +#define ARM_SMMU_CB_VMID(smmu, cfg) ((u16)(smmu)->cavium_id_base + (cfg)->cbndx + 1)
> 
>  enum arm_smmu_domain_stage {
>  	ARM_SMMU_DOMAIN_S1 = 0,
> @@ -364,6 +369,8 @@ struct arm_smmu_option_prop {
>  	const char *prop;
>  };
> 
> +static u32 cavium_smmu_context_count;

I thought you were going to make this an atomic_t?

Will

  parent reply	other threads:[~2016-03-04 16:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04  3:44 [PATCH V4] iommu/arm-smmu-v2: Workaround for ThunderX errata#27704 Tirumalesh Chalamarla
2016-03-04  3:44 ` Tirumalesh Chalamarla
     [not found] ` <1457063043-10623-1-git-send-email-tchalamarla-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2016-03-04 16:02   ` Will Deacon [this message]
2016-03-04 16:02     ` Will Deacon
     [not found]     ` <20160304160221.GC7886-5wv7dgnIgG8@public.gmane.org>
2016-03-04 18:09       ` Tirumalesh Chalamarla
2016-03-04 18:09         ` Tirumalesh Chalamarla
     [not found]         ` <56D9CF3E.7080607-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2016-03-04 18:16           ` Tirumalesh Chalamarla
2016-03-04 18:16             ` Tirumalesh Chalamarla
  -- strict thread matches above, loose matches on Subject: below --
2016-03-04 18:39 Tirumalesh Chalamarla
2016-03-04 18:39 ` Tirumalesh Chalamarla
     [not found] ` <1457116784-13287-1-git-send-email-tchalamarla-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2016-03-04 20:59   ` Will Deacon
2016-03-04 20:59     ` Will Deacon
     [not found]     ` <20160304205945.GG7886-5wv7dgnIgG8@public.gmane.org>
2016-03-04 21:35       ` Tirumalesh Chalamarla
2016-03-04 21:35         ` Tirumalesh Chalamarla
2016-03-04 21:56 Tirumalesh Chalamarla
2016-03-04 21:56 ` Tirumalesh Chalamarla
     [not found] ` <1457128569-13878-1-git-send-email-tchalamarla-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2016-03-24 17:36   ` Chalamarla, Tirumalesh
2016-03-24 17:36     ` Chalamarla, Tirumalesh
     [not found]     ` <44D97D2C-5114-4FCD-AE3E-9404391FD449-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2016-03-24 17:51       ` Will Deacon
2016-03-24 17:51         ` Will Deacon
     [not found]         ` <20160324175127.GA29365-5wv7dgnIgG8@public.gmane.org>
2016-03-24 18:29           ` Chalamarla, Tirumalesh
2016-03-24 18:29             ` Chalamarla, Tirumalesh
2016-03-28 18:57             ` Radha Mohan
2016-03-28 18:57               ` Radha Mohan
2016-03-28 19:25               ` Radha Mohan
2016-03-28 19:25                 ` Radha Mohan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160304160221.GC7886@arm.com \
    --to=will.deacon-5wv7dgnigg8@public.gmane.org \
    --cc=Geethasowjanya.Akula-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=tchalamarla-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.