qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] 答复: [PATCH RESEND v15 10/10] target-arm: kvm64: handle SI


From: Peter Maydell
Subject: Re: [Qemu-arm] 答复: [PATCH RESEND v15 10/10] target-arm: kvm64: handle SIGBUS signal from kernel or KVM
Date: Thu, 22 Nov 2018 10:28:56 +0000

On 22 November 2018 at 03:05, gengdongjiu <address@hidden> wrote:
>> >
>> > +void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr) {
>> > +    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);
>> > +            if (code == BUS_MCEERR_AR) {
>> > +                kvm_cpu_synchronize_state(c);
>> > +                if (ghes_record_errors(ACPI_HEST_NOTIFY_SEA, paddr)) {
>> > +                    kvm_inject_arm_sea(c);
>> > +                } else {
>> > +                    fprintf(stderr, "failed to record the error\n");
>> > +                }
>>
>> Shouldn't there be something in here to say "only report this error to the 
>> guest if we are actually reporting RAS errors to the guest" ?
>
> Yes, We can say something that such as "report this error to the guest", 
> because this error is indeed triggered by guest, which is guest error.

I'm afraid I don't really understand what you mean. Could you
try rephrasing it?

My understanding was:
 * we get this signal if there is a RAS error in the host memory
 * if we are exposing RAS errors to the guest (ie we have
   told it that in the ACPI table we passed it at startup)
   then we should pass on this error to the guest

but that these are two different conditions.

If the host hardware detects a RAS error in memory used
by the guest but the guest is not being told about RAS
errors, then we cannot report the error: we have no mechanism
to do so, and the guest is not expecting it.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]