Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 May 2019 03:39:04 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r347013 - head/sys/powerpc/powernv
Message-ID:  <201905020339.x423d4JQ060648@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Thu May  2 03:39:03 2019
New Revision: 347013
URL: https://svnweb.freebsd.org/changeset/base/347013

Log:
  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

Modified:
  head/sys/powerpc/powernv/opal_hmi.c

Modified: head/sys/powerpc/powernv/opal_hmi.c
==============================================================================
--- head/sys/powerpc/powernv/opal_hmi.c	Thu May  2 02:26:42 2019	(r347012)
+++ head/sys/powerpc/powernv/opal_hmi.c	Thu May  2 03:39:03 2019	(r347013)
@@ -39,25 +39,6 @@ __FBSDID("$FreeBSD$");
 #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)
 {
 	int err;
@@ -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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905020339.x423d4JQ060648>