From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roedel, Joerg" Subject: Re: [PATCH 2/3] KVM: MMU: Introduce a helper to read guest pte Date: Wed, 20 Apr 2011 13:06:31 +0200 Message-ID: <20110420110630.GZ2192@amd.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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Takuya Yoshikawa , "mtosatti@redhat.com" , "kvm@vger.kernel.org" , "yoshikawa.takuya@oss.ntt.co.jp" To: Avi Kivity Return-path: Received: from am1ehsobe001.messaging.microsoft.com ([213.199.154.204]:38312 "EHLO AM1EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753815Ab1DTLHR (ORCPT ); Wed, 20 Apr 2011 07:07:17 -0400 Content-Disposition: inline In-Reply-To: <4DAEAFD4.1050609@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. The cmpxchg_gpte function treats all table_gfns as l1-gfns. I'll send a fix soon. Regards, Joerg -- AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632