Commit 12e86f92 authored by Paul Mackerras's avatar Paul Mackerras

[POWERPC] Only use H_BULK_REMOVE if the firmware supports it

The previous patch changing pSeries to use H_BULK_REMOVE broke the
JS20 blade, where the firmware doesn't support H_BULK_REMOVE.  This
adds a firmware check so that on machines that don't have H_BULK_REMOVE,
we just use the H_REMOVE call as before.
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent f03e64f2
...@@ -59,6 +59,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = { ...@@ -59,6 +59,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {
{FW_FEATURE_XDABR, "hcall-xdabr"}, {FW_FEATURE_XDABR, "hcall-xdabr"},
{FW_FEATURE_MULTITCE, "hcall-multi-tce"}, {FW_FEATURE_MULTITCE, "hcall-multi-tce"},
{FW_FEATURE_SPLPAR, "hcall-splpar"}, {FW_FEATURE_SPLPAR, "hcall-splpar"},
{FW_FEATURE_BULK_REMOVE, "hcall-bulk"},
}; };
/* Build up the firmware features bitmask using the contents of /* Build up the firmware features bitmask using the contents of
......
...@@ -516,7 +516,7 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, ...@@ -516,7 +516,7 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
static void pSeries_lpar_flush_hash_range(unsigned long number, int local) static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
{ {
unsigned long i, pix, rc; unsigned long i, pix, rc;
unsigned long flags; unsigned long flags = 0;
struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
unsigned long param[9]; unsigned long param[9];
...@@ -540,8 +540,13 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local) ...@@ -540,8 +540,13 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
hash = ~hash; hash = ~hash;
slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
slot += hidx & _PTEIDX_GROUP_IX; slot += hidx & _PTEIDX_GROUP_IX;
if (!firmware_has_feature(FW_FEATURE_BULK_REMOVE)) {
pSeries_lpar_hpte_invalidate(slot, va, psize,
local);
} else {
param[pix] = HBR_REQUEST | HBR_AVPN | slot; param[pix] = HBR_REQUEST | HBR_AVPN | slot;
param[pix+1] = hpte_encode_v(va, psize) & HPTE_V_AVPN; param[pix+1] = hpte_encode_v(va, psize) &
HPTE_V_AVPN;
pix += 2; pix += 2;
if (pix == 8) { if (pix == 8) {
rc = plpar_hcall9(H_BULK_REMOVE, param, rc = plpar_hcall9(H_BULK_REMOVE, param,
...@@ -551,6 +556,7 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local) ...@@ -551,6 +556,7 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
BUG_ON(rc != H_SUCCESS); BUG_ON(rc != H_SUCCESS);
pix = 0; pix = 0;
} }
}
} pte_iterate_hashed_end(); } pte_iterate_hashed_end();
} }
if (pix) { if (pix) {
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000) #define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000)
#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000) #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000)
#define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000) #define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000)
#define FW_FEATURE_BULK_REMOVE ASM_CONST(0x0000000002000000)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment