qemu-patch-raspberry4/target/arm
Dongjiu Geng e24fd076a5 target-arm: kvm64: handle SIGBUS signal from kernel or KVM
Add a SIGBUS signal handler. In this handler, it checks the SIGBUS type,
translates the host VA delivered by host to guest PA, then fills this PA
to guest APEI GHES memory, then notifies guest according to the SIGBUS
type.

When guest accesses the poisoned memory, it will generate a Synchronous
External Abort(SEA). Then host kernel gets an APEI notification and calls
memory_failure() to unmapped the affected page in stage 2, finally
returns to guest.

Guest continues to access the PG_hwpoison page, it will trap to KVM as
stage2 fault, then a SIGBUS_MCEERR_AR synchronous signal is delivered to
Qemu, Qemu records this error address into guest APEI GHES memory and
notifes guest using Synchronous-External-Abort(SEA).

In order to inject a vSEA, we introduce the kvm_inject_arm_sea() function
in which we can setup the type of exception and the syndrome information.
When switching to guest, the target vcpu will jump to the synchronous
external abort vector table entry.

The ESR_ELx.DFSC is set to synchronous external abort(0x10), and the
ESR_ELx.FnV is set to not valid(0x1), which will tell guest that FAR is
not valid and hold an UNKNOWN value. These values will be set to KVM
register structures through KVM_SET_ONE_REG IOCTL.

Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
Signed-off-by: Xiang Zheng <zhengxiang9@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Xiang Zheng <zhengxiang9@huawei.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-id: 20200512030609.19593-10-gengdongjiu@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-05-14 15:03:09 +01:00
..
a32-uncond.decode target/arm: Convert Unallocated memory hint 2019-09-05 13:23:03 +01:00
a32.decode target/arm: Convert SVC 2019-09-05 13:23:03 +01:00
arch_dump.c target/arm: Add isar_feature_aa32_vfp_simd 2020-02-28 16:14:57 +00:00
arm-powerctl.c arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on() 2019-12-20 14:03:00 +00:00
arm-powerctl.h target/arm/arm-powerctl: Add new arm_set_cpu_on_and_reset() 2019-02-28 11:03:04 +00:00
arm-semi.c target/arm/arm-semi: Don't let the guest close stdin/stdout/stderr 2020-01-30 16:02:01 +00:00
arm_ldst.h target/arm: fetch code with translator_ld 2019-10-28 15:12:38 +00:00
cpu-param.h target/arm: Don't use a TLB for ARMMMUIdx_Stage2 2020-05-04 10:32:46 +01:00
cpu-qom.h target/arm: Make cpu_register() available for other files 2020-04-30 15:35:41 +01:00
cpu.c target/arm: Restrict TCG cpus to TCG accel 2020-05-11 11:45:59 +01:00
cpu.h target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
cpu64.c target/arm/cpu: Use ARRAY_SIZE() to iterate over ARMCPUInfo[] 2020-05-11 11:45:59 +01:00
cpu_tcg.c target/arm: Use correct GDB XML for M-profile cores 2020-05-14 15:03:08 +01:00
crypto_helper.c target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
debug_helper.c target/arm: Stop assuming DBGDIDR always exists 2020-02-21 16:07:01 +00:00
gdbstub.c target/arm: Use correct GDB XML for M-profile cores 2020-05-14 15:03:08 +01:00
gdbstub64.c gdbstub: extend GByteArray to read register helpers 2020-03-17 17:38:38 +00:00
helper-a64.c target/arm: Move helper_dc_zva to helper-a64.c 2020-03-05 16:09:20 +00:00
helper-a64.h target/arm: Use DEF_HELPER_FLAGS for helper_dc_zva 2020-03-05 16:09:21 +00:00
helper-sve.h target/arm: Use tcg_gen_gvec_5_ptr for sve FMLA/FCMLA 2020-05-11 11:59:22 +01:00
helper.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
helper.h target/arm: Vectorize SABA/UABA 2020-05-14 15:03:08 +01:00
idau.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
internals.h target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
iwmmxt_helper.c target/arm: Untabify iwmmxt_helper.c 2018-08-24 13:17:48 +01:00
kvm-consts.h arm: add trailing ; after MISMATCH_CHECK 2017-02-01 03:37:18 +02:00
kvm-stub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
kvm.c target/arm/kvm: Let kvm_arm_vgic_probe() return a bitmap 2020-03-12 16:27:33 +00:00
kvm32.c target/arm/kvm: Inline set_feature() calls 2020-05-11 11:45:59 +01:00
kvm64.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
kvm_arm.h target/arm/kvm: Let kvm_arm_vgic_probe() return a bitmap 2020-03-12 16:27:33 +00:00
m_helper.c target/arm: Add isar_feature_aa32_vfp_simd 2020-02-28 16:14:57 +00:00
machine.c target/arm: Add isar_feature_aa64_fp_simd, isar_feature_aa32_vfp 2020-02-28 16:14:57 +00:00
Makefile.objs target/arm: Restrict TCG cpus to TCG accel 2020-05-11 11:45:59 +01:00
monitor.c Use &error_abort instead of separate assert() 2020-03-17 16:05:40 +01:00
neon-dp.decode target/arm: Swap argument order for VSHL during decode 2020-05-14 15:03:08 +01:00
neon-ls.decode target/arm: Convert Neon 'load/store single structure' to decodetree 2020-05-04 12:57:56 +01:00
neon-shared.decode target/arm: Convert VFM[AS]L (scalar) to decodetree 2020-05-04 12:57:56 +01:00
neon_helper.c target/arm: Vectorize SABA/UABA 2020-05-14 15:03:08 +01:00
op_addsub.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
op_helper.c target/arm: Move helper_dc_zva to helper-a64.c 2020-03-05 16:09:20 +00:00
pauth_helper.c target/arm: Use bit 55 explicitly for pauth 2020-02-21 16:07:00 +00:00
psci.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
sve.decode target/arm: SVE brk[ab] merging does not have s bit 2019-01-07 15:23:45 +00:00
sve_helper.c target/arm: Use tcg_gen_gvec_5_ptr for sve FMLA/FCMLA 2020-05-11 11:59:22 +01:00
t16.decode target/arm: Convert T16, long branches 2019-09-05 13:23:04 +01:00
t32.decode target/arm: Convert TT 2019-09-05 13:23:03 +01:00
tlb_helper.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
translate-a64.c target/arm: Vectorize SABA/UABA 2020-05-14 15:03:08 +01:00
translate-a64.h target/arm: Convert Neon 3-reg-same VADD/VSUB to decodetree 2020-05-04 12:57:56 +01:00
translate-neon.inc.c target/arm: Create gen_gvec_{uqadd, sqadd, uqsub, sqsub} 2020-05-14 15:03:08 +01:00
translate-sve.c target/arm: Fix tcg_gen_gvec_dup_imm vs DUP (indexed) 2020-05-11 14:22:54 +01:00
translate-vfp.inc.c target/arm/translate-vfp.inc.c: Remove duplicate simd_r32 check 2020-05-04 12:57:56 +01:00
translate.c target/arm: Vectorize SABA/UABA 2020-05-14 15:03:08 +01:00
translate.h target/arm: Vectorize SABA/UABA 2020-05-14 15:03:08 +01:00
vec_helper.c target/arm: Vectorize SABA/UABA 2020-05-14 15:03:08 +01:00
vfp-uncond.decode target/arm: Split VMINMAXNM decode 2020-02-28 16:14:57 +00:00
vfp.decode target/arm: Split VFM decode 2020-02-28 16:14:57 +00:00
vfp_helper.c target/arm: Remove fp_status from helper_{recpe, rsqrte}_u32 2020-05-14 15:03:08 +01:00