From: Ian Campbell Subject: Re: [PATCH v4 1/7] xen/arm: introduce early_ioremap Date: Thu, 10 Jan 2013 15:48:25 +0000 Message-ID: <1357832905.9456.50.camel@zakaz.uk.xensource.com> References: <1357675408-27949-1-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1357675408-27949-1-git-send-email-stefano.stabellini@eu.citrix.com> 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.xensource.com" , "Tim (Xen.org)" List-Id: xen-devel@lists.xenproject.org On Tue, 2013-01-08 at 20:03 +0000, Stefano Stabellini wrote: > Introduce a function to map a range of physical memory into Xen virtual > memory. > It doesn't need domheap to be setup. > It is going to be used to map the videoram. > > Add flush_xen_data_tlb_range_va, that flushes a range of virtual addresses. > Replace all the calls to flush_xen_data_tlb_va with calls to > flush_xen_data_tlb_range_va and remove flush_xen_data_tlb_va. > > In the case of the dest_va tlb flush at the beginning of > setup_pagetables, flush the entire 2MB mapping rather than just the > first 4K. > > > Changes in v4: > - rename flush_xen_data_tlb_range to flush_xen_data_tlb_range_va; > - replace all the calls to flush_xen_data_tlb_va, with calls to > flush_xen_data_tlb_range_va; > - flush the entire 2MB mapping at BOOT_MISC_VIRT_START rather than just > the first 4k; > - remove flush_xen_data_tlb_va; These all seem like a separate patch (or patches) to me. > - fix indentation; > - rename EARLY_VMAP_START/END to EARLY_VMAP_VIRT_START/END; > - mark early_ioremap as __init; > - reduce the amount of casts in early_ioremap. [...] > /* > - * Flush one VA's hypervisor mappings from the data TLB. This is not > + * Flush a range of VA's hypervisor mappings from the data TLB. This is not > * sufficient when changing code mappings or for self modifying code. > */ > -static inline void flush_xen_data_tlb_va(unsigned long va) > +static inline void flush_xen_data_tlb_range_va(unsigned long va, unsigned long size) > { > - asm volatile("dsb;" /* Ensure preceding are visible */ > - STORE_CP32(0, TLBIMVAH) > - "dsb;" /* Ensure completion of the TLB flush */ > - "isb;" > - : : "r" (va) : "memory"); > + unsigned long end = va + size; > + while ( va < end ) { > + asm volatile("dsb;" /* Ensure preceding are visible */ > + STORE_CP32(0, TLBIMVAH) > + "dsb;" /* Ensure completion of the TLB flush */ > + "isb;" You can hoist all the barriers here to above/below the loop I think. Ian.