From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/3] KVM: MMU: Introduce a helper to read guest pte Date: Wed, 20 Apr 2011 14:18:12 +0300 Message-ID: <4DAEC0F4.70201@redhat.com> References: <20110419033220.e527bcae.takuya.yoshikawa@gmail.com> <20110419033453.ffa856c9.takuya.yoshikawa@gmail.com> <4DAEA240.9020104@redhat.com> <20110420093515.GX2192@amd.com> <4DAEAFD4.1050609@redhat.com> <20110420110630.GZ2192@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , "mtosatti@redhat.com" , "kvm@vger.kernel.org" , "yoshikawa.takuya@oss.ntt.co.jp" To: "Roedel, Joerg" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:5225 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752509Ab1DTLSU (ORCPT ); Wed, 20 Apr 2011 07:18:20 -0400 In-Reply-To: <20110420110630.GZ2192@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04/20/2011 02:06 PM, Roedel, Joerg wrote: > On Wed, Apr 20, 2011 at 06:05:08AM -0400, Avi Kivity wrote: > > On 04/20/2011 12:35 PM, Roedel, Joerg wrote: > > > > This patch seems only to introduce another wrapper around > > > kvm_read_guest_page_mmu(), so I don't see a problem in this patch. > > > > By patch 3, ptep_user will be computed in this function and no longer > > available for setting the accessed bit later on. > > > > > The kvm_read_guest_page_mmu takes care whether it gets a l1-gfn or > > > l2-gfn (by calling mmu->translate_gpa). > > > > But cmpxchg_gpte() does not. > > You are right, cmpxchg_gpte needs to handle this too. But the bug is not > introduced with this patch-set it was there before. Correct. The reason I don't want the helper, is so we can use ptep_user in both places (not for efficiency, just to make sure it's exactly the same value). > The cmpxchg_gpte function treats all table_gfns as l1-gfns. I'll send a > fix soon. Thanks. -- error compiling committee.c: too many arguments to function