From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: guest PTE write emulation Date: Tue, 29 May 2007 11:25:25 +0300 Message-ID: <465BE375.20000@qumranet.com> References: <10EA09EFD8728347A513008B6B0DA77A01840ED9@pdsmsx411.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Dong, Eddie" Return-path: In-Reply-To: <10EA09EFD8728347A513008B6B0DA77A01840ED9-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Dong, Eddie wrote: > Not sure if we should use PT_USER_MASK | PT_WRITABLE_MASK here. > > diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h > index 6dd0da9..183d4ca 100644 > --- a/drivers/kvm/paging_tmpl.h > +++ b/drivers/kvm/paging_tmpl.h > @@ -213,7 +213,7 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, > struct > if (~gpte & (PT_PRESENT_MASK | PT_ACCESSED_MASK)) > return; > pgprintk("%s: gpte %llx spte %p\n", __FUNCTION__, (u64)gpte, > spte); > - FNAME(set_pte)(vcpu, gpte, spte, 6, > + FNAME(set_pte)(vcpu, gpte, spte, PT_USER_MASK | > PT_WRITABLE_MASK, > (gpte & PT_BASE_ADDR_MASK) >> PAGE_SHIFT); > } > > > But then it seems we are not correctly emulating gpte ACCESSED bit > though it is likely harmless. Comments? > Earlier we check if the accessed bit is off, and if so, we don't set the shadow pte. This won't happen in practice because the guest's page fault handler will set the accessed bit when it modifies a pte to avoid an RMW cycle by the hardware page table walker. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/