Skip to content

Commit 4abc783

Browse files
author
Marc Zyngier
committed
arm64: Add missing APTable and TCR_ELx.HPD masks
Although Linux doesn't make use of hierarchical permissions (TFFT!), KVM needs to know where the various bits related to this feature live in the TCR_ELx registers as well as in the page tables. Add the missing bits. Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 69231a6 commit 4abc783

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

arch/arm64/include/asm/kvm_arm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
/* TCR_EL2 Registers bits */
108108
#define TCR_EL2_DS (1UL << 32)
109109
#define TCR_EL2_RES1 ((1U << 31) | (1 << 23))
110+
#define TCR_EL2_HPD (1 << 24)
110111
#define TCR_EL2_TBI (1 << 20)
111112
#define TCR_EL2_PS_SHIFT 16
112113
#define TCR_EL2_PS_MASK (7 << TCR_EL2_PS_SHIFT)

arch/arm64/include/asm/pgtable-hwdef.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@
204204
*/
205205
#define PTE_S2_MEMATTR(t) (_AT(pteval_t, (t)) << 2)
206206

207+
/*
208+
* Hierarchical permission for Stage-1 tables
209+
*/
210+
#define S1_TABLE_AP (_AT(pmdval_t, 3) << 61)
211+
207212
/*
208213
* Highest possible physical address supported.
209214
*/
@@ -298,6 +303,10 @@
298303
#define TCR_TBI1 (UL(1) << 38)
299304
#define TCR_HA (UL(1) << 39)
300305
#define TCR_HD (UL(1) << 40)
306+
#define TCR_HPD0_SHIFT 41
307+
#define TCR_HPD0 (UL(1) << TCR_HPD0_SHIFT)
308+
#define TCR_HPD1_SHIFT 42
309+
#define TCR_HPD1 (UL(1) << TCR_HPD1_SHIFT)
301310
#define TCR_TBID0 (UL(1) << 51)
302311
#define TCR_TBID1 (UL(1) << 52)
303312
#define TCR_NFD0 (UL(1) << 53)

0 commit comments

Comments
 (0)