Skip to content

Commit ca4e514

Browse files
author
Marc Zyngier
committed
KVM: arm64: Introduce handling of AArch32 TTBCR2 traps
ARMv8.2 introduced TTBCR2, which shares TCR_EL1 with TTBCR. Gracefully handle traps to this register when HCR_EL2.TVM is set. Cc: stable@vger.kernel.org Reported-by: James Morse <james.morse@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 90c1f93 commit ca4e514

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎arch/arm64/include/asm/kvm_host.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ enum vcpu_sysreg {
212212
#define c2_TTBR1 (TTBR1_EL1 * 2) /* Translation Table Base Register 1 */
213213
#define c2_TTBR1_high (c2_TTBR1 + 1) /* TTBR1 top 32 bits */
214214
#define c2_TTBCR (TCR_EL1 * 2) /* Translation Table Base Control R. */
215+
#define c2_TTBCR2 (c2_TTBCR + 1) /* Translation Table Base Control R. 2 */
215216
#define c3_DACR (DACR32_EL2 * 2)/* Domain Access Control Register */
216217
#define c5_DFSR (ESR_EL1 * 2) /* Data Fault Status Register */
217218
#define c5_IFSR (IFSR32_EL2 * 2)/* Instruction Fault Status Register */

‎arch/arm64/kvm/sys_regs.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,6 +1925,7 @@ static const struct sys_reg_desc cp15_regs[] = {
19251925
{ Op1( 0), CRn( 2), CRm( 0), Op2( 0), access_vm_reg, NULL, c2_TTBR0 },
19261926
{ Op1( 0), CRn( 2), CRm( 0), Op2( 1), access_vm_reg, NULL, c2_TTBR1 },
19271927
{ Op1( 0), CRn( 2), CRm( 0), Op2( 2), access_vm_reg, NULL, c2_TTBCR },
1928+
{ Op1( 0), CRn( 2), CRm( 0), Op2( 3), access_vm_reg, NULL, c2_TTBCR2 },
19281929
{ Op1( 0), CRn( 3), CRm( 0), Op2( 0), access_vm_reg, NULL, c3_DACR },
19291930
{ Op1( 0), CRn( 5), CRm( 0), Op2( 0), access_vm_reg, NULL, c5_DFSR },
19301931
{ Op1( 0), CRn( 5), CRm( 0), Op2( 1), access_vm_reg, NULL, c5_IFSR },

0 commit comments

Comments
 (0)