From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH 4/4] KVM: MMU: cleanup update_pte, pte_prefetch and sync_page functions Date: Wed, 17 Nov 2010 09:58:20 +0800 Message-ID: <4CE336BC.4070905@cn.fujitsu.com> References: <4CDD173E.8010706@cn.fujitsu.com> <4CDD187A.9010609@cn.fujitsu.com> <20101116205223.GB24156@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , LKML , KVM To: Marcelo Tosatti Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:58394 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S932215Ab0KQByC (ORCPT ); Tue, 16 Nov 2010 20:54:02 -0500 In-Reply-To: <20101116205223.GB24156@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 11/17/2010 04:52 AM, Marcelo Tosatti wrote: >> + else >> + mmu_set_spte(vcpu, spte, sp->role.access, pte_access, 0, 0, >> + dirty, NULL, PT_PAGE_TABLE_LEVEL, gfn, >> + pfn, true, host_writeable); > > For example, the update path should always go through mmu_set_spte to > update last_pte_updated, last_pte_gfn. > Actually, the set_spte() just works for sync path ;-) > Also the callbacks make it harder to read the code. Maybe the > unification works if you use common functions for common parts. > Um. your advice is reasonable, i'll improve it. Thanks.