diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 6a51696d8b4..eebaf857b39 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -390,7 +390,7 @@ static struct pmap_preinit_mapping { vm_size_t sz; int mode; } pmap_preinit_mapping[PMAP_PREINIT_MAPPING_COUNT]; -static int pmap_initialized; +int pmap_initialized; /* * Data for the pv entry allocation mechanism. diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 91d6fb2f934..3dc3f3849c8 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -414,6 +414,7 @@ extern vm_offset_t virtual_end; extern vm_paddr_t dmaplimit; extern int pmap_pcid_enabled; extern int invpcid_works; +extern int pmap_initialized; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c index 90eba919841..5f1f3c2e1f2 100644 --- a/sys/amd64/pci/pci_cfgreg.c +++ b/sys/amd64/pci/pci_cfgreg.c @@ -84,6 +84,9 @@ pci_cfgregopen(void) return (1); cfgmech = CFGMECH_1; + if (!pmap_initialized) + return (1); + /* * Grope around in the PCI config space to see if this is a * chipset that is capable of doing memory-mapped config cycles.