diff mbox

[RFC,1/4] arm/mem_access: Move TTBCR_SZ_MASK to processor.h

Message ID 20170430194838.29932-2-proskurin@sec.in.tum.de (mailing list archive)
State New, archived
Headers show

Commit Message

Sergej Proskurin April 30, 2017, 7:48 p.m. UTC
This commit moves the define TTBCR_SZ_MASK from smmu.c to processor.h as
it will be additionally used in mem_access.c as shown in one of the
following commits.

Signed-off-by: Sergej Proskurin <proskurin@sec.in.tum.de>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Julien Grall <julien.grall@arm.com>
---
 xen/drivers/passthrough/arm/smmu.c | 1 -
 xen/include/asm-arm/processor.h    | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Julien Grall May 2, 2017, 11:47 a.m. UTC | #1
Hi Sergej,

On 30/04/17 20:48, Sergej Proskurin wrote:
> This commit moves the define TTBCR_SZ_MASK from smmu.c to processor.h as
> it will be additionally used in mem_access.c as shown in one of the
> following commits.

The SMMU driver has been imported from Linux and so does TTBCR_SZ_MASK. 
We want to keep the driver as close as Linux, so I am not in favor of 
this change.

If you need to re-define TTBR_SZ_MASK, then you can undef at the 
beginning of the SMMU file (see how we do SCTLR_AFE) at the beginning.

Cheers,

>
> Signed-off-by: Sergej Proskurin <proskurin@sec.in.tum.de>
> ---
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Julien Grall <julien.grall@arm.com>
> ---
>  xen/drivers/passthrough/arm/smmu.c | 1 -
>  xen/include/asm-arm/processor.h    | 2 ++
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
> index 1082fcf8ab..e2f86e917e 100644
> --- a/xen/drivers/passthrough/arm/smmu.c
> +++ b/xen/drivers/passthrough/arm/smmu.c
> @@ -535,7 +535,6 @@ static struct iommu_group *iommu_group_get(struct device *dev)
>
>  #define TTBCR_T1SZ_SHIFT		16
>  #define TTBCR_T0SZ_SHIFT		0
> -#define TTBCR_SZ_MASK			0xf
>
>  #define TTBCR2_SEP_SHIFT		15
>  #define TTBCR2_SEP_MASK			0x7
> diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
> index 855ded1b07..4fdf86070b 100644
> --- a/xen/include/asm-arm/processor.h
> +++ b/xen/include/asm-arm/processor.h
> @@ -94,6 +94,8 @@
>  #define TTBCR_N_2KB  _AC(0x03,U)
>  #define TTBCR_N_1KB  _AC(0x04,U)
>
> +#define TTBCR_SZ_MASK   0xf
> +
>  /* SCTLR System Control Register. */
>  /* HSCTLR is a subset of this. */
>  #define SCTLR_TE        (_AC(1,U)<<30)
>
diff mbox

Patch

diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 1082fcf8ab..e2f86e917e 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -535,7 +535,6 @@  static struct iommu_group *iommu_group_get(struct device *dev)
 
 #define TTBCR_T1SZ_SHIFT		16
 #define TTBCR_T0SZ_SHIFT		0
-#define TTBCR_SZ_MASK			0xf
 
 #define TTBCR2_SEP_SHIFT		15
 #define TTBCR2_SEP_MASK			0x7
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 855ded1b07..4fdf86070b 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -94,6 +94,8 @@ 
 #define TTBCR_N_2KB  _AC(0x03,U)
 #define TTBCR_N_1KB  _AC(0x04,U)
 
+#define TTBCR_SZ_MASK   0xf
+
 /* SCTLR System Control Register. */
 /* HSCTLR is a subset of this. */
 #define SCTLR_TE        (_AC(1,U)<<30)