[Top][All Lists]

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

Re: [Qemu-devel] [question] mask SIGBUS in qemu main thread

From: Peter Maydell
Subject: Re: [Qemu-devel] [question] mask SIGBUS in qemu main thread
Date: Mon, 20 Nov 2017 13:00:01 +0000

On 20 November 2017 at 12:50, Alex Bennée <address@hidden> wrote:
> What exactly do you expect the main thread to do with a SIGBUS signal?

For KVM, we (can) use SIGBUS for handling machine check exceptions:
see qemu_init_sigbus() in cpus.c, where we use prctl(PR_MCE_KILL)
to ask the host kernel to send us a SIGBUS if the memory used
by the VM has memory corruption detected by the hardwar. This
then lets us inform the guest (see kvm_mce_inject() in target/i386).
(This will probably be coming to Arm KVM at some point, as part
of the RAS extension support. See various threads in kvmarm list.)

Because asynchronous signals are a pain to deal with, for the
main thread we handle all our signals via signalfd(), which is
why the main thread shows SIGBUS as blocked. The main thread
will pick the signal up via the fd at some point. For KVM vcpu
threads, the signal arrives asynchronously. See sigbus_handler()
in cpus.c.

-- PMM

reply via email to

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