Page MenuHomeFreeBSD

D57694.diff
No OneTemporary

D57694.diff

diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c
--- a/sys/dev/pci/pci_host_generic.c
+++ b/sys/dev/pci/pci_host_generic.c
@@ -463,6 +463,20 @@
if (size == 0)
continue; /* empty range element */
+ /* Truncate large memory windows to avoid system RAM overlap */
+ uint32_t r_type = FLAG_TYPE(sc->ranges[tuple].flags);
+ if (r_type == FLAG_TYPE_MEM || r_type == FLAG_TYPE_PMEM) {
+ uint64_t max_addr = 0x480000000ULL; /* 18 GB */
+ if (phys_base + size > max_addr) {
+ if (phys_base < max_addr) {
+ size = max_addr - phys_base;
+ sc->ranges[tuple].size = size;
+ device_printf(dev, "Truncating range %d to size %#jx to avoid RAM overlap\n",
+ tuple, (uintmax_t)size);
+ }
+ }
+ }
+
if (start < pci_base || end >= pci_base + size)
continue;

File Metadata

Mime Type
text/plain
Expires
Mon, Jun 29, 1:37 AM (10 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34136562
Default Alt Text
D57694.diff (821 B)

Event Timeline