]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
arm: put the value of VTCR for cells in a define
authorAntonios Motakis <antonios.motakis@huawei.com>
Thu, 12 May 2016 13:00:59 +0000 (15:00 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 26 Jun 2016 07:16:28 +0000 (09:16 +0200)
We can reuse the code under hypervisor/arch/arm/mmu_cell.c for the
AArch64 port, save for the value we use for the VTCRL. AArch64 will
need in addition to the flags set by the AArch32 port, to set the
size of the address space.

We put this behind a define in asm/paging.h to allow this reuse.

Signed-off-by: Antonios Motakis <antonios.motakis@huawei.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/arm/include/asm/paging.h
hypervisor/arch/arm/mmu_cell.c

index 98fc343e030b506b043107062fdbbb232fc25d92..0afbc866edb7e32c68950086ecd3c9ee722b431d 100644 (file)
 #define TCR_SL0_SHIFT          6
 #define TCR_S_SHIFT            4
 
+#define VTCR_CELL              (T0SZ | SL0 << TCR_SL0_SHIFT            \
+                               | (TCR_RGN_WB_WA << TCR_IRGN0_SHIFT)    \
+                               | (TCR_RGN_WB_WA << TCR_ORGN0_SHIFT)    \
+                               | (TCR_INNER_SHAREABLE << TCR_SH0_SHIFT)\
+                               | VTCR_RES1)
+
 /*
  * Hypervisor memory attribute indexes:
  *   0: normal WB, RA, WA, non-transient
index fb5ad835e502d309b0deafb53b38b778343b99b7..d3031def7cfe98f487232d701040b7126a0ae6d9 100644 (file)
@@ -77,12 +77,7 @@ int arch_mmu_cpu_cell_init(struct per_cpu *cpu_data)
        struct cell *cell = cpu_data->cell;
        unsigned long cell_table = paging_hvirt2phys(cell->arch.mm.root_table);
        u64 vttbr = 0;
-       u32 vtcr = T0SZ
-               | SL0 << TCR_SL0_SHIFT
-               | (TCR_RGN_WB_WA << TCR_IRGN0_SHIFT)
-               | (TCR_RGN_WB_WA << TCR_ORGN0_SHIFT)
-               | (TCR_INNER_SHAREABLE << TCR_SH0_SHIFT)
-               | VTCR_RES1;
+       u32 vtcr = VTCR_CELL;
 
        if (cell->id > 0xff) {
                panic_printk("No cell ID available\n");