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 SIGBUS


From: gengdongjiu
Subject: Re: [Qemu-arm] [PATCH RESEND v15 10/10] target-arm: kvm64: handle SIGBUS signal from kernel or KVM
Date: Fri, 23 Nov 2018 14:31:18 +0000

Hi Peter,
  Thanks for the comments and mail.

> 
> On 22 November 2018 at 10:28, Peter Maydell <address@hidden> wrote:
> > On 22 November 2018 at 03:05, gengdongjiu <address@hidden> wrote:
> >>> >
> >>> 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.
> 
> If you look at the x86 version of this function you can see that it tests 
> (env->mcg_cap & MCG_SER_P), which I think is the equivalent x86 "is
> the guest CPU/config one we can report these errors to" test.

MCG_SER_P (software error recovery support present) flag indicates (when set) 
that the processor supports software error recovery.
env->mcg_cap 's value should be got from KVM as shown in the QEMU code[1], it 
indicates whether the KVM support software error recovery.

[1]:
-------------------------------------------------------------------------------------------------------------
  ret = kvm_get_mce_cap_supported(cs->kvm_state, &mcg_cap, &banks);
  if (ret < 0) {
       fprintf(stderr, "kvm_get_mce_cap_supported: %s", strerror(-ret));
           return ret;
   }
-------------------------------------------------------------------------------------------------------------





[2]:
--------------------------------------------------------------------------------------------------------------
void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr)
{
        ...........................

        if (ram_addr != RAM_ADDR_INVALID &&
            kvm_physical_memory_addr_from_host(c->kvm_state, addr, &paddr)) {
            
  If it got to here, it means the host hardware detects a RAS error in memory 
used by the guest using above two judgments.
  Maybe we can test/check whether KVM supports software error recovery in [3]
                       
            }
            return;
            .........................
        }
}
---------------------------------------------------------------------------------------------------------------

[3]:
If we check it as x86, we can check that whether KVM supports software recovery 
though IOCTL, for example.

int r = kvm_ioctl(s, XXXXXX_GET_SER_CAP_SUPPORTED, seg_cap);
--------------
if (seg_cap && addr) {
   ------------------------
}

> 
> thanks
> -- PMM

reply via email to

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