Subject: ACPI and invalid devices
To: None <port-amd64@netbsd.org, port-i386@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-i386
Date: 03/09/2007 17:51:09
--W/nzBZO5zC0uMSeA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,
an ACPI kernel doesn't boot on the dell 2950, it panics in pci_make_tag()
because this function is called with bus 0 device 0xffff function 0xffff.
With the attached patch it boots and I didn't notice any bad effects.
Does it make sense ?

output of acpidump available here:
ftp://asim.lip6.fr/outgoing/acpidump.gz

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--W/nzBZO5zC0uMSeA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: x86/mpacpi.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/mpacpi.c,v
retrieving revision 1.44
diff -u -r1.44 mpacpi.c
--- x86/mpacpi.c	16 Nov 2006 01:32:39 -0000	1.44
+++ x86/mpacpi.c	24 Feb 2007 17:08:46 -0000
@@ -510,6 +510,9 @@
 		if (ACPI_FAILURE(rv))
 			return -1;
 
+		if (ACPI_HIWORD(val) >= 32 || ACPI_LOWORD(val) >= 32) 
+			return -1;
+
 		tag = pci_make_tag(acpi->sc_pc, bus,
 		    ACPI_HIWORD(val), ACPI_LOWORD(val));
 

--W/nzBZO5zC0uMSeA--