aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Munsie <imunsie@au1.ibm.com>2014-10-08 04:55:00 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2014-10-08 05:15:55 -0400
commit4c6d9acce1f4ca815881f0e3adca192795eca1c5 (patch)
tree0dc40c132dc85d1d05fe4d111739543df7622004
parent09521736011e83003ca3cf7d9a31c43148306a20 (diff)
powerpc/mm: Add hooks for cxl
This adds hooks into the core powerpc mm code for cxl. The core powerpc code sometimes uses local tlbie. Unfortunately this won't work with the current cxl driver as it relies on snooping tlbie broadcasts. The cxl hardware can have TLB entries invalidated via MMIO but this is not currently supported by the driver. In future we can make local tlbie smarter so that it invalidates cxl contexts via MMIO when it needs to but for now we have this workaround. This workaround checks for any active cxl contexts and if so, disables local tlbie. This also adds a hook for when SLBs are invalidated. This ensures any corresponding SLBs in cxl are also invalidated at the same time. This is required for segment demotion. Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/mm/copro_fault.c2
-rw-r--r--arch/powerpc/mm/hash_native_64.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c
index f2aa5a81ad9c..0f9939e693df 100644
--- a/arch/powerpc/mm/copro_fault.c
+++ b/arch/powerpc/mm/copro_fault.c
@@ -26,6 +26,7 @@
26#include <asm/reg.h> 26#include <asm/reg.h>
27#include <asm/copro.h> 27#include <asm/copro.h>
28#include <asm/spu.h> 28#include <asm/spu.h>
29#include <misc/cxl.h>
29 30
30/* 31/*
31 * This ought to be kept in sync with the powerpc specific do_page_fault 32 * This ought to be kept in sync with the powerpc specific do_page_fault
@@ -143,5 +144,6 @@ void copro_flush_all_slbs(struct mm_struct *mm)
143#ifdef CONFIG_SPU_BASE 144#ifdef CONFIG_SPU_BASE
144 spu_flush_all_slbs(mm); 145 spu_flush_all_slbs(mm);
145#endif 146#endif
147 cxl_slbia(mm);
146} 148}
147EXPORT_SYMBOL_GPL(copro_flush_all_slbs); 149EXPORT_SYMBOL_GPL(copro_flush_all_slbs);
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index afc0a8295f84..ae4962a06476 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -29,6 +29,8 @@
29#include <asm/kexec.h> 29#include <asm/kexec.h>
30#include <asm/ppc-opcode.h> 30#include <asm/ppc-opcode.h>
31 31
32#include <misc/cxl.h>
33
32#ifdef DEBUG_LOW 34#ifdef DEBUG_LOW
33#define DBG_LOW(fmt...) udbg_printf(fmt) 35#define DBG_LOW(fmt...) udbg_printf(fmt)
34#else 36#else
@@ -149,9 +151,11 @@ static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize)
149static inline void tlbie(unsigned long vpn, int psize, int apsize, 151static inline void tlbie(unsigned long vpn, int psize, int apsize,
150 int ssize, int local) 152 int ssize, int local)
151{ 153{
152 unsigned int use_local = local && mmu_has_feature(MMU_FTR_TLBIEL); 154 unsigned int use_local;
153 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE); 155 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE);
154 156
157 use_local = local && mmu_has_feature(MMU_FTR_TLBIEL) && !cxl_ctx_in_use();
158
155 if (use_local) 159 if (use_local)
156 use_local = mmu_psize_defs[psize].tlbiel; 160 use_local = mmu_psize_defs[psize].tlbiel;
157 if (lock_tlbie && !use_local) 161 if (lock_tlbie && !use_local)