From mboxrd@z Thu Jan 1 00:00:00 1970 From: Izik Eidus Subject: Re: [PATCH 2/3] add SPTE_HOST_WRITEABLE flag to the shadow ptes Date: Sat, 12 Sep 2009 09:35:59 +0300 Message-ID: <4AAB414F.9070101@redhat.com> References: <1252600738-9456-1-git-send-email-ieidus@redhat.com> <1252600738-9456-2-git-send-email-ieidus@redhat.com> <1252600738-9456-3-git-send-email-ieidus@redhat.com> <20090911211458.GB6244@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: avi@redhat.com, kvm@vger.kernel.org, aarcange@redhat.com To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750754AbZILG1p (ORCPT ); Sat, 12 Sep 2009 02:27:45 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8C6RnaJ016782 for ; Sat, 12 Sep 2009 02:27:49 -0400 In-Reply-To: <20090911211458.GB6244@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > On Thu, Sep 10, 2009 at 07:38:57PM +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 >> --- >> arch/x86/kvm/mmu.c | 15 +++++++++++---- >> arch/x86/kvm/paging_tmpl.h | 18 +++++++++++++++--- >> 2 files changed, 26 insertions(+), 7 deletions(-) >> >> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c >> index 62d2f86..a7151b8 100644 >> --- a/arch/x86/kvm/mmu.c >> +++ b/arch/x86/kvm/mmu.c >> @@ -156,6 +156,8 @@ module_param(oos_shadow, bool, 0644); >> #define CREATE_TRACE_POINTS >> #include "mmutrace.h" >> >> +#define SPTE_HOST_WRITEABLE (1ULL << PT_FIRST_AVAIL_BITS_SHIFT) >> + >> #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) >> >> struct kvm_rmap_desc { >> @@ -1754,7 +1756,7 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep, >> unsigned pte_access, int user_fault, >> int write_fault, int dirty, int level, >> gfn_t gfn, pfn_t pfn, bool speculative, >> - bool can_unsync) >> + bool can_unsync, bool reset_host_protection) >> > bool host_pte_writeable ? > > > Sure.