|
@@ -8,6 +8,8 @@
|
|
#include <linux/mm.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/hugetlb.h>
|
|
#include <linux/hugetlb.h>
|
|
|
|
|
|
|
|
+#include <asm/mmu.h>
|
|
|
|
+
|
|
#ifdef CONFIG_PPC_FSL_BOOK3E
|
|
#ifdef CONFIG_PPC_FSL_BOOK3E
|
|
#ifdef CONFIG_PPC64
|
|
#ifdef CONFIG_PPC64
|
|
static inline int tlb1_next(void)
|
|
static inline int tlb1_next(void)
|
|
@@ -60,6 +62,14 @@ static inline void book3e_tlb_lock(void)
|
|
unsigned long tmp;
|
|
unsigned long tmp;
|
|
int token = smp_processor_id() + 1;
|
|
int token = smp_processor_id() + 1;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Besides being unnecessary in the absence of SMT, this
|
|
|
|
+ * check prevents trying to do lbarx/stbcx. on e5500 which
|
|
|
|
+ * doesn't implement either feature.
|
|
|
|
+ */
|
|
|
|
+ if (!cpu_has_feature(CPU_FTR_SMT))
|
|
|
|
+ return;
|
|
|
|
+
|
|
asm volatile("1: lbarx %0, 0, %1;"
|
|
asm volatile("1: lbarx %0, 0, %1;"
|
|
"cmpwi %0, 0;"
|
|
"cmpwi %0, 0;"
|
|
"bne 2f;"
|
|
"bne 2f;"
|
|
@@ -80,6 +90,9 @@ static inline void book3e_tlb_unlock(void)
|
|
{
|
|
{
|
|
struct paca_struct *paca = get_paca();
|
|
struct paca_struct *paca = get_paca();
|
|
|
|
|
|
|
|
+ if (!cpu_has_feature(CPU_FTR_SMT))
|
|
|
|
+ return;
|
|
|
|
+
|
|
isync();
|
|
isync();
|
|
paca->tcd_ptr->lock = 0;
|
|
paca->tcd_ptr->lock = 0;
|
|
}
|
|
}
|