diff options
author | Dongjiu Geng <gengdongjiu@huawei.com> | 2017-10-17 22:23:49 +0800 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2017-10-21 17:03:15 +0200 |
commit | fd6c8c206fc5d0717b0433b191de0715122f33bb (patch) | |
tree | 26be3c473f886b7f9140350c14f7c767f505161f /virt | |
parent | 8c1a8a32438b95792bbd8719d1cd4fe36e9eba03 (diff) | |
download | linux-fd6c8c206fc5d0717b0433b191de0715122f33bb.tar.gz linux-fd6c8c206fc5d0717b0433b191de0715122f33bb.tar.bz2 linux-fd6c8c206fc5d0717b0433b191de0715122f33bb.zip |
arm/arm64: KVM: set right LR register value for 32 bit guest when inject abort
When a exception is trapped to EL2, hardware uses ELR_ELx to hold
the current fault instruction address. If KVM wants to inject a
abort to 32 bit guest, it needs to set the LR register for the
guest to emulate this abort happened in the guest. Because ARM32
architecture is pipelined execution, so the LR value has an offset to
the fault instruction address.
The offsets applied to Link value for exceptions as shown below,
which should be added for the ARM32 link register(LR).
Table taken from ARMv8 ARM DDI0487B-B, table G1-10:
Exception Offset, for PE state of:
A32 T32
Undefined Instruction +4 +2
Prefetch Abort +4 +4
Data Abort +8 +8
IRQ or FIQ +4 +4
[ Removed unused variables in inject_abt to avoid compile warnings.
-- Christoffer ]
Cc: <stable@vger.kernel.org>
Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
Tested-by: Haibin Zhang <zhanghaibin7@huawei.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions