There’s no option explicitly called “Resizable BAR” in my Universal IFR Extractor dump but I was under the impression that the presence of “Above 4GB MMIO BIOS assignment” means it is supported. I also compiled the latest Rust version of the IFR Extractor and it produced a description that the other did not: "Enable/Disable above 4GB MemoryMappedIO BIOS assignment This is enabled automatically when Aperture Size is set to 2048MB."
Turns out solution was even simpler than any workaround offered.
After patching DSDT and reinjecting it to the BIOS, Pad-files went corrupted again. Now that I know it is caused due to the way UEFITool solves unalignment, I injected the patched DSDT to the patched BIOS shown on my previous post in option 7 (where I manually added a Pad-file and caused unalignment to the Raw file) hoping that the change of size in the Runtime module and the change of size in the AmiBoardInfo module would together realign the Raw file as needed to insert the Pad-file.
EDIT: EVEN SIMPLER! Just patch the BIOS, now that it has corrupted Pad-files inject the patched DSDT module to fix the corruption. Note that this solution would work only if more than one patched module that exists before the Raw files have changed their size.
Conclusion: First, patch both your modules and DSDT and then fix padding (either add the Pad-file manually using any Hex Editor or insert using UEFITool) cause you might not even need to do anything to fix padding.
If you are still encountering problems and unable to solve padding issue after trying everything, perhaps it means that only one module before the Raw file has changed its size. In this case, please turn to @Sweet_Kitten’s wonderful solution.
P.S. Here is a link to the BIOS if anyone else here has the board, to save you some effort.
Sorry if I sound obtuse, but what did I skip? My understanding is that recent kernels automatically resize the BAR when >4GB MMIO is enabled in the BIOS settings (Improving performance - ArchWiki):
[ 2.770600] i915 0000:04:00.0: BAR 2: no space for [mem size 0x200000000 64bit pref]
[ 2.770601] i915 0000:04:00.0: BAR 2: failed to assign [mem size 0x200000000 64bit pref]
[ 2.771401] i915 0000:04:00.0: [drm] Failed to resize BAR2 to 8192M (-ENOSPC)
I inspected the contents of Setup with efivar -p -n ec87d643-eba4-4bb5-a1e5-3f3e36b20da9-Setup and found that offset 0x8e1 (>4GB MMIO BIOS assignment) is still 0 for some reason…so I tried again, this time with setup_var.efi:
Edit: I also tried applying the “Linux no 4G Decoding fix” DSDT patch and there’s no discernible difference: dsdt_mod_linux_no_4g_decoding.zip (271.1 KB)
Setting pci=realloc to the kernel arguments from grub doesn’t do anything, either.
hi i have a asus a320m-k and i installed the rebardxe.ffs module into the bios and flashed it using a flash programmer ch341a and it boots normally but using rebarstate.exe dosent change the barsize at all it stays at 4gb always even if i put a lower or higher value
here is the original bios ans well as the modded one (which i got by reading the bios using afuwin.exe as it was currently installed):
Try to take off the cmos battery, turn the psu on but dont turn the pc on, and then try to reprogram the bios chip using CH341A again with your modded bios, make sure you do have your stock bios backup (not pure bios from asus).
If it doesnt work, try to turn off the psu, and then try again. So no cmos, no psu power flowing through, and just ch341a that powers your bios chip.
I found another section in my BIOS called PciDynamicSetup where the extracted .efi contains plain text related to enabling/disabling 4G Decoding: Above 4G DecodingGlobally Enables or Disables 64bit capable Devices to be Decoded in Above 4G Address Space (Only if System Supports 64 bit PCI Decoding).Disable Above 4G DecodingDisables 64bit capable Device Resources to be Allocated in Above 4G Address Space
Curiously, neither Universal IFR Extractor nor IFRExtractor RS includes “4G Decoding” in their output. They only extract a PCI Subsystem Settings form containing a Hot-Plug Support checkbox along with empty forms for PCI Device Settings, PCI Express GEN 1 Settings, PCI Express GEN 2 Settings, and PCI Hot-Plug Settings.
This is what I see inside PCI_COMMON:
GUID: aca9f304-21e2-4852-9875-7ff4881d67a5
Name: "PCI_COMMON"
Attributes:
Non-Volatile
Boot Service Access
Runtime Service Access
Value:
00000000 00 00 01 00 00 00
The only set byte corresponds to the offset of Hot-Plug Support. Is there any way to figure out what the other bytes represent, or am I going to have to take the Russian roulette route?
There’s no option explicitly called “Resizable BAR” in my Universal IFR Extractor dump but I was under the impression that the presence of “Above 4GB MMIO BIOS assignment” means it is supported.
Not really. A card may come with huge BAR size but no resizable BAR compatibility. As your BIOS doesn’t support adjusting resizable BAR then you will be stuck with typically a default size of 256MiB. You need to add resizable BAR support yourself.
Aperture Size (0x82b): 1 → 0xf [256MB to 2048MB]
This is for integrated graphics (in CPU), not discrete graphics.
The only set byte corresponds to the offset of Hot-Plug Support. Is there any way to figure out what the other bytes represent, or am I going to have to take the Russian roulette route?
No need, it’s not unusual for BIOS to be left with old unused data that doesn’t do anything.
Has anyone had any luck with a Lenovo M920s (or any Lenovo for that matter that uses the same flash tools)?
I’ve had no issue creating the patched BIOS, but I cannot get the Lenovo flash tool to actually accept the BIOS and flash it. It errors out and says that the file doesn’t match (or it’s too old). I have disabled the BIOS option that locks out rolling back the BIOS. (I think it’s called BIOS rollback protection?)
Any thoughts on how to force it to flash the modded BIOS?
You can try dumping and modding only the bios_region, if the FD is unlocked for writing.
Enable the Service Mode (ME_DIS jumper) for dumping and writing, using the Intel FPT tool form the correct SKU of the chipset ME FW.
I get “can’t set variable using efi(0x00000000000000001a)” and “SetVariable call returned Security Violation.” in grub setup_var and AMISetupWriter.
What I want to do is to enable Above 4G Decoding and Resizable BAR.
SH510R4
SH510000.104
FPTW64.exe -i
Intel (R) Flash Programming Tool Version: 15.0.35.1951
Copyright (C) 2005 - 2021, Intel Corporation. All rights reserved.
I have checked and it does not seem to be enabled in my environment.
Is this a CPU or OS revision issue?
At least there is no menu in the BIOS (UEFI) to set 4 above and resize ber.