From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: [PATCH v4 4/6] arm: implement flush_tlb_all_local and flush_tlb_local Date: Fri, 25 May 2012 17:23:12 +0100 Message-ID: <1337962994-23573-4-git-send-email-stefano.stabellini@eu.citrix.com> References: 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: xen-devel@lists.xensource.com Cc: Tim.Deegan@citrix.com, Stefano Stabellini , Ian.Campbell@citrix.com, david.vrabel@citrix.com List-Id: xen-devel@lists.xenproject.org Call flush_tlb_all_local from create_p2m_entries after removing a page from the p2m. Signed-off-by: Stefano Stabellini --- xen/arch/arm/p2m.c | 2 ++ xen/include/asm-arm/flushtlb.h | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 4c94ef0..051a0e8 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -3,6 +3,7 @@ #include #include #include +#include void p2m_load_VTTBR(struct domain *d) { @@ -123,6 +124,7 @@ static int create_p2m_entries(struct domain *d, /* p2m entry already present */ free_domheap_page( mfn_to_page(third[third_table_offset(addr)].p2m.base)); + flush_tlb_all_local(); } /* Allocate a new RAM page and attach */ diff --git a/xen/include/asm-arm/flushtlb.h b/xen/include/asm-arm/flushtlb.h index c8486fc..210abfa 100644 --- a/xen/include/asm-arm/flushtlb.h +++ b/xen/include/asm-arm/flushtlb.h @@ -14,8 +14,27 @@ do { \ #define tlbflush_current_time() (0) -/* Flush local TLBs */ -void flush_tlb_local(void); +/* Flush local TLBs, current VMID only */ +static inline void flush_tlb_local(void) +{ + dsb(); + + WRITE_CP32((uint32_t) 0, TLBIALLIS); + + dsb(); + isb(); +} + +/* Flush local TLBs, all VMIDs, non-hypervisor mode */ +static inline void flush_tlb_all_local(void) +{ + dsb(); + + WRITE_CP32((uint32_t) 0, TLBIALLNSNHIS); + + dsb(); + isb(); +} /* Flush specified CPUs' TLBs */ void flush_tlb_mask(const cpumask_t *mask); -- 1.7.2.5