[Release] Resizable BAR BIOS EFI Module

Here try this vbios: Polaris30_1.70.rar (107.8 KB)

Then after a successful flash, dump your vbios for yourself and compare it with your own stock, my if its says gop ver 1.70 then it is successfully updated.

Your GPU getting allocated in 32-bit region for some reason.

@karalux Can you expand the Memory section with 4G decoding enabled, scroll to bottom and take a screenshot ?

Also BTW you can gain a performance from adjusting the memory timings on Polaris GPUs, it depends on what VRAM vendor you got though (Elpida is worst, Samsung mid and Hynix best).

1 Like

@Koekieezz it has updated GOP driver to 1.70

@Kuri0 i have Micron vram on my RX 590 which has worse timings than Hynix and Samsung but i havent played with timings much since it already becomes very unstable if i change memory speed or voltages. Maybe its still worth trying in the future.

@karalux Hi try running this from EFI Shell (you can download it to USB) using load -nc MMIOPrint.efi and post the output.

MMIOPrint.zip (4.0 KB)

It will print the UEFI MMIO map and should tell what’s wrong (such as a missing 64-bit region)

Make sure 4G decode is on when running it

1 Like


@karalux there is no Type 3 (MMIO) 64-bit region, that is why it is failing. I assume 4G decode on

I can check if the AddMemorySpace call can be added though, that was done for a Dell system and worked.

Are you sure this BIOS is the 4G decoding one ?

1 Like

Well, its enabled in bios, GPU-Z shows 4G decoding Yes, there is the large memory with a single PCI entry that isnt there without enabling 4G decoding in bios and i left 1024MB rebar on, AMD adrenaline is showing rebar as enabled. How else could i check if above 4G decoding is on? Keep in mind that its an industrial motherboard with a mobile QM87 chipset and above 4G decoding added by AsRock by request which didnt even work properly without Koekieezz fixing it, im sure there will be some odd stuff
ps could enabling it via modGrubShell help?

@karalux I think ASRock hasn’t modified the BIOS properly

It’s missing the 2 things that 4G decoding uses (Haswell Z87 also missing these).

In one of the PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL functions:

Gigabyte B75M-D3H (Good)

ASRock IMB-180 4G Decoding BIOS (Bad)
image

You can see the check for 4G decoding DAT_800028e9 == '\x01' on the B75 used to increase the maximum address from 0xffffffff (4GB) to the maximum 64-bit for AllocateMemorySpace (0x20)

Also in the main function you can see the AddMemorySpace (0x18) doesn’t add the Above 4GB MMIO region (which we saw in MMIOPrint)

Gigabyte B75M-D3H (Good)
image

ASRock IMB-180 4G Decoding (Bad), there’s an error with the disassembly on 32-bit AddMemorySpace but it doesn’t matter.

It really looks like the ASRock BIOS half did the 4G decoding, the only things getting allocated there are audio and maybe Intel ME and even those needed DSDT edit to function with it.

In case anyone is asking if it would be possible to add 4G decoding yourself it should be you would have to create hooks for AddMemorySpace and AllocateMemorySpace to fix the issues I mentioned while being togglable with an NVRAM variable (like ReBarState) so that CSM can be turned off.

2 Likes

I see, too bad i have zero programming skills to mess with the insides of bios manually and figure this out myself. You mentioned that something similar has been done to some Dell system, has the procedure been documented somewhere?

@karalux actually what was done on dell wasn’t similar at all, it had everything in place already just needed a small change.

1 Like

I have a Ryzen 7 2700x that seems to not support rebar yet my motherboard supports rebar, i have the latest update on it, some time ago i tried forcing rebar but it simply rejected my modded bios file and through other flashing apps it also didn’t work.

Insert As Is the RebarDXE.ffs using latest available mmtool v5 to GUID A0327FE0-1FDA-4E5B-905D-B510C45A61D0, save, then copy that bios to your flash drive.

Go downgrade your bios to any version before agesa 1.2.0.0, then after you went back to an older agesa, update the modded bios using qflash just like what you did when downgrading your bios.

