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
This commit is contained in:
Andrew Turner 2020-06-19 18:00:20 +00:00
parent 9598fc63e6
commit 41b84341f5

View File

@ -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;