# \[PATCH v4 21/21\] KVM: arm64: Trap RAS error registers and set HCR\_EL2's TERR \& TEA

- From: Marc Zyngier \<hidden\>
- Date: 2017-10-31 06:32:53 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2017/10/8760587
- Thread: https://ratatoskr.run/linux-arm-kernel/2017/10/8760587/t.md

```text
On Thu, Oct 19 2017 at  4:58:07 pm BST, James Morse [ref] wrote:
> From: Dongjiu Geng <redacted>
>
> 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 <redacted>
> [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: Marc Zyngier <redacted>

	M.
-- 
Jazz is not dead. It just smells funny.
```
