[Devel,4/6] Revert "kvm/x86: skip async_pf when in guest mode"

Submitted by Denis Plotnikov on Sept. 20, 2017, 2:31 p.m.

Details

Message ID 1505917865-26405-5-git-send-email-dplotnikov@virtuozzo.com
State New
Series "backporting async_pf injection functionality"
Headers show

Commit Message

Denis Plotnikov Sept. 20, 2017, 2:31 p.m.
This reverts commit 5173f45a28cdf3d5808e236eab882273a760a363.

The commit will be replaced with the mainstream commit which does
the same:
    9bc1f09f6f KVM: async_pf: avoid async pf injection when in guest mode

This is done to make vzkernel look similar to the mainstream kernel with
all the consequences like mitigation of patch backporting.

fix #PSBM-56498

Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com>
---
 arch/x86/kvm/mmu.c | 2 +-
 arch/x86/kvm/x86.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 83584eb..91bc5eb 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3504,7 +3504,7 @@  static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn,
 	if (!async)
 		return false; /* *pfn has correct page already */
 
-	if (!prefault && !is_guest_mode(vcpu) && can_do_async_pf(vcpu)) {
+	if (!prefault && can_do_async_pf(vcpu)) {
 		trace_kvm_try_async_get_page(gva, gfn);
 		if (kvm_find_async_pf_gfn(vcpu, gfn)) {
 			trace_kvm_async_pf_doublefault(gva, gfn);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 66cbb9f..34eccf9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6891,8 +6891,7 @@  static int vcpu_run(struct kvm_vcpu *vcpu)
 			break;
 		}
 
-		if (!is_guest_mode(vcpu))
-			kvm_check_async_pf_completion(vcpu);
+		kvm_check_async_pf_completion(vcpu);
 
 		if (signal_pending(current)) {
 			r = -EINTR;