All of lore.kernel.org
 help / color / mirror / Atom feed
From: Izik Eidus <ieidus@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] kvm: add SPTE_HOST_WRITEABLE flag to the shadow	ptes.
Date: Thu, 09 Apr 2009 15:58:41 +0300	[thread overview]
Message-ID: <49DDF101.4010005@redhat.com> (raw)
In-Reply-To: <20090409095949.GB31724@amt.cnet>

Marcelo Tosatti wrote:
> On Tue, Mar 31, 2009 at 03:00:03AM +0300, Izik Eidus wrote:
>   
>> this flag notify that the host physical page we are pointing to from
>> the spte is write protected, and therefore we cant change its access
>> to be write unless we run get_user_pages(write = 1).
>>
>> (this is needed for change_pte support in kvm)
>>
>> Signed-off-by: Izik Eidus <ieidus@redhat.com>
>>     
>
>   
>> @@ -547,6 +551,7 @@ static void FNAME(prefetch_page)(struct kvm_vcpu *vcpu,
>>  static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
>>  {
>>  	int i, offset, nr_present;
>> +        bool reset_host_protection = 1;
>>  
>>  	offset = nr_present = 0;
>>  
>> @@ -584,9 +589,14 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
>>  
>>  		nr_present++;
>>  		pte_access = sp->role.access & FNAME(gpte_access)(vcpu, gpte);
>> +		if (!(sp->spt[i] & SPTE_HOST_WRITEABLE)) {
>> +			pte_access &= ~PT_WRITABLE_MASK;
>> +                        reset_host_protection = 0;
>> +              }
>>     
>
>                  else
>                           reset_host_protection = 1;
>                 
> Otherwise you clear SPTE_HOST_WRITEABLE for all sptes once you find a
> single one thats unset.
>
> Also mind the tabs.
>   
Yes, you are right wont work too effective ;-)


Anyway i will repost it as soon as we decide about PATCH 1/ 3 (the 
#IFDEF thing)

Thank Marcelo :-)

  reply	other threads:[~2009-04-09 12:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31  0:00 [PATCH 0/3] kvm support for ksm Izik Eidus
2009-03-31  0:00 ` Izik Eidus
2009-03-31  0:00 ` [PATCH 1/3] kvm: dont hold pagecount reference for mapped sptes pages Izik Eidus
2009-03-31  0:00   ` Izik Eidus
2009-03-31  0:00   ` [PATCH 2/3] kvm: add SPTE_HOST_WRITEABLE flag to the shadow ptes Izik Eidus
2009-03-31  0:00     ` Izik Eidus
2009-03-31  0:00     ` [PATCH 3/3] kvm: add support for change_pte mmu notifiers Izik Eidus
2009-03-31  0:00       ` Izik Eidus
2009-04-09  9:59     ` [PATCH 2/3] kvm: add SPTE_HOST_WRITEABLE flag to the shadow ptes Marcelo Tosatti
2009-04-09 12:58       ` Izik Eidus [this message]
2009-04-09  9:54   ` [PATCH 1/3] kvm: dont hold pagecount reference for mapped sptes pages Marcelo Tosatti
2009-04-09 12:52     ` Izik Eidus
2009-04-12  9:01       ` Izik Eidus
2009-04-12  9:42         ` Avi Kivity
2022-10-18  3:19 ` [PATCH 0/3] kvm support for ksm ewandevelop
2022-10-18  3:31 ` ewandevelop

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=49DDF101.4010005@redhat.com \
    --to=ieidus@redhat.com \
    --cc=kvm@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.