Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750935AbdIEKnU (ORCPT ); Tue, 5 Sep 2017 06:43:20 -0400 Received: from mga04.intel.com ([192.55.52.120]:22598 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750738AbdIEKnS (ORCPT ); Tue, 5 Sep 2017 06:43:18 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,479,1498546800"; d="asc'?scan'208";a="1191649887" Date: Tue, 5 Sep 2017 18:37:15 +0800 From: "Du, Changbin" To: changbin.du@intel.com Cc: pbonzini@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Changbin Du Subject: Re: [PATCH] kvm: x86: Do not handle MMIO request in fast_page_fault Message-ID: <20170905103715.GA8031@intel.com> References: <1504603781-9048-1-git-send-email-changbin.du@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <1504603781-9048-1-git-send-email-changbin.du@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2452 Lines: 79 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Sorry, messed up. This is not the correct one, will resend. thx. On Tue, Sep 05, 2017 at 05:29:41PM +0800, changbin.du@intel.com wrote: > From: Changbin Du >=20 > If it is a MMIO request, it should be handled by slow path. This patch > actually fixed below warning when mmu debug is enabled. >=20 > 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 >=20 > Signed-off-by: Changbin Du > Signed-off-by: Changbin Du > --- > arch/x86/kvm/mmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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, > =20 > new_spte =3D spte; > =20 > - if (is_access_track_spte(spte)) > + if (!is_mmio_spte(spte) && is_access_track_spte(spte)) > new_spte =3D restore_acc_track_spte(new_spte); > =20 > /* > --=20 > 2.7.4 >=20 --=20 Thanks, Changbin Du --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJZrn5bAAoJEAanuZwLnPNUKY4IAIgvV7Wt4zEBkacfQVOh3v84 BtSoXyPvjADFkqZui7wAD1bLS0zh5BEXx0hk5eW65/OhMVUCcEfqtU2pb/vtEDO1 PJC0WWaop/4oz+twKxOJi90LT5Rc9Rx5wNfuJi0P4iAA+jr3WibIwZ9fqxKRl/D3 stzEFU4I5YNwU5Op+Ok3XeBXEgh9JKW+Il5dbHCycfvJFqzgFjvGkGeJ3G7VKp9x Vbu3C2jxfwdyQ5u8RunxW4FaVNrl5iMKsrArFnO5SiubQo8s40d3n8qW0049KNkM lFi7PuQwzAxBYuaGbMVmaSRXKK7tLzcQWj8VMLqDoNuXBgRP9uI4c5PZqJ5qi64= =g9Uq -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0--