public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: changbin.du@intel.com
To: pbonzini@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com
Cc: x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Changbin Du <changbin.du@hotmail.com>,
	Changbin Du <changbin.du@intel.com>
Subject: [PATCH] kvm: x86: Do not handle MMIO request in fast_page_fault
Date: Tue,  5 Sep 2017 17:29:41 +0800	[thread overview]
Message-ID: <1504603781-9048-1-git-send-email-changbin.du@intel.com> (raw)

From: Changbin Du <changbin.du@hotmail.com>

If it is a MMIO request, it should be handled by slow path. This patch
actually fixed below warning when mmu debug is enabled.

WARNING: CPU: 5 PID: 2282 at arch/x86/kvm/mmu.c:226 fast_page_fault+0x41b/0x520
CPU: 5 PID: 2282 Comm: qemu-system-x86 Not tainted 4.13.0-rc6+ #34
task: ffff9b47f5286000 task.stack: ffffb18d03b28000
RIP: 0010:fast_page_fault+0x41b/0x520
Call Trace:
  tdp_page_fault+0xfb/0x290
  kvm_mmu_page_fault+0x61/0x120
  handle_ept_misconfig+0x1ba/0x1c0
  vmx_handle_exit+0xb8/0xd70
  ? kvm_arch_vcpu_ioctl_run+0x9b6/0x18e0
  kvm_arch_vcpu_ioctl_run+0xa5a/0x18e0
  ? kvm_arch_vcpu_load+0x62/0x230
  kvm_vcpu_ioctl+0x340/0x6c0
  ? kvm_vcpu_ioctl+0x340/0x6c0
  ? lock_acquire+0xf5/0x1f0
  do_vfs_ioctl+0xa2/0x670
  ? __fget+0x107/0x200
  SyS_ioctl+0x79/0x90
  entry_SYSCALL_64_fastpath+0x23/0xc2

Signed-off-by: Changbin Du <changbin.du@hotmail.com>
Signed-off-by: Changbin Du <changbin.du@intel.com>
---
 arch/x86/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 9d3f275..d6b2b27 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3201,7 +3201,7 @@ static bool fast_page_fault(struct kvm_vcpu *vcpu, gva_t gva, int level,
 
 		new_spte = spte;
 
-		if (is_access_track_spte(spte))
+		if (!is_mmio_spte(spte) && is_access_track_spte(spte))
 			new_spte = restore_acc_track_spte(new_spte);
 
 		/*
-- 
2.7.4

             reply	other threads:[~2017-09-05  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05  9:29 changbin.du [this message]
2017-09-05 10:37 ` [PATCH] kvm: x86: Do not handle MMIO request in fast_page_fault Du, Changbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1504603781-9048-1-git-send-email-changbin.du@intel.com \
    --to=changbin.du@intel.com \
    --cc=changbin.du@hotmail.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox