History

x86/pci: fix mmconfig detection with 32bit near 4g

Pascal reported and bisected a commit: | x86/PCI: don't call e820_all_mapped with -1 in the mmconfig case which broke one system system. ACPI: Using IOAPIC for interrupt routing PCI: MCFG configuration 0: base f0000000 segment 0 buses 0 - 255 PCI: MCFG area at f0000000 reserved in ACPI motherboard resources PCI: Using MMCONFIG for extended config space it didn't have PCI: updated MCFG configuration 0: base f0000000 segment 0 buses 0 - 63 anymore, and try to use 0xf000000 - 0xffffffff for mmconfig For 32bit, mcfg_res->end could be 32bit only (if 64 resources aren't used) So use end - 1 to pass the value in mcfg->end to avoid overflow. We don't need to worry about the e820 path, they are always 64 bit.

Yinghai Lu committed 17 years ago

Commit 75e613c1 parent f79b1b11 file · +3 −3Browse files

Unified · Split

arch/x86/pci/mmconfig-shared.c+3−3
@@ -375,7 +375,7 @@ static acpi_status __init check_mcfg_resource(struct acpi_resource *res, · 374 unmodified lines
375 if (!fixmem32)375 if (!fixmem32)
376 return AE_OK;376 return AE_OK;
377 if ((mcfg_res->start >= fixmem32->address) &&377 if ((mcfg_res->start >= fixmem32->address) &&
378 (mcfg_res->end <= (fixmem32->address +378 (mcfg_res->end < (fixmem32->address +
379 fixmem32->address_length))) {379 fixmem32->address_length))) {
380 mcfg_res->flags = 1;380 mcfg_res->flags = 1;
381 return AE_CTRL_TERMINATE;381 return AE_CTRL_TERMINATE;
@@ -392,7 +392,7 @@ static acpi_status __init check_mcfg_resource(struct acpi_resource *res, · 10 unmodified lines
392 return AE_OK;392 return AE_OK;
393 393
394 if ((mcfg_res->start >= address.minimum) &&394 if ((mcfg_res->start >= address.minimum) &&
395 (mcfg_res->end <= (address.minimum + address.address_length))) {395 (mcfg_res->end < (address.minimum + address.address_length))) {
396 mcfg_res->flags = 1;396 mcfg_res->flags = 1;
397 return AE_CTRL_TERMINATE;397 return AE_CTRL_TERMINATE;
398 }398 }
@@ -418,7 +418,7 @@ static int __init is_acpi_reserved(u64 start, u64 end, unsigned not_used) · 19 unmodified lines
418 struct resource mcfg_res;418 struct resource mcfg_res;
419 419
420 mcfg_res.start = start;420 mcfg_res.start = start;
421 mcfg_res.end = end;421 mcfg_res.end = end - 1;
422 mcfg_res.flags = 0;422 mcfg_res.flags = 0;
423 423
424 acpi_get_devices("PNP0C01", find_mboard_resource, &mcfg_res, NULL);424 acpi_get_devices("PNP0C01", find_mboard_resource, &mcfg_res, NULL);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t