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 <prosku...@sec.in.tum.de>
---
Cc: Stefano Stabellini <sstabell...@kernel.org>
Cc: Julien Grall <julien.gr...@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)


--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to