kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: rework remove-write-access for a slot
Date: Sun, 06 Jun 2010 19:04:25 +0300	[thread overview]
Message-ID: <4C0BC709.5040307@redhat.com> (raw)
In-Reply-To: <4C08B5D0.6090104@cn.fujitsu.com>

On 06/04/2010 11:14 AM, Lai Jiangshan wrote:
>
>
>> - I thought of a different approach to write protection: write protect
>> the L4 sptes, on write fault add write permission to the L4 spte and
>> write protect the L3 sptes that it points to, etc.  This method can use
>> the slot bitmap to reduce the number of write faults.  However we can
>> reintroduce the slot bitmap if/when we use the method, this shouldn't
>> block the patch.
>>      
> It is very a good approach and it is blazing fast.
>
> I have no time to implement it currently,
> could you update it into the TODO list?
>    

Done.

>>> +static void rmapp_remove_write_access(struct kvm *kvm, unsigned long
>>> *rmapp)
>>> +{
>>> +    u64 *spte = rmap_next(kvm, rmapp, NULL);
>>> +
>>> +    while (spte) {
>>> +        /* avoid RMW */
>>> +        if (is_writable_pte(*spte))
>>> +            *spte&= ~PT_WRITABLE_MASK;
>>>        
>> Must use an atomic operation here to avoid losing dirty or accessed bit.
>>
>>      
> Atomic operation is too expensive, I retained the comment "/* avoid RMW */"
> and wait someone take a good approach for it.
>    

You are right, it is an existing problem.  I just posted a patchset 
which fixes the problem, when it's merged please rebase on top.

-- 
error compiling committee.c: too many arguments to function

      parent reply	other threads:[~2010-06-06 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-02  8:53 [PATCH] kvm: rework remove-write-access for a slot Lai Jiangshan
2010-06-02 11:18 ` Avi Kivity
2010-06-04  8:14   ` Lai Jiangshan
2010-06-04 15:18     ` Marcelo Tosatti
2010-06-06 16:04     ` Avi Kivity [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C0BC709.5040307@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).