Hello @Luminelous,

I recall we got the modified file to flash as ReBAR State was happy. I think it was an issue with the 2700K.

It’s been a while lol :robot:

wow, cant believe we met again! i tried to see our old dms and tried going through the steps again but i couldnt find you! i factory reseted my pc and it didnt work again and now i cant do it but i dont think ill keep trying since i dont wanna brick my motherboard!

Did you do a CMOS clear?

If that is the case, then you need to run the ReBarState.exe and set the size you want. 8GB I think it was.

I can message you on Discord again if you would like. I still have the history saved.

1 Like

i didnt do a cmos clear, and yeah you could message me if you find me on discord.

I’m currently trying to get resizable bar working on a HP Z440 to enable use of an Intel Arc GPU.

So far, I have followed the guides located at : GitHub - xCuri0/ReBarUEFI: Resizable BAR for (almost) any UEFI system

My current progress is I believe I have identified the BIOS option to enable Above 4G Decoding (64-Bit). This was done using UEFITool and IFRextractor.

0xF3D 		One Of: PCI 64-Bit Resource Allocation, VarStoreInfo (VarOffset/VarName): 0x54, VarStore: 0x1, QuestionId: 0x10, Size: 1, Min: 0x0, Max 0x1, Step: 0x0 {05 91 1C 16 1D 16 10 00 01 00 54 00 10 10 00 01 00}
0xF4E 			One Of Option: Disable, Value (8 bit): 0x0 (Default) {09 07 70 08 30 00 00}
0xF55 			One Of Option: Enable, Value (8 bit): 0x1 {09 07 6F 08 00 00 01}

The issue I have not encountered is that the value of this cannot be changed with grub-setup-var. The output is as follows:

**grub>setup_var 0x54**
Looking for Setup variable.....
var name: Setup, var size: 12, var guid: ec87d643-eba4-4bb5 - a1-e5....etc

--> GUID does not match expected GUID, taking it nevertheless...
expected a different size of the Setup variable (got 5063 (0x13c7) bytes). Continue with care...
successfully obtained "Setup" variable from VSS (got 5063 (0x13c7) bytes).
offset 0x54 is: 0x00

var name: Setup, var size: 12, var guid: 492d16ab-4969-49ac - a1-f7....etc
expected a different size of the Setup variable (got 5063 (0x14ca) bytes). Continue with care...
successfully obtained "Setup" variable from VSS (got 5063 (0x14ca) bytes).
offset 0x54 is: 0x00
**grub>setup_var 0x54 0x1**
Looking for Setup variable.....
var name: Setup, var size: 12, var guid: ec87d643-eba4-4bb5 - a1-e5....etc

--> GUID does not match expected GUID, taking it nevertheless...
expected a different size of the Setup variable (got 5063 (0x13c7) bytes). Continue with care...
successfully obtained "Setup" variable from VSS (got 5063 (0x13c7) bytes).
offset 0x54 is: 0x00
setting offset 0x54 to 0x01
error: can't set variable using efi (error: 0x80000000000000f)

At this point, I’ve kind of reached my ability to progress without significant amount of research. I was wondering if someone might be able to provide some pointers on possible next steps?

I was wondering if changing the default value of the parameter might be possible within the BIOS file at the same time as applying the ReBarDxe module. Then flashing in one go

I’ve also got an open issue at HP Z440 Above 4G Decoding · Issue #91 · xCuri0/ReBarUEFI · GitHub where this has also been discussed. It was suggested I should post here for further advice.

Any advice appreciated.

Edit: Apologies…found PCI MMIO option under BIOS Performance section with option to allocate to 64 Bit. 4G Decoding now working. On to ReBarDxe now.

@Sweet_Kitten able to help with this ?

I know you typically do menu unlocks on OEM systems like this

2 Likes

I’m not able. I don’t know an unlocking key shortcut for this bios.

And the bios is write-protected.

1 Like

did anybody tried to patch gigabyte z170 k3 gaming rev 1.0? i’ve gotten my hand on an a770. but all of those instructions on github scare me :sweat_smile: