ANDROID: KVM: arm64: s2mpu: Allow L1ENTRY_* r/o access

Allow read-only access to L1ENTRY_ATTR and L1ENTRY_L2TABLE S2MPU
registers. This allows the host to dump the register state for debugging
purposes. It is safe because the state of the S2MPU is known to the host
anyway.

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I4fbcc3f7fac3f51ed47ba85ee4eb408fbf154e2d
This commit is contained in:
David Brazdil
2022-04-20 14:43:46 +01:00
parent 96767ad7be
commit e56d9603a6

View File

@@ -402,6 +402,11 @@ static u32 host_mmio_reg_access_mask(size_t off, bool is_write)
return read_only & ALL_VIDS_BITMAP;
}
/* Allow reading L1ENTRY registers for debugging. */
if (off >= REG_NS_L1ENTRY_L2TABLE_ADDR(0, 0) &&
off < REG_NS_L1ENTRY_ATTR(NR_VIDS, 0))
return read_only;
/* Allow EL1 IRQ handler to read fault information. */
masked_off = off & ~REG_NS_FAULT_VID_MASK;
if ((masked_off == REG_NS_FAULT_PA_LOW(0)) ||