linux_dsm_epyc7002/Documentation/virtual/kvm
Paolo Bonzini 460df4c1fc KVM: race-free exit from KVM_RUN without POSIX signals
The purpose of the KVM_SET_SIGNAL_MASK API is to let userspace "kick"
a VCPU out of KVM_RUN through a POSIX signal.  A signal is attached
to a dummy signal handler; by blocking the signal outside KVM_RUN and
unblocking it inside, this possible race is closed:

          VCPU thread                     service thread
   --------------------------------------------------------------
        check flag
                                          set flag
                                          raise signal
        (signal handler does nothing)
        KVM_RUN

However, one issue with KVM_SET_SIGNAL_MASK is that it has to take
tsk->sighand->siglock on every KVM_RUN.  This lock is often on a
remote NUMA node, because it is on the node of a thread's creator.
Taking this lock can be very expensive if there are many userspace
exits (as is the case for SMP Windows VMs without Hyper-V reference
time counter).

As an alternative, we can put the flag directly in kvm_run so that
KVM can see it:

          VCPU thread                     service thread
   --------------------------------------------------------------
                                          raise signal
        signal handler
          set run->immediate_exit
        KVM_RUN
          check run->immediate_exit

Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-02-17 12:27:37 +01:00
..
arm
devices KVM: arm/arm64: Documentation: Update arm-vgic-v3.txt 2017-01-30 13:47:33 +00:00
00-INDEX KVM: Add halt polling documentation 2016-11-28 11:48:47 +11:00
api.txt KVM: race-free exit from KVM_RUN without POSIX signals 2017-02-17 12:27:37 +01:00
cpuid.txt
halt-polling.txt KVM: Add halt polling documentation 2016-11-28 11:48:47 +11:00
hypercalls.txt KVM: x86: add KVM_HC_CLOCK_PAIRING hypercall 2017-02-07 18:16:45 +01:00
locking.txt kvm: x86: mmu: Update documentation for fast page fault mechanism 2017-01-09 14:46:12 +01:00
mmu.txt
msr.txt Documentation/virtual/kvm: Support the vCPU preemption check 2016-11-22 12:48:09 +01:00
nested-vmx.txt
ppc-pv.txt
review-checklist.txt docs: fix locations of several documents that got moved 2016-10-24 08:12:35 -02:00
s390-diag.txt
timekeeping.txt