Subject: Re: aiboost(4) crashes during boot-up if configured with XEN3_DOM0
To: None <fukumoto@imasy.or.jp>
From: Juan RP <juan@xtrarom.org>
List: current-users
Date: 01/28/2008 20:24:43
On Tue, 29 Jan 2008 03:58:06 +0900 (JST)
fukumoto@imasy.or.jp wrote:

> acpibut0 at acpi0 (PWRB, PNP0C0C): ACPI Power Button
> PCI0 (PNP0A08) [PCI Express/PCI-X Mode-2 Host Bridge] at acpi0 not configured
> MBIO (PNP0C02) [Plug and Play motherboard register resources] at acpi0 not configured
> aiboost0 at acpi0 (ASOC, ATK0110-16843024)
> aiboost0: ASUS AI Boost Hardware monitor
> panic: kmem_poison_check: 0xca8a1740: 0x80 != 0xcd

Hi,

Can you try the attached patch?

http://www.netbsd.org/~xtraeme/aiboost_kmem_poison_check_fix.diff

Index: aiboost.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/aiboost.c,v
retrieving revision 1.20
diff -b -u -p -r1.20 aiboost.c
--- aiboost.c	13 Dec 2007 15:36:29 -0000	1.20
+++ aiboost.c	28 Jan 2008 19:21:43 -0000
@@ -111,6 +111,7 @@ aiboost_acpi_attach(device_t parent, dev
 	struct acpi_attach_args *aa = aux;
 	ACPI_HANDLE *handl;
 	int i, maxsens, error = 0;
+	size_t len;
 
 	sc->sc_node = aa->aa_node;
 	handl = sc->sc_node->ad_handle;
@@ -135,8 +136,8 @@ aiboost_acpi_attach(device_t parent, dev
 	DPRINTF(("%s: maxsens=%d\n", __func__, maxsens));
 
 	sc->sc_sme = sysmon_envsys_create();
-	sc->sc_sensor = kmem_zalloc(sizeof(envsys_data_t) * maxsens,
-	    KM_NOSLEEP);
+	len = sizeof(envsys_data_t) * maxsens;
+	sc->sc_sensor = kmem_zalloc(len, KM_NOSLEEP);
 	if (!sc->sc_sensor)
 		goto bad2;
 
@@ -173,7 +174,7 @@ aiboost_acpi_attach(device_t parent, dev
 	return;
 
 bad:
-	kmem_free(sc->sc_sensor, sizeof(*sc->sc_sensor));
+	kmem_free(sc->sc_sensor, len);
 bad2:
 	sysmon_envsys_destroy(sc->sc_sme);
 	mutex_destroy(&sc->sc_mtx);
@@ -311,7 +312,7 @@ aiboost_getcomp(ACPI_HANDLE *h, const ch
 	struct aiboost_comp *c = NULL;
 	int i;
 	const char *str = NULL;
-	size_t length;
+	size_t length, clen = 0;
 
 	status = acpi_eval_struct(h, name, &buf);
 	if (ACPI_FAILURE(status)) {
@@ -331,9 +332,9 @@ aiboost_getcomp(ACPI_HANDLE *h, const ch
 		goto error;
 	}
 
-	c = kmem_zalloc(sizeof(struct aiboost_comp) +
-	    sizeof(struct aiboost_elem) * (elem->Integer.Value - 1),
-	    KM_NOSLEEP);
+	clen = sizeof(struct aiboost_comp) + sizeof(struct aiboost_elem) *
+	    (elem->Integer.Value - 1);
+	c = kmem_zalloc(clen, KM_NOSLEEP);
 	if (!c)
 		goto error;
 
@@ -405,7 +406,7 @@ error:
 	if (buf2.Pointer)
 		AcpiOsFree(buf2.Pointer);
 	if (c)
-		kmem_free(c, sizeof(*c));
+		kmem_free(c, clen);
 
 	return AE_BAD_DATA;
 }

-- 
Juan Romero Pardines             The NetBSD Project
http://plog.xtrarom.org/         NetBSD/pkgsrc news in Spanish
http://mklivecd.xtrarom.org/     Make your own NetBSD Live CD/DVD!