]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86/xen: Use gfn_to_pfn_cache for vcpu_info
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 9 Feb 2022 13:17:57 +0000 (13:17 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 24 Feb 2022 10:10:05 +0000 (10:10 +0000)
commit5bc7ed2c007657cbeaf6dab5ef8f16972968b79b
treef7fe8156e7f6340d540388db60c7a5b0370aac54
parent111420262dccef94d9b2d9114db86bdbaebf531b
KVM: x86/xen: Use gfn_to_pfn_cache for vcpu_info

Currently, the fast path of kvm_xen_set_evtchn_fast() doesn't set the
index bits in the target vCPU's evtchn_pending_sel, because it only has
a userspace virtual address with which to do so. It just sets them in
the kernel, and kvm_xen_has_interrupt() then completes the delivery to
the actual vcpu_info structure when the vCPU runs.

Using a gfn_to_pfn_cache allows kvm_xen_set_evtchn_fast() to do the full
delivery in the common case.

Clean up the fallback case too, by moving the deferred delivery out into
a separate kvm_xen_inject_pending_events() function which isn't ever
called in atomic contexts as __kvm_xen_has_interrupt() is.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c
arch/x86/kvm/xen.c
arch/x86/kvm/xen.h