From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753840AbcBWOQc (ORCPT ); Tue, 23 Feb 2016 09:16:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42985 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401AbcBWOQa (ORCPT ); Tue, 23 Feb 2016 09:16:30 -0500 Subject: Re: [PATCH v3 07/11] KVM: page track: add notifier support To: Xiao Guangrong References: <1455449503-20993-1-git-send-email-guangrong.xiao@linux.intel.com> <1455449503-20993-8-git-send-email-guangrong.xiao@linux.intel.com> <56C701DC.40904@redhat.com> <56CBE14C.1060305@linux.intel.com> Cc: gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kai.huang@linux.intel.com, jike.song@intel.com From: Paolo Bonzini Message-ID: <56CC69B9.3050005@redhat.com> Date: Tue, 23 Feb 2016 15:16:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56CBE14C.1060305@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/02/2016 05:34, Xiao Guangrong wrote: >> >> A kvm_vcpu_mark_page_dirty is missing here, isn't it? I can take care >> of it, but it would be great if you double-checked this. If so, that >> should be fixed in stable kernels too. > > No. It's already been handled in emulator_write_phys() -> > kvm_vcpu_write_guest() > -> kvm_vcpu_write_guest_page() -> __kvm_write_guest_page(). You're right... >> >> Can you add a kvm_vcpu_note_page_write(vcpu, gpa, val, bytes) function >> that takes care of calling kvm_vcpu_mark_page_dirty, kvm_mmu_pte_write >> and kvm_page_track-write? >> > > After this patchset, kvm_mmu_pte_write is only a static notifier > callback called > by kvm_page_track_write(). > > And the dirty tracking in emulator_write_phys() is handled in a public > API (as my > explanation above), in emulator_cmpxchg_emulated is handled by itself. > So i think > it is better to leaving dirty tracking to the separate paths, no? :) ... and here it is indeed better to leave things as they are in v3. Thanks, Paolo