[SLOF] [PATCH] broken_sc1: handle H_UNSUPPORTED as well

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Mon Apr 2 19:53:12 AEST 2018


Recently, found that when DAWR was disabled by linux kernel, the hcall started
returning H_UNSUPPORTED, and VM did not boot up as broken_sc1 patched up SC
calls falsely. Make sure we handle H_UNSUPPORTED as well.

CC: Michael Ellerman <michael at ellerman.id.au>
CC: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
---
 lib/libhvcall/brokensc1.c | 2 +-
 lib/libhvcall/libhvcall.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/libhvcall/brokensc1.c b/lib/libhvcall/brokensc1.c
index e6387e0..163ee30 100644
--- a/lib/libhvcall/brokensc1.c
+++ b/lib/libhvcall/brokensc1.c
@@ -47,7 +47,7 @@ static int check_broken_sc1(void)
 	 * supervisor mode.
 	 */
 	r = hcall(INS_SC1, H_SET_DABR, 0);
-	if (r == H_SUCCESS || r == H_HARDWARE) {
+	if (r == H_SUCCESS || r == H_HARDWARE || r == H_UNSUPPORTED) {
 		/* All is fine */
 		return 0;
 	}
diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h
index 3fa4398..1ef320e 100644
--- a/lib/libhvcall/libhvcall.h
+++ b/lib/libhvcall/libhvcall.h
@@ -3,6 +3,7 @@
 
 #define H_SUCCESS		0
 #define H_HARDWARE		-1
+#define H_UNSUPPORTED           -67
 
 #define H_GET_TCE		0x1C
 #define H_PUT_TCE		0x20
-- 
2.14.3



More information about the SLOF mailing list