Commit 66af4f5c authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov Committed by Paolo Bonzini

x86/kvm: Update the comment about asynchronous page fault in exc_page_fault()

KVM was switched to interrupt-based mechanism for 'page ready' event
delivery in Linux-5.8 (see commit 2635b5c4 ("KVM: x86: interrupt based
APF 'page ready' event delivery")) and #PF (ab)use for 'page ready' event
delivery was removed. Linux guest switched to this new mechanism
exclusively in 5.9 (see commit b1d40575 ("KVM: x86: Switch KVM guest to
using interrupts for page ready APF delivery")) so it is not possible to
get #PF for a 'page ready' event even when the guest is running on top
of an older KVM (APF mechanism won't be enabled). Update the comment in
exc_page_fault() to reflect the new reality.
Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20201002154313.1505327-1-vkuznets@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 8f116a6c
...@@ -1446,11 +1446,14 @@ DEFINE_IDTENTRY_RAW_ERRORCODE(exc_page_fault) ...@@ -1446,11 +1446,14 @@ DEFINE_IDTENTRY_RAW_ERRORCODE(exc_page_fault)
prefetchw(&current->mm->mmap_lock); prefetchw(&current->mm->mmap_lock);
/* /*
* KVM has two types of events that are, logically, interrupts, but * KVM uses #PF vector to deliver 'page not present' events to guests
* are unfortunately delivered using the #PF vector. These events are * (asynchronous page fault mechanism). The event happens when a
* "you just accessed valid memory, but the host doesn't have it right * userspace task is trying to access some valid (from guest's point of
* now, so I'll put you to sleep if you continue" and "that memory * view) memory which is not currently mapped by the host (e.g. the
* you tried to access earlier is available now." * memory is swapped out). Note, the corresponding "page ready" event
* which is injected when the memory becomes available, is delived via
* an interrupt mechanism and not a #PF exception
* (see arch/x86/kernel/kvm.c: sysvec_kvm_asyncpf_interrupt()).
* *
* We are relying on the interrupted context being sane (valid RSP, * We are relying on the interrupted context being sane (valid RSP,
* relevant locks not held, etc.), which is fine as long as the * relevant locks not held, etc.), which is fine as long as the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment