[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v16 10/10] target-arm: kvm64: handle SIGBUS sign
From: |
gengdongjiu |
Subject: |
Re: [Qemu-devel] [PATCH v16 10/10] target-arm: kvm64: handle SIGBUS signal from kernel or KVM |
Date: |
Tue, 14 May 2019 19:25:20 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
>
>> +void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr)
>> +{
>> + ARMCPU *cpu = ARM_CPU(c);
>> + CPUARMState *env = &cpu->env;
>> + ram_addr_t ram_addr;
>> + hwaddr paddr;
>> +
>> + assert(code == BUS_MCEERR_AR || code == BUS_MCEERR_AO);
>> +
>> + if (addr) {
>> + ram_addr = qemu_ram_addr_from_host(addr);
>> + if (ram_addr != RAM_ADDR_INVALID &&
>> + kvm_physical_memory_addr_from_host(c->kvm_state, addr, &paddr))
>> {
>> + kvm_hwpoison_page_add(ram_addr);
>> + /* Asynchronous signal will be masked by main thread, so
>> + * only handle synchronous signal.
>> + */
>> + if (code == BUS_MCEERR_AR) {
>> + kvm_cpu_synchronize_state(c);
>> + if (GHES_CPER_FAIL !=
>> ghes_record_errors(ACPI_HEST_NOTIFY_SEA, paddr)) {
>> + kvm_inject_arm_sea(c);
>> + } else {
>> + fprintf(stderr, "failed to record the error\n");
>> + }
>> + }
>> + return;
>> + }
>> + fprintf(stderr, "Hardware memory error for memory used by "
>> + "QEMU itself instead of guest system!\n");
>> + }
>> +
>> + if (code == BUS_MCEERR_AR) {
>> + fprintf(stderr, "Hardware memory error!\n");
>> + exit(1);
>> + }
>> +}
>
> This code appears to still be unconditionally trying to
> notify the guest of the error via the ACPI tables without
> checking whether those ACPI tables even exist. I told you
> about this in a previous round of review :-(
Thanks very much for the comments, and sorry for my forgetting
I added the ACPI checking in the new V17 version.
>
> thanks
> -- PMM
> .
>
- [Qemu-devel] [PATCH v16 00/10] Add ARMv8 RAS virtualization support in QEMU, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 10/10] target-arm: kvm64: handle SIGBUS signal from kernel or KVM, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 09/10] target-arm: kvm64: inject synchronous External Abort, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 07/10] ACPI: Add APEI GHES table generation support, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 02/10] ACPI: add some GHES structures and macros definition, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 01/10] hw/arm/virt: Add RAS platform version for migration, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 08/10] KVM: Move related hwpoison page functions to accel/kvm/ folder, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 05/10] acpi: add build_append_ghes_generic_status() helper for Generic Error Status Block, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 04/10] acpi: add build_append_ghes_generic_data() helper for Generic Error Data Entry, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 06/10] docs: APEI GHES generation and CPER record description, Dongjiu Geng, 2019/05/13
- [Qemu-devel] [PATCH v16 03/10] acpi: add build_append_ghes_notify() helper for Hardware Error Notification, Dongjiu Geng, 2019/05/13