From patchwork Fri Jun 17 02:25:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 890152 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5H2TY9l010795 for ; Fri, 17 Jun 2011 02:29:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751420Ab1FQCXi (ORCPT ); Thu, 16 Jun 2011 22:23:38 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:51228 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750829Ab1FQCXh (ORCPT ); Thu, 16 Jun 2011 22:23:37 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 9B3A0170028; Fri, 17 Jun 2011 10:23:34 +0800 (CST) Received: from mailserver.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id p5H2NYA2005395; Fri, 17 Jun 2011 10:23:34 +0800 Received: from localhost.localdomain ([10.167.225.99]) by mailserver.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2011061710231529-596437 ; Fri, 17 Jun 2011 10:23:15 +0800 Message-ID: <4DFABB23.9080808@cn.fujitsu.com> Date: Fri, 17 Jun 2011 10:25:39 +0800 From: Xiao Guangrong User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10 MIME-Version: 1.0 To: bugzilla-daemon@bugzilla.kernel.org CC: kvm@vger.kernel.org, Avi Kivity Subject: Re: [Bug 37262] VNC access to KVM VM is unusable References: <201106162039.p5GKdWxg020197@demeter2.kernel.org> In-Reply-To: <201106162039.p5GKdWxg020197@demeter2.kernel.org> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-06-17 10:23:15, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-06-17 10:23:15, Serialize complete at 2011-06-17 10:23:15 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 17 Jun 2011 02:29:34 +0000 (UTC) On 06/17/2011 04:39 AM, bugzilla-daemon@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=37262 > > > > > > --- Comment #43 from Steve 2011-06-16 20:39:32 --- > Solution of this bug is very simple: > > arch/x86/kvm/mmu.c: > > static bool mapping_level_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t large_gfn) > { > return (gfn_to_memslot_dirty_bitmap(vcpu, large_gfn, true) == NULL) > ? true : false; > } > > Only opposite condition. > Please commit when it's possible. > Yes, it is the reason, thanks for your time and great job, i am so sorry, this is caused by my mistake :-( And this is the fix patch from you and i did little cleanup From: Steve Subject: [PATCH] KVM: MMU: fix opposite condition in mapping_level_dirty_bitmap The condition is opposite, it always maps huge page for the dirty tracked page Reported-by: Steve Signed-off-by: Steve --- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 19ebb76..15afa1e 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -549,7 +549,7 @@ gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn, static bool mapping_level_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t large_gfn) { - return gfn_to_memslot_dirty_bitmap(vcpu, large_gfn, true); + return !gfn_to_memslot_dirty_bitmap(vcpu, large_gfn, true); } static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn)