From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [PATCH v7 02/10] KVM: MMU: abstract spte write-protect Date: Wed, 20 Jun 2012 21:56:53 +0900 Message-ID: <20120620215653.15930f3467bc13748d548b0d@gmail.com> References: <4FE1822D.8010002@linux.vnet.ibm.com> <4FE1825B.1030402@linux.vnet.ibm.com> <20120620180254.8b3a42f8.yoshikawa.takuya@oss.ntt.co.jp> <4FE193AA.8010801@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , Avi Kivity , Marcelo Tosatti , LKML , KVM To: Xiao Guangrong Return-path: In-Reply-To: <4FE193AA.8010801@linux.vnet.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, 20 Jun 2012 17:11:06 +0800 Xiao Guangrong wrote: > Strange! Why do you think it is wrong? It is just debug code. kvm_mmu_slot_remove_write_access() does not use rmap but the debug code says: rmap_printk("rmap_write_protect: spte %p %llx\n", sptep, *sptep); > > If you think it is not a problem, please explain why you think so in > > the changelog. > > > It is a from the first place and it is used to debug and not compiled at all. It was not in kvm_mmu_slot_remove_write_access() before, no? This patch says that the write protection code becomes commonly usable function, but it still has rmap_write_protect specific debug code in it; using it in kvm_mmu_slot_remove_write_access(), which is not at all related to rmap_write_protect, is strange. As you say, this is just debug code and does not have any practical problem. But randomly putting debug code is not a good thing. Thanks, Takuya