From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [PATCH 07/14] xen: balloon: do not update stage 1 pagetable for autotranslated guests Date: Fri, 5 Oct 2012 12:10:24 -0700 Message-ID: <20121005121024.17c22c7d@mantra.us.oracle.com> References: <1349363496.866.49.camel@zakaz.uk.xensource.com> <1349363515-26190-7-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "xen-devel@lists.xen.org" , Ian Campbell , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Fri, 5 Oct 2012 13:05:01 +0100 Stefano Stabellini wrote: > On Thu, 4 Oct 2012, Ian Campbell wrote: > > This is unnecessary (since the page will be removed from the p2m) > > and can be tricky if the page is in the middle of a superpage, as > > it is on ARM. > > > > I think that this patch is correct. I'll leave to Konrad whether we > should carry the original incorrect PVH patch and this separate fix or > just merge the two of them. > > > > Signed-off-by: Ian Campbell > > --- > > Also effects PVH but in a benign way I think. > > > > drivers/xen/balloon.c | 23 +++-------------------- > > 1 files changed, 3 insertions(+), 20 deletions(-) > > > > diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c > > index 7885a19..1b56ae0 100644 > > --- a/drivers/xen/balloon.c > > +++ b/drivers/xen/balloon.c > > @@ -357,15 +357,7 @@ static enum bp_state > > increase_reservation(unsigned long nr_pages) > > BUG_ON(!xen_feature(XENFEAT_auto_translated_physmap) && > > phys_to_machine_mapping_valid(pfn)); > > - if (xen_pv_domain() && > > - xen_feature(XENFEAT_auto_translated_physmap)) { > > - /* PVH: we just need to update native page > > table */ > > - pte_t *ptep; > > - unsigned int level; > > - void *addr = __va(pfn << PAGE_SHIFT); > > - ptep = lookup_address((unsigned long)addr, > > &level); > > - set_pte(ptep, pfn_pte(pfn, PAGE_KERNEL)); > > - } else > > + if (!xen_feature(XENFEAT_auto_translated_physmap)) > > set_phys_to_machine(pfn, frame_list[i]); > > > > /* Link back into the page tables if not highmem. > > */ @@ -427,21 +419,12 @@ static enum bp_state > > decrease_reservation(unsigned long nr_pages, gfp_t gfp) > > scrub_page(page); > > > > - if (xen_pv_domain() && !PageHighMem(page)) { > > - if > > (xen_feature(XENFEAT_auto_translated_physmap)) { > > - unsigned int level; > > - pte_t *ptep; > > - void *addr = __va(pfn << > > PAGE_SHIFT); > > - ptep = lookup_address((unsigned > > long)addr, > > - &level); > > - set_pte(ptep, __pte(0)); > > - > > - } else { > > + if (xen_pv_domain() && !PageHighMem(page) && > > + !xen_feature(XENFEAT_auto_translated_physmap)) > > { ret = HYPERVISOR_update_va_mapping( > > (unsigned long)__va(pfn << > > PAGE_SHIFT), __pte_ma(0), 0); > > BUG_ON(ret); > > - } > > } > > } > > > > -- > > 1.7.2.5 > > I've made this change in my tree also. So, its good for PVH also. thanks Mukesh