From b4698b7a6ce21e743ab085c9c8cdf7d2c1f6a21b Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Thu, 2 May 2019 03:39:03 +0000 Subject: [PATCH] powerpc: Drop OPAL_HANDLE_HMI2 for now, to avoid panicking It's possible for a Hypervisor Maintenance Interrupt (HMI) to occur while in the pmap code, holding locks. This can cause WITNESS to panic due to lock errors in calling pmap_kextract(). Since we don't yet handle the flags returned by OPAL_HANDLE_HMI2, just stop using it, so that we don't call into pmap_kextract(). Reported by: pkubaj --- sys/powerpc/powernv/opal_hmi.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/sys/powerpc/powernv/opal_hmi.c b/sys/powerpc/powernv/opal_hmi.c index 5610580257c6..e811a23d30bb 100644 --- a/sys/powerpc/powernv/opal_hmi.c +++ b/sys/powerpc/powernv/opal_hmi.c @@ -38,25 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include "opal.h" -static int -opal_hmi_handler2(struct trapframe *frame) -{ - int64_t flags; - int err; - - err = opal_call(OPAL_HANDLE_HMI2, vtophys(&flags)); - - /* XXX: At some point, handle the flags outvar. */ - if (err == OPAL_SUCCESS) { - mtspr(SPR_HMER, 0); - return (0); - } - - printf("HMI handler failed! OPAL error code: %d\n", err); - - return (-1); -} - static int opal_hmi_handler(struct trapframe *frame) { @@ -81,9 +62,7 @@ opal_setup_hmi(void *data) if (opal_check() != 0) return; - if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI2) == OPAL_TOKEN_PRESENT) - hmi_handler = opal_hmi_handler2; - else if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI) == OPAL_TOKEN_PRESENT) + if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI) == OPAL_TOKEN_PRESENT) hmi_handler = opal_hmi_handler; else { printf("Warning: No OPAL HMI handler found.\n");