From: Ian Campbell Subject: [PATCH 11/45] xen: arm64: TLB flushes Date: Wed, 23 Jan 2013 15:56:17 +0000 Message-ID: <1358956611-8432-11-git-send-email-ian.campbell@citrix.com> References: <1358956576.17440.60.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1358956576.17440.60.camel@zakaz.uk.xensource.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: xen-devel@lists.xen.org Cc: tim@xen.org, stefano.stabellini@citrix.com, Ian Campbell List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Campbell --- xen/include/asm-arm/arm32/flushtlb.h | 34 ++++++++++++++++++++++++++++++++++ xen/include/asm-arm/arm64/flushtlb.h | 34 ++++++++++++++++++++++++++++++++++ xen/include/asm-arm/flushtlb.h | 34 ++++++++++------------------------ 3 files changed, 78 insertions(+), 24 deletions(-) create mode 100644 xen/include/asm-arm/arm32/flushtlb.h create mode 100644 xen/include/asm-arm/arm64/flushtlb.h diff --git a/xen/include/asm-arm/arm32/flushtlb.h b/xen/include/asm-arm/arm32/flushtlb.h new file mode 100644 index 0000000..3c2d5b6 --- /dev/null +++ b/xen/include/asm-arm/arm32/flushtlb.h @@ -0,0 +1,34 @@ +#ifndef __ASM_ARM_ARM32_FLUSHTLB_H__ +#define __ASM_ARM_ARM32_FLUSHTLB_H__ + +/* 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(); +} + +#endif /* __ASM_ARM_ARM32_FLUSHTLB_H__ */ +/* + * Local variables: + * mode: C + * c-set-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/include/asm-arm/arm64/flushtlb.h b/xen/include/asm-arm/arm64/flushtlb.h new file mode 100644 index 0000000..b9eccba --- /dev/null +++ b/xen/include/asm-arm/arm64/flushtlb.h @@ -0,0 +1,34 @@ +#ifndef __ASM_ARM_ARM64_FLUSHTLB_H__ +#define __ASM_ARM_ARM64_FLUSHTLB_H__ + +/* Flush local TLBs, current VMID only */ +static inline void flush_tlb_local(void) +{ + asm volatile( + "dsb sy;" + "tlbi vmalle1;" /* ,is ??? */ + "dsb sy;" + "isb;" + : : : "memory"); +} + +/* Flush local TLBs, all VMIDs, non-hypervisor mode */ +static inline void flush_tlb_all_local(void) +{ + asm volatile( + "dsb sy;" + "tlbi alle1;" /* ,is ??? */ + "dsb sy;" + "isb;" + : : : "memory"); +} + +#endif /* __ASM_ARM_ARM64_FLUSHTLB_H__ */ +/* + * Local variables: + * mode: C + * c-set-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/include/asm-arm/flushtlb.h b/xen/include/asm-arm/flushtlb.h index 210abfa..e7ce27b 100644 --- a/xen/include/asm-arm/flushtlb.h +++ b/xen/include/asm-arm/flushtlb.h @@ -1,5 +1,5 @@ -#ifndef __FLUSHTLB_H__ -#define __FLUSHTLB_H__ +#ifndef __ASM_ARM_FLUSHTLB_H__ +#define __ASM_ARM_FLUSHTLB_H__ #include @@ -14,32 +14,18 @@ do { \ #define tlbflush_current_time() (0) -/* 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(); -} +#if defined(CONFIG_ARM_32) +# include +#elif defined(CONFIG_ARM_64) +# include +#else +# error "unknown ARM variant" +#endif /* Flush specified CPUs' TLBs */ void flush_tlb_mask(const cpumask_t *mask); -#endif /* __FLUSHTLB_H__ */ +#endif /* __ASM_ARM_FLUSHTLB_H__ */ /* * Local variables: * mode: C -- 1.7.2.5