From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Checking guest memory pages changes from host userspace Date: Mon, 22 Jun 2009 12:48:59 +0300 Message-ID: <4A3F538B.1040607@redhat.com> References: <18C018878FB0244EB71B7FE328978A32679FD52B@rrsmsx503.amr.corp.intel.com> <4A3E5706.9070408@redhat.com> <3574F699-DC93-41EB-9ABC-F246CCE28203@suse.de> <4A3E9186.8020303@redhat.com> <4A3F45C1.4000201@redhat.com> <5BE1911C-4100-46ED-99A5-A57AAB256AA4@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Passera, Pablo R" , "kvm@vger.kernel.org" To: Alexander Graf Return-path: Received: from mx2.redhat.com ([66.187.237.31]:57677 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750780AbZFVJsM (ORCPT ); Mon, 22 Jun 2009 05:48:12 -0400 In-Reply-To: <5BE1911C-4100-46ED-99A5-A57AAB256AA4@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On 06/22/2009 12:42 PM, Alexander Graf wrote: >> Thinking about it a bit more, when we write-protect pages we're >> O(spte) anyway, so that shouldn't be a barrier. > > > Yeah, the current implementation is probably the fastest you'll get. I > didn't want to slow down shadow page setup due to the dirty update, > but I guess compared to the rest of the overhead that doesn't really > weight as much. I didn't explain myself well, I now think using the dirty bits is better. Currently we do the following: 1. sweep all sptes to drop write permissions 2. on write faults, mark the page dirty 3. retrieve the log We could do instead: 1. sweep all sptes to drop the dirty bit 2. on writes, set the dirty bit (the cpu does this) 3. sweep all sptes to read the dirty bit, and return the log Since step 1 occurs after step 3 of the previous iteration, we could merge them, and lose nothing. -- error compiling committee.c: too many arguments to function