It’s all in the thread, Kuri0’s BIOS has 4G deconding enabled, DSDT hard corded and REBAR DXE driver.
You set the BAR size via windows CLI with ReBarState.
Changes I did
- Fix DSDT bug with 4G Decoding
- Add Resizable BAR DXE
TODO: if i can figure out and have time for
Modify PciHostBridge limit so 16GB BAR works
@prazola Looks like the limit in PciHostBridge needs modification for 16GB BAR to work. A screenshot of Device Manager → Resource by Type → Memory (not Large Memory) showing the last items would be helpful. And also a screenshot of Large Memory (with the 8GB BAR)
For anyone with assembly experience here’s the part of PciHostBridge which I think is relevant to patching (in Ghidra). The first 2 lines are for reading the TOUUD afaik.
I guess changing uVar9 = 0x400000000;
to a higher number will make it work for 16GB RAM atleast. But the rest (32GB RAM and higher) is very confusing
Here is BIOS with PciHostBridge limit increased from 16GB to 480GB. Should get 16GB BAR working
Z97Ex9_480GB.zip (4.4 MB)
There’s a possibility that it might not work so be ready to restore the previous BIOS.
Changes done in assembly:
Nope, not working with 14 or 13.
13 was working before right ? If so then just go back to previous BIOS don’t really know any other ways to patch PciHostBridge for now
EDIT: I think problem is PciHostBridge is only made to handle addresses upto 64GB. Don’t know how to actually fix that but could try and make the most of 64GB space
Yes it was working, I already flashed the the old version.
As a last try I modified PciHostBridge so it properly uses the 64GB region because it seems like it won’t allocate devices above that (even tho Haswell can do 512GB). It should give around 48GB of MMIO space on your system which is enough for a 16GB BAR.
Z97Ex9Fixed.zip (4.4 MB) (use this for now)
Nope, still nothing above 13
13 still works though unlike the previous one right ? If it does then it would be helpful to send a screenshot of memory and large memory in device manager
@prazola Looks like even 8Gb (13) not enabled in this screenshot is it because it doesn’t work ? If that’s the case then the issue is address alignment which I probably can fix.
However the rest of the mod (making more room for 16GB bar) looks working
@prazola yeah it’s right. the weird thing is 16gb should work too because i’ve made it able to use the whole range from 0x420000000 to 0xfe0000000 which has more than enough space. but it doesn’t
my guess is that another driver (not PciHostBridge) or PciBusDxe gets called and it doesn’t properly support 16GB BARs because I see PciHostBridge uses DXE services table to call another driver
EDIT: Looks like it calls AddIoSpace and SetMemorySpaceAttributes in the order of the screenshot. My guess is that AddIoSpace has some sort of artificial limit on it.
Don’t worry, you did enough. Ty
Tried the PciHostBridge and DSDT modification on my PC (Gigabyte B75M-D3H RX 580 8GB). Modification works properly (can see in the screenshot it’s using right at the edge of 36 bit limit) so there should be more than enough space for 8GB BAR.
But the largest BAR size that works is 2GB (11) even though I’ve given it 50+GB of BAR space
Even using the default 16GB BAR region there should be more than enough space for a 4GB BAR. It looks like there’s a limit on BAR size somewhere and on your board it’s 8GB max while on mine it’s 2GB max.
Also I the only way I could reset the RebarState variable was booting with iGPU only and setting it to 0, CMOS reset didn’t do anything. Was it the same for you ?
I don’t think there any active users on this forum which have good reverse engineering skills in order to remove the limit but in case anyone is interested feel free to reply about it.
No, CMOS worked for me. Could it be some kind of partitioning between iGPU and dGPU?
@prazola PciHostBridge was calling AllocateMemorySpace with possibly wrong alignment when using large BAR sizes (above 4GB). I fixed that and made a BIOS with it
Z97Ex9ALIGN.zip (4.4 MB) (no difference)
Hope it gets 16GB working. There might be a possibility of it not working so be ready to restore backup BIOS