diff options
author | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2022-03-03 15:41:26 +0000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-02 05:41:17 -0400 |
commit | 1a65105a5aba9f7c6ea68cf687e569d055a94685 (patch) | |
tree | 1567c60b602208d83bd54d4c8899fe83590615f7 /arch/x86/include/asm/kvm_host.h | |
parent | 661a20fab7d156cf6b9a407c946a1e558a633151 (diff) | |
download | lwn-1a65105a5aba9f7c6ea68cf687e569d055a94685.tar.gz lwn-1a65105a5aba9f7c6ea68cf687e569d055a94685.zip |
KVM: x86/xen: handle PV spinlocks slowpath
Add support for SCHEDOP_poll hypercall.
This implementation is optimized for polling for a single channel, which
is what Linux does. Polling for multiple channels is not especially
efficient (and has not been tested).
PV spinlocks slow path uses this hypercall, and explicitly crash if it's
not supported.
[ dwmw2: Rework to use kvm_vcpu_halt(), not supported for 32-bit guests ]
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220303154127.202856-17-dwmw2@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_host.h')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 998caf7a3ce9..5370744b789c 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -619,6 +619,8 @@ struct kvm_vcpu_xen { u64 timer_expires; /* In guest epoch */ atomic_t timer_pending; struct hrtimer timer; + int poll_evtchn; + struct timer_list poll_timer; }; struct kvm_vcpu_arch { @@ -1032,6 +1034,7 @@ struct kvm_xen { u8 upcall_vector; struct gfn_to_pfn_cache shinfo_cache; struct idr evtchn_ports; + unsigned long poll_mask[BITS_TO_LONGS(KVM_MAX_VCPUS)]; }; enum kvm_irqchip_mode { |