svn commit: r362397 - head/sys/dev/pci

Andrew Turner andrew at FreeBSD.org
Fri Jun 19 18:00:21 UTC 2020


Author: andrew
Date: Fri Jun 19 18:00:20 2020
New Revision: 362397
URL: https://svnweb.freebsd.org/changeset/base/362397

Log:
  Use the correct address when creating pci resources
  
  When the PCI and CPU physical addresses are identical it doesn't matter
  which is used to create the resources, however on some systems, e.g.
  qemu armv7 virt, they are different. This leads to a panic as we try to
  map the wrong physical address into the kernel address space.
  
  Reported by:	Jenkins via trasz
  Sponsored by:	Innovate UK

Modified:
  head/sys/dev/pci/pci_host_generic.c

Modified: head/sys/dev/pci/pci_host_generic.c
==============================================================================
--- head/sys/dev/pci/pci_host_generic.c	Fri Jun 19 17:59:55 2020	(r362396)
+++ head/sys/dev/pci/pci_host_generic.c	Fri Jun 19 18:00:20 2020	(r362397)
@@ -143,15 +143,15 @@ pci_host_generic_core_attach(device_t dev)
 		case FLAG_TYPE_PMEM:
 			sc->has_pmem = true;
 			error = rman_manage_region(&sc->pmem_rman,
-			   phys_base, phys_base + size - 1);
+			   pci_base, pci_base + size - 1);
 			break;
 		case FLAG_TYPE_MEM:
 			error = rman_manage_region(&sc->mem_rman,
-			   phys_base, phys_base + size - 1);
+			   pci_base, pci_base + size - 1);
 			break;
 		case FLAG_TYPE_IO:
 			error = rman_manage_region(&sc->io_rman,
-			   phys_base, phys_base + size - 1);
+			   pci_base, pci_base + size - 1);
 			break;
 		default:
 			continue;


More information about the svn-src-all mailing list