KVM: arm64: Emulate RAS error registers and set HCR_EL2's TERR & TEA
authorDongjiu Geng <gengdongjiu@huawei.com>
Mon, 15 Jan 2018 19:39:06 +0000 (19:39 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 16 Jan 2018 15:09:47 +0000 (15:09 +0000)
commit558daf693e0c7ea118dbfb9539aa5a72f34bad2e
tree9c6f5b2b49bb6950b68356af2cfd6e283ca9f1e2
parent0067df413bd9d7e9ee3a78ece1e1a93535378862
KVM: arm64: Emulate RAS error registers and set HCR_EL2's TERR & TEA

ARMv8.2 adds a new bit HCR_EL2.TEA which routes synchronous external
aborts to EL2, and adds a trap control bit HCR_EL2.TERR which traps
all Non-secure EL1&0 error record accesses to EL2.

This patch enables the two bits for the guest OS, guaranteeing that
KVM takes external aborts and traps attempts to access the physical
error registers.

ERRIDR_EL1 advertises the number of error records, we return
zero meaning we can treat all the other registers as RAZ/WI too.

Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
[removed specific emulation, use trap_raz_wi() directly for everything,
 rephrased parts of the commit message]
Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/kvm_arm.h
arch/arm64/include/asm/kvm_emulate.h
arch/arm64/include/asm/sysreg.h
arch/arm64/kvm/sys_regs.c