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

powerpc/pseries/mm: Improve error reporting on HCALL failures

This patch adds error reporting to H_ENTER and H_READ hcalls. A
failure for both these hcalls are mostly fatal and it would be good to
log the failure reason.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
[mpe: Split out of larger patch]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Aneesh Kumar K.V and committed by
Michael Ellerman
ca42d8d2 65471d76

+10 -6
+10 -6
arch/powerpc/platforms/pseries/lpar.c
··· 166 166 167 167 lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot); 168 168 if (unlikely(lpar_rc == H_PTEG_FULL)) { 169 - if (!(vflags & HPTE_V_BOLTED)) 170 - pr_devel(" full\n"); 169 + pr_devel("Hash table group is full\n"); 171 170 return -1; 172 171 } 173 172 ··· 176 177 * or we will loop forever, so return -2 in this case. 177 178 */ 178 179 if (unlikely(lpar_rc != H_SUCCESS)) { 179 - if (!(vflags & HPTE_V_BOLTED)) 180 - pr_devel(" lpar err %ld\n", lpar_rc); 180 + pr_err("Failed hash pte insert with error %ld\n", lpar_rc); 181 181 return -2; 182 182 } 183 183 if (!(vflags & HPTE_V_BOLTED)) ··· 239 241 */ 240 242 for (i = 0; i < hpte_count; i += 4) { 241 243 lpar_rc = plpar_pte_read_4_raw(0, i, (void *)ptes); 242 - if (lpar_rc != H_SUCCESS) 244 + if (lpar_rc != H_SUCCESS) { 245 + pr_info("Failed to read hash page table at %ld err %ld\n", 246 + i, lpar_rc); 243 247 continue; 248 + } 244 249 for (j = 0; j < 4; j++){ 245 250 if ((ptes[j].pteh & HPTE_V_VRMA_MASK) == 246 251 HPTE_V_VRMA_MASK) ··· 342 341 for (i = 0; i < HPTES_PER_GROUP; i += 4, hpte_group += 4) { 343 342 344 343 lpar_rc = plpar_pte_read_4(0, hpte_group, (void *)ptes); 345 - if (lpar_rc != H_SUCCESS) 344 + if (lpar_rc != H_SUCCESS) { 345 + pr_info("Failed to read hash page table at %ld err %ld\n", 346 + hpte_group, lpar_rc); 346 347 continue; 348 + } 347 349 348 350 for (j = 0; j < 4; j++) { 349 351 if (HPTE_V_COMPARE(ptes[j].pteh, want_v) &&