[RFC PATCH 14/17] powerpc/mm/pseries: Use HASH_PROTECT hcall in guest
Aneesh Kumar K.V
aneesh.kumar at linux.vnet.ibm.com
Wed Aug 2 15:40:13 AEST 2017
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/lpar.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index e28e62f6afba..bfab61d17f6d 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -388,15 +388,20 @@ static long pSeries_lpar_hash_updatepp(unsigned long hash,
unsigned long want_v;
want_v = hpte_encode_avpn(vpn, psize, ssize);
-
pr_devel(" update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...",
want_v, hash, flags, psize);
+ if (firmware_has_feature(FW_FEATURE_HASH_API)) {
+ lpar_rc = plpar_pte_hash_protect(flags, hash, want_v);
+ goto err_out;
+ }
slot = __pSeries_lpar_hpte_find(hash, want_v);
if (slot < 0)
return -1;
lpar_rc = plpar_pte_protect(flags, slot, want_v);
+
+err_out:
if (lpar_rc == H_NOT_FOUND) {
pr_devel("not found !\n");
return -1;
--
2.13.3
More information about the Linuxppc-dev
mailing list