Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Paul Mackerras <paulus@samba.org>

+16 -8
+1
arch/powerpc/platforms/pseries/firmware.c
··· 59 59 {FW_FEATURE_XDABR, "hcall-xdabr"}, 60 60 {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, 61 61 {FW_FEATURE_SPLPAR, "hcall-splpar"}, 62 + {FW_FEATURE_BULK_REMOVE, "hcall-bulk"}, 62 63 }; 63 64 64 65 /* Build up the firmware features bitmask using the contents of
+14 -8
arch/powerpc/platforms/pseries/lpar.c
··· 516 516 static void pSeries_lpar_flush_hash_range(unsigned long number, int local) 517 517 { 518 518 unsigned long i, pix, rc; 519 - unsigned long flags; 519 + unsigned long flags = 0; 520 520 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 521 521 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); 522 522 unsigned long param[9]; ··· 540 540 hash = ~hash; 541 541 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 542 542 slot += hidx & _PTEIDX_GROUP_IX; 543 - param[pix] = HBR_REQUEST | HBR_AVPN | slot; 544 - param[pix+1] = hpte_encode_v(va, psize) & HPTE_V_AVPN; 545 - pix += 2; 546 - if (pix == 8) { 547 - rc = plpar_hcall9(H_BULK_REMOVE, param, 543 + if (!firmware_has_feature(FW_FEATURE_BULK_REMOVE)) { 544 + pSeries_lpar_hpte_invalidate(slot, va, psize, 545 + local); 546 + } else { 547 + param[pix] = HBR_REQUEST | HBR_AVPN | slot; 548 + param[pix+1] = hpte_encode_v(va, psize) & 549 + HPTE_V_AVPN; 550 + pix += 2; 551 + if (pix == 8) { 552 + rc = plpar_hcall9(H_BULK_REMOVE, param, 548 553 param[0], param[1], param[2], 549 554 param[3], param[4], param[5], 550 555 param[6], param[7]); 551 - BUG_ON(rc != H_SUCCESS); 552 - pix = 0; 556 + BUG_ON(rc != H_SUCCESS); 557 + pix = 0; 558 + } 553 559 } 554 560 } pte_iterate_hashed_end(); 555 561 }
+1
include/asm-powerpc/firmware.h
··· 44 44 #define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000) 45 45 #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000) 46 46 #define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000) 47 + #define FW_FEATURE_BULK_REMOVE ASM_CONST(0x0000000002000000) 47 48 48 49 #ifndef __ASSEMBLY__ 49 50