From: Igor Mammedov <imammedo@redhat.com> To: Xiang Zheng <zhengxiang9@huawei.com> Cc: Peter Maydell <peter.maydell@linaro.org>, Beata Michalska <beata.michalska@linaro.org>, kvm@vger.kernel.org, mst@redhat.com, wanghaibin.wang@huawei.com, mtosatti@redhat.com, linuxarm@huawei.com, qemu-devel@nongnu.org, ehabkost@redhat.com, gengdongjiu@huawei.com, shannon.zhaosl@gmail.com, qemu-arm@nongnu.org, james.morse@arm.com, xuwei5@huawei.com, jonathan.cameron@huawei.com, pbonzini@redhat.com, Laszlo Ersek <lersek@redhat.com>, rth@twiddle.net Subject: Re: [RESEND PATCH v21 5/6] target-arm: kvm64: handle SIGBUS signal from kernel or KVM Date: Wed, 27 Nov 2019 14:02:23 +0100 Message-ID: <20191127140223.58d1a35b@redhat.com> (raw) In-Reply-To: <22a3935a-a672-f8f1-e5be-6c0725f738c4@huawei.com> On Wed, 27 Nov 2019 20:47:15 +0800 Xiang Zheng <zhengxiang9@huawei.com> wrote: > Hi Beata, > > Thanks for you review! > > On 2019/11/22 23:47, Beata Michalska wrote: > > Hi, > > > > On Mon, 11 Nov 2019 at 01:48, Xiang Zheng <zhengxiang9@huawei.com> wrote: > >> > >> From: Dongjiu Geng <gengdongjiu@huawei.com> > >> > >> 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> > >> --- [...] > >> diff --git a/include/hw/acpi/acpi_ghes.h b/include/hw/acpi/acpi_ghes.h > >> index cb62ec9c7b..8e3c5b879e 100644 > >> --- a/include/hw/acpi/acpi_ghes.h > >> +++ b/include/hw/acpi/acpi_ghes.h > >> @@ -24,6 +24,9 @@ > >> > >> #include "hw/acpi/bios-linker-loader.h" > >> > >> +#define ACPI_GHES_CPER_OK 1 > >> +#define ACPI_GHES_CPER_FAIL 0 > >> + > > > > Is there really a need to introduce those ? > > > > Don't you think it's more clear than using "1" or "0"? :) or maybe just reuse default libc return convention: 0 - ok, -1 - fail and drop custom macros > > >> /* > >> * Values for Hardware Error Notification Type field > >> */ [...]
next prev parent reply index Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-11-11 1:40 [RESEND PATCH v21 0/6] Add ARMv8 RAS virtualization support in QEMU Xiang Zheng 2019-11-11 1:40 ` [RESEND PATCH v21 1/6] hw/arm/virt: Introduce a RAS machine option Xiang Zheng 2019-12-02 18:22 ` Peter Maydell 2019-12-07 12:10 ` gengdongjiu 2019-11-11 1:40 ` [RESEND PATCH v21 2/6] docs: APEI GHES generation and CPER record description Xiang Zheng 2019-11-15 9:44 ` Igor Mammedov 2019-11-27 1:37 ` Xiang Zheng 2019-11-27 8:12 ` Igor Mammedov 2019-11-11 1:40 ` [RESEND PATCH v21 3/6] ACPI: Add APEI GHES table generation support Xiang Zheng 2019-11-15 9:38 ` Igor Mammedov 2019-11-18 12:49 ` gengdongjiu 2019-11-18 13:18 ` gengdongjiu 2019-11-18 13:21 ` Michael S. Tsirkin 2019-11-18 13:57 ` gengdongjiu 2019-11-25 9:48 ` Igor Mammedov 2019-11-27 11:16 ` gengdongjiu 2019-11-22 15:44 ` Beata Michalska 2019-11-22 15:42 ` Beata Michalska 2019-11-25 9:23 ` Igor Mammedov 2019-11-11 1:40 ` [RESEND PATCH v21 4/6] KVM: Move hwpoison page related functions into kvm-all.c Xiang Zheng 2019-12-02 18:23 ` Peter Maydell 2019-11-11 1:40 ` [RESEND PATCH v21 5/6] target-arm: kvm64: handle SIGBUS signal from kernel or KVM Xiang Zheng 2019-11-15 16:37 ` Igor Mammedov 2019-11-22 15:47 ` Beata Michalska 2019-11-25 9:37 ` Igor Mammedov 2019-11-27 1:40 ` Xiang Zheng 2019-11-27 10:43 ` Igor Mammedov 2019-12-21 12:35 ` gengdongjiu 2019-11-22 15:47 ` Beata Michalska 2019-11-27 12:47 ` Xiang Zheng 2019-11-27 13:02 ` Igor Mammedov [this message] 2019-11-27 14:17 ` Beata Michalska 2019-12-03 3:35 ` Xiang Zheng 2019-11-27 14:17 ` Beata Michalska 2019-12-03 3:35 ` Xiang Zheng 2019-12-07 9:33 ` gengdongjiu 2019-12-09 13:05 ` Beata Michalska 2019-12-09 14:12 ` gengdongjiu 2019-11-11 1:40 ` [RESEND PATCH v21 6/6] MAINTAINERS: Add APCI/APEI/GHES entries Xiang Zheng 2019-12-02 18:27 ` [RESEND PATCH v21 0/6] Add ARMv8 RAS virtualization support in QEMU Peter Maydell 2019-12-03 2:09 ` gengdongjiu
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20191127140223.58d1a35b@redhat.com \ --to=imammedo@redhat.com \ --cc=beata.michalska@linaro.org \ --cc=ehabkost@redhat.com \ --cc=gengdongjiu@huawei.com \ --cc=james.morse@arm.com \ --cc=jonathan.cameron@huawei.com \ --cc=kvm@vger.kernel.org \ --cc=lersek@redhat.com \ --cc=linuxarm@huawei.com \ --cc=mst@redhat.com \ --cc=mtosatti@redhat.com \ --cc=pbonzini@redhat.com \ --cc=peter.maydell@linaro.org \ --cc=qemu-arm@nongnu.org \ --cc=qemu-devel@nongnu.org \ --cc=rth@twiddle.net \ --cc=shannon.zhaosl@gmail.com \ --cc=wanghaibin.wang@huawei.com \ --cc=xuwei5@huawei.com \ --cc=zhengxiang9@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
QEMU-Devel Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git git clone --mirror https://lore.kernel.org/qemu-devel/2 qemu-devel/git/2.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \ qemu-devel@nongnu.org public-inbox-index qemu-devel Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git