Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z97 board can't allocate above 4G even with above 4g decoding enable in BIOS #10

Closed
val3nt33n opened this issue Nov 5, 2022 · 84 comments
Labels
bios issue with firmware that needs patching help wanted Extra attention is needed

Comments

@val3nt33n
Copy link

val3nt33n commented Nov 5, 2022

System

  • Motherboard: Asus Z97i-Plus
  • BIOS Version: 2704
  • GPU: Intel Arc A750 LE (supports up to 8GB BAR)
  • Above 4G decoding is enabled in BIOS
  • CSM is disabled
  • Applied PciBus | Remove <16GB BAR size limit patch
  • replaced NvramSmi module from an older BIOS(version 2103) to allow new uefi variable creation

Description
I modded the BIOS to enable rebar using your instructions but the maximum working BAR size is 1GB. At 2GB the system gets stuck during post, at 4GB and 8GB it boots into the OS(Windows 10 and Ubuntu 20.04) but video output works only from the iGPU.

This is dmesg after booting with 8GB

[    0.194347] pci_bus 0000:00: root bus resource [bus 00-3e]
[    0.194349] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
[    0.194350] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
[    0.194352] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000dffff window]
[    0.194353] pci_bus 0000:00: root bus resource [mem 0xdf200000-0xfeafffff window]
[    0.194354] pci_bus 0000:00: root bus resource [mem 0x800000000-0xfbfffffff window]
[    0.197052] pci 0000:00:01.0: PCI bridge to [bus 01-04]
[    0.197055] pci 0000:00:01.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.197058] pci 0000:00:01.0:   bridge window [mem 0xf0000000-0xf07fffff 64bit pref]
[    0.197408] pci 0000:01:00.0: PCI bridge to [bus 02-04]
[    0.197413] pci 0000:01:00.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.197453] pci 0000:03:00.0: [8086:56a1] type 00 class 0x030000
[    0.197468] pci 0000:03:00.0: reg 0x10: [mem 0x00000000-0x00ffffff 64bit]
[    0.197477] pci 0000:03:00.0: reg 0x18: [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.197491] pci 0000:03:00.0: reg 0x30: [mem 0x00000000-0x001fffff pref]
[    0.197563] pci 0000:03:00.0: PME# supported from D0 D3hot
[    0.209169] pnp 00:00: disabling [mem 0xfed40000-0xfed44fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209785] pnp 00:06: disabling [mem 0xfed1c000-0xfed1ffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209788] pnp 00:06: disabling [mem 0xfed10000-0xfed17fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209790] pnp 00:06: disabling [mem 0xfed18000-0xfed18fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209791] pnp 00:06: disabling [mem 0xfed19000-0xfed19fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209793] pnp 00:06: disabling [mem 0xf8000000-0xfbffffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209794] pnp 00:06: disabling [mem 0xfed20000-0xfed3ffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209796] pnp 00:06: disabling [mem 0xfed90000-0xfed93fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209797] pnp 00:06: disabling [mem 0xfed45000-0xfed8ffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209798] pnp 00:06: disabling [mem 0xff000000-0xffffffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209800] pnp 00:06: disabling [mem 0xfee00000-0xfeefffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209801] pnp 00:06: disabling [mem 0xf7fe0000-0xf7feffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.209803] pnp 00:06: disabling [mem 0xf7ff0000-0xf7ffffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.217718] pci 0000:01:00.0: BAR 15: no space for [mem size 0x200000000 64bit pref]
[    0.217720] pci 0000:01:00.0: BAR 15: failed to assign [mem size 0x200000000 64bit pref]
[    0.217723] pci 0000:02:01.0: BAR 15: no space for [mem size 0x200000000 64bit pref]
[    0.217724] pci 0000:02:01.0: BAR 15: failed to assign [mem size 0x200000000 64bit pref]
[    0.217725] pci 0000:02:01.0: BAR 14: no space for [mem size 0x01800000]
[    0.217726] pci 0000:02:01.0: BAR 14: failed to assign [mem size 0x01800000]
[    0.217727] pci 0000:03:00.0: BAR 2: no space for [mem size 0x200000000 64bit pref]
[    0.217729] pci 0000:03:00.0: BAR 2: failed to assign [mem size 0x200000000 64bit pref]
[    0.217730] pci 0000:03:00.0: BAR 0: no space for [mem size 0x01000000 64bit]
[    0.217731] pci 0000:03:00.0: BAR 0: failed to assign [mem size 0x01000000 64bit]
[    0.217732] pci 0000:03:00.0: BAR 6: no space for [mem size 0x00200000 pref]
[    0.217733] pci 0000:03:00.0: BAR 6: failed to assign [mem size 0x00200000 pref]
[    0.217734] pci 0000:02:01.0: PCI bridge to [bus 03]
[    0.217744] pci 0000:02:04.0: PCI bridge to [bus 04]
[    0.217748] pci 0000:02:04.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.217756] pci 0000:01:00.0: PCI bridge to [bus 02-04]
[    0.217759] pci 0000:01:00.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.217764] pci 0000:00:01.0: PCI bridge to [bus 01-04]
[    0.217766] pci 0000:00:01.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.217768] pci 0000:00:01.0:   bridge window [mem 0xf0000000-0xf07fffff 64bit pref]
[    0.217771] pci 0000:00:1c.0: PCI bridge to [bus 05]
[    0.217779] pci_bus 0000:00: Some PCI device resources are unassigned, try booting with pci=realloc
[    0.217780] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7 window]
[    0.217782] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff window]
[    0.217783] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000dffff window]
[    0.217784] pci_bus 0000:00: resource 7 [mem 0xdf200000-0xfeafffff window]
[    0.217785] pci_bus 0000:00: resource 8 [mem 0x800000000-0xfbfffffff window]
[    0.217786] pci_bus 0000:01: resource 1 [mem 0xf7c00000-0xf7cfffff]
[    0.217787] pci_bus 0000:01: resource 2 [mem 0xf0000000-0xf07fffff 64bit pref]
[    0.217788] pci_bus 0000:02: resource 1 [mem 0xf7c00000-0xf7cfffff]
[    0.217789] pci_bus 0000:04: resource 1 [mem 0xf7c00000-0xf7cfffff]
00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM Controller (rev 06)
03:00.0 VGA compatible controller: Intel Corporation Device 56a1 (rev 08)
06:00.0 Network controller: Broadcom Inc. and subsidiaries BCM4352 802.11ac Wireless Network Adapter (rev 03)

and /proc/iomem

f0000000-f07fffff : PCI Bus 0000:01
  f0000000-f07fffff : 0000:01:00.0
f7400000-f77fffff : 0000:00:02.0
f7800000-f7afffff : PCI Bus 0000:06
  f7800000-f79fffff : 0000:06:00.0
  f7a00000-f7a07fff : 0000:06:00.0
f7b00000-f7bfffff : PCI Bus 0000:01
  f7b00000-f7bfffff : PCI Bus 0000:02
    f7b00000-f7bfffff : PCI Bus 0000:04
      f7b00000-f7b03fff : 0000:04:00.0
...
100000000-41fdfffff : System RAM
  179e00000-17ae025c7 : Kernel code
  17b000000-17ba87fff : Kernel rodata
  17bc00000-17c0455ff : Kernel data
  17c393000-17c9fffff : Kernel bss
41fe00000-41fffffff : RAM buffer

device manger

@val3nt33n
Copy link
Author

I tried looking at the memory range in DSDT but it's using some external symbols that I couldn't find anywhere in the other ACPI tables.

        CreateQWordField (BUF0, \_SB.PCI0._Y1E._LEN, M2LN)  // _LEN: Length          
        CreateQWordField (BUF0, \_SB.PCI0._Y1E._MIN, M2MN)  // _MIN: Minimum Base Address         
        CreateQWordField (BUF0, \_SB.PCI0._Y1E._MAX, M2MX)  // _MAX: Maximum Base Address             
        M2LN = M64L /* External reference */
        M2MN = M64B /* External reference */                                         
        M2MX = ((M2MN + M2LN) - One)

@val3nt33n
Copy link
Author

val3nt33n commented Nov 5, 2022

After setting pci=realloc at boot it looks like it manages to assign memory to the GPU. I'm still not getting video output, though.

[    0.213321] pnp 00:00: disabling [mem 0xfed40000-0xfed44fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213934] pnp 00:06: disabling [mem 0xfed1c000-0xfed1ffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213937] pnp 00:06: disabling [mem 0xfed10000-0xfed17fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213939] pnp 00:06: disabling [mem 0xfed18000-0xfed18fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213940] pnp 00:06: disabling [mem 0xfed19000-0xfed19fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213941] pnp 00:06: disabling [mem 0xf8000000-0xfbffffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213943] pnp 00:06: disabling [mem 0xfed20000-0xfed3ffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213944] pnp 00:06: disabling [mem 0xfed90000-0xfed93fff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213945] pnp 00:06: disabling [mem 0xfed45000-0xfed8ffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213947] pnp 00:06: disabling [mem 0xff000000-0xffffffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213948] pnp 00:06: disabling [mem 0xfee00000-0xfeefffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213950] pnp 00:06: disabling [mem 0xf7fe0000-0xf7feffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.213951] pnp 00:06: disabling [mem 0xf7ff0000-0xf7ffffff] because it overlaps 0000:03:00.0 BAR 2 [mem 0x00000000-0x1ffffffff 64bit pref]
[    0.221845] pci_bus 0000:00: max bus depth: 3 pci_try_num: 4
[    0.221854] pci 0000:01:00.0: BAR 15: no space for [mem size 0x200000000 64bit pref]
[    0.221856] pci 0000:01:00.0: BAR 15: failed to assign [mem size 0x200000000 64bit pref]
[    0.221858] pci 0000:02:01.0: BAR 15: no space for [mem size 0x200000000 64bit pref]
[    0.221859] pci 0000:02:01.0: BAR 15: failed to assign [mem size 0x200000000 64bit pref]
[    0.221860] pci 0000:02:01.0: BAR 14: no space for [mem size 0x01800000]
[    0.221861] pci 0000:02:01.0: BAR 14: failed to assign [mem size 0x01800000]
[    0.221863] pci 0000:03:00.0: BAR 2: no space for [mem size 0x200000000 64bit pref]
[    0.221864] pci 0000:03:00.0: BAR 2: failed to assign [mem size 0x200000000 64bit pref]
[    0.221865] pci 0000:03:00.0: BAR 0: no space for [mem size 0x01000000 64bit]
[    0.221866] pci 0000:03:00.0: BAR 0: failed to assign [mem size 0x01000000 64bit]
[    0.221868] pci 0000:03:00.0: BAR 6: no space for [mem size 0x00200000 pref]
[    0.221869] pci 0000:03:00.0: BAR 6: failed to assign [mem size 0x00200000 pref]
[    0.221870] pci 0000:02:01.0: PCI bridge to [bus 03]
[    0.221879] pci 0000:02:04.0: PCI bridge to [bus 04]
[    0.221884] pci 0000:02:04.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.221892] pci 0000:01:00.0: PCI bridge to [bus 02-04]
[    0.221895] pci 0000:01:00.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.221900] pci 0000:00:01.0: PCI bridge to [bus 01-04]
[    0.221902] pci 0000:00:01.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.221903] pci 0000:00:01.0:   bridge window [mem 0xf0000000-0xf07fffff 64bit pref]
[    0.221907] pci 0000:00:1c.0: PCI bridge to [bus 05]
[    0.221914] pci_bus 0000:00: No. 2 try to assign unassigned res
[    0.221918] pci 0000:01:00.0: BAR 15: no space for [mem size 0x200000000 64bit pref]
[    0.221919] pci 0000:01:00.0: BAR 15: failed to assign [mem size 0x200000000 64bit pref]
[    0.221921] pci 0000:02:01.0: BAR 15: no space for [mem size 0x200000000 64bit pref]
[    0.221922] pci 0000:02:01.0: BAR 15: failed to assign [mem size 0x200000000 64bit pref]
[    0.221923] pci 0000:02:01.0: BAR 14: no space for [mem size 0x02000000]
[    0.221924] pci 0000:02:01.0: BAR 14: failed to assign [mem size 0x02000000]
[    0.221926] pci 0000:03:00.0: BAR 2: no space for [mem size 0x200000000 64bit pref]
[    0.221927] pci 0000:03:00.0: BAR 2: failed to assign [mem size 0x200000000 64bit pref]
[    0.221928] pci 0000:03:00.0: BAR 0: no space for [mem size 0x01000000 64bit]
[    0.221929] pci 0000:03:00.0: BAR 0: failed to assign [mem size 0x01000000 64bit]
[    0.221930] pci 0000:02:01.0: PCI bridge to [bus 03]
[    0.221939] pci 0000:02:04.0: PCI bridge to [bus 04]
[    0.221943] pci 0000:02:04.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.221951] pci 0000:01:00.0: PCI bridge to [bus 02-04]
[    0.221954] pci 0000:01:00.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.221959] pci 0000:00:01.0: PCI bridge to [bus 01-04]
[    0.221961] pci 0000:00:01.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.221962] pci 0000:00:01.0:   bridge window [mem 0xf0000000-0xf07fffff 64bit pref]
[    0.221965] pci 0000:00:1c.0: PCI bridge to [bus 05]
[    0.221973] pci_bus 0000:00: No. 3 try to assign unassigned res
[    0.221975] pci 0000:02:04.0: resource 14 [mem 0xf7c00000-0xf7cfffff] released
[    0.221976] pci 0000:02:04.0: PCI bridge to [bus 04]
[    0.221979] pci 0000:01:00.0: resource 14 [mem 0xf7c00000-0xf7cfffff] released
[    0.221980] pci 0000:01:00.0: PCI bridge to [bus 02-04]
[    0.221982] release child resource [mem 0xf0000000-0xf07fffff 64bit pref]
[    0.221983] pci 0000:00:01.0: resource 15 [mem 0xf0000000-0xf07fffff 64bit pref] released
[    0.221984] pci 0000:00:01.0: PCI bridge to [bus 01-04]
[    0.221991] pci 0000:00:01.0: BAR 15: assigned [mem 0x800000000-0xaffffffff 64bit pref]
[    0.221993] pci 0000:01:00.0: BAR 15: assigned [mem 0x800000000-0x9ffffffff 64bit pref]
[    0.221995] pci 0000:01:00.0: BAR 0: assigned [mem 0xa00000000-0xa007fffff 64bit pref]
[    0.222001] pci 0000:01:00.0: BAR 14: no space for [mem size 0x02800000]
[    0.222002] pci 0000:01:00.0: BAR 14: failed to assign [mem size 0x02800000]
[    0.222004] pci 0000:02:01.0: BAR 15: assigned [mem 0x800000000-0x9ffffffff 64bit pref]
[    0.222005] pci 0000:02:01.0: BAR 14: no space for [mem size 0x02000000]
[    0.222006] pci 0000:02:01.0: BAR 14: failed to assign [mem size 0x02000000]
[    0.222007] pci 0000:02:04.0: BAR 14: no space for [mem size 0x00100000]
[    0.222008] pci 0000:02:04.0: BAR 14: failed to assign [mem size 0x00100000]
[    0.222009] pci 0000:03:00.0: BAR 2: assigned [mem 0x800000000-0x9ffffffff 64bit pref]
[    0.222017] pci 0000:03:00.0: BAR 0: no space for [mem size 0x01000000 64bit]
[    0.222018] pci 0000:03:00.0: BAR 0: failed to assign [mem size 0x01000000 64bit]
[    0.222019] pci 0000:02:01.0: PCI bridge to [bus 03]
[    0.222024] pci 0000:02:01.0:   bridge window [mem 0x800000000-0x9ffffffff 64bit pref]
[    0.222029] pci 0000:04:00.0: BAR 0: no space for [mem size 0x00004000 64bit]
[    0.222030] pci 0000:04:00.0: BAR 0: failed to assign [mem size 0x00004000 64bit]
[    0.222031] pci 0000:02:04.0: PCI bridge to [bus 04]
[    0.222042] pci 0000:01:00.0: PCI bridge to [bus 02-04]
[    0.222047] pci 0000:01:00.0:   bridge window [mem 0x800000000-0x9ffffffff 64bit pref]
[    0.222050] pci 0000:00:01.0: PCI bridge to [bus 01-04]
[    0.222052] pci 0000:00:01.0:   bridge window [mem 0xf7c00000-0xf7cfffff]
[    0.222054] pci 0000:00:01.0:   bridge window [mem 0x800000000-0xaffffffff 64bit pref]
[    0.222057] pci 0000:00:1c.0: PCI bridge to [bus 05]
[    0.222064] pci_bus 0000:00: No. 4 try to assign unassigned res
[    0.222065] pci 0000:00:01.0: resource 14 [mem 0xf7c00000-0xf7cfffff] released
[    0.222066] pci 0000:00:01.0: PCI bridge to [bus 01-04]
[    0.222070] pci 0000:00:01.0: BAR 14: assigned [mem 0xf0000000-0xf27fffff]
[    0.222072] pci 0000:01:00.0: BAR 14: assigned [mem 0xf0000000-0xf27fffff]
[    0.222074] pci 0000:02:01.0: BAR 14: assigned [mem 0xf0000000-0xf1ffffff]
[    0.222075] pci 0000:02:04.0: BAR 14: assigned [mem 0xf2000000-0xf20fffff]
[    0.222077] pci 0000:03:00.0: BAR 0: assigned [mem 0xf0000000-0xf0ffffff 64bit]
[    0.222084] pci 0000:02:01.0: PCI bridge to [bus 03]
[    0.222088] pci 0000:02:01.0:   bridge window [mem 0xf0000000-0xf1ffffff]
[    0.222090] pci 0000:02:01.0:   bridge window [mem 0x800000000-0x9ffffffff 64bit pref]
[    0.222095] pci 0000:04:00.0: BAR 0: assigned [mem 0xf2000000-0xf2003fff 64bit]
[    0.222107] pci 0000:02:04.0: PCI bridge to [bus 04]
[    0.222111] pci 0000:02:04.0:   bridge window [mem 0xf2000000-0xf20fffff]
[    0.222119] pci 0000:01:00.0: PCI bridge to [bus 02-04]
[    0.222122] pci 0000:01:00.0:   bridge window [mem 0xf0000000-0xf27fffff]
[    0.222125] pci 0000:01:00.0:   bridge window [mem 0x800000000-0x9ffffffff 64bit pref]
[    0.222128] pci 0000:00:01.0: PCI bridge to [bus 01-04]
[    0.222130] pci 0000:00:01.0:   bridge window [mem 0xf0000000-0xf27fffff]
[    0.222132] pci 0000:00:01.0:   bridge window [mem 0x800000000-0xaffffffff 64bit pref]
[    0.222134] pci 0000:00:1c.0: PCI bridge to [bus 05]
[    0.222142] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7 window]
[    0.222143] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff window]
[    0.222144] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000dffff window]
[    0.222146] pci_bus 0000:00: resource 7 [mem 0xdf200000-0xfeafffff window]
[    0.222147] pci_bus 0000:00: resource 8 [mem 0x800000000-0xfbfffffff window]
[    0.222148] pci_bus 0000:01: resource 1 [mem 0xf0000000-0xf27fffff]
[    0.222149] pci_bus 0000:01: resource 2 [mem 0x800000000-0xaffffffff 64bit pref]
[    0.222150] pci_bus 0000:02: resource 1 [mem 0xf0000000-0xf27fffff]
[    0.222151] pci_bus 0000:02: resource 2 [mem 0x800000000-0x9ffffffff 64bit pref]
[    0.222152] pci_bus 0000:03: resource 1 [mem 0xf0000000-0xf1ffffff]
[    0.222153] pci_bus 0000:03: resource 2 [mem 0x800000000-0x9ffffffff 64bit pref]
[    0.222154] pci_bus 0000:04: resource 1 [mem 0xf2000000-0xf20fffff]
03:00.0 VGA compatible controller: Intel Corporation Device 56a1 (rev 08) (prog-if 00 [VGA controller])
	Subsystem: Intel Corporation Device 1021
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Region 0: Memory at f0000000 (64-bit, non-prefetchable) [disabled] [size=16M]
	Region 2: Memory at 800000000 (64-bit, prefetchable) [disabled] [size=8G]
	Capabilities: [40] Vendor Specific Information: Len=0c <?>
	Capabilities: [70] Express (v2) Endpoint, MSI 00

@xCuri0 xCuri0 added bios issue with firmware that needs patching help wanted Extra attention is needed labels Nov 6, 2022
@val3nt33n
Copy link
Author

Browsing through AMIBCP I found some PCIe settings that don't show up in BIOS. Not sure what these do or how to make them visible. All settings(both visible and hidden) have selected 'Yes' in the Show column. I'm confused why it says 'Yes' when it's hidden.
The Reserved Memory setting defaults to 10. I wonder if this is the 1GB limit.

AMIBCP

@xCuri0
Copy link
Owner

xCuri0 commented Nov 6, 2022

@val3nt33n can you also show the Prefetchable Memory description. I think that might be it not Reserved Memory

@val3nt33n
Copy link
Author

val3nt33n commented Nov 6, 2022

@xCuri0 it says "Prefetchable Memory Range for this Root Bridge"
And Prefetchable Memory above 4G description is same as the name: "Prefetchable Memory above 4G"

@xCuri0
Copy link
Owner

xCuri0 commented Nov 6, 2022

try changing both to 13 I guess. but i think Prefetchable Memory is more likely the important one

@val3nt33n
Copy link
Author

I tried changing all 3 one by one. No difference. I think some of these settings are hidden because they are not implemented.

@val3nt33n
Copy link
Author

val3nt33n commented Nov 6, 2022

Oddly, if I enable on-aboard audio, only this device gets assigned at the end of the Large Memory. At least this confirms that above 4G decoding is working.
audio

I think it's just a size restriction somewhere.

@xCuri0
Copy link
Owner

xCuri0 commented Nov 6, 2022

@val3nt33n my system allocates multiple devices in the 64-bit region (gpu not visible in screenshot because it's in large memory)
image

Have you tried with Reserved Memory = 13, Prefetchable Memory = 13 and Prefetchable Memory above 4G = Enabled, all at the same time ?

@val3nt33n
Copy link
Author

Have you tried with Reserved Memory = 13, Prefetchable Memory = 13 and Prefetchable Memory above 4G = Enabled, all at the same time ?

I have. No change.

@Tokobotenkai
Copy link

Tokobotenkai commented Nov 6, 2022

I have an i5-4690k and ASUS Z97-PRO but I only have Ubuntu 22.04 running on it. Any idea how can I contribute or something? Maybe if there's a H97 mainboard that works.

@cursemex
Copy link

cursemex commented Nov 7, 2022

Browsing through AMIBCP I found some PCIe settings that don't show up in BIOS. Not sure what these do or how to make them visible. All settings(both visible and hidden) have selected 'Yes' in the Show column. I'm confused why it says 'Yes' when it's hidden. The Reserved Memory setting defaults to 10. I wonder if this is the 1GB limit.

Found this while surfing on the web: https://www.bios-mods.com/forum/Thread-GUIDE-How-to-modify-AMI-MSI-BIOS-to-unlock-full-features-UEFI-Aptio4

Step 5 made those options visible in BIOS

image

image

image

image

@val3nt33n
Copy link
Author

@cursemex yeah, that’s what I did when I tested(it’s enough to set USER on the top menu and it will make everything under it visible). But playing with different setting in these new options didn’t do anything for me.

@xCuri0
Copy link
Owner

xCuri0 commented Nov 7, 2022

@val3nt33n in cursemex's screenshot it shows "PCIE Port 1 is assigned to LAN". The one with the GPU on is what needs to be changed.

@Tokobotenkai
Copy link

I wonder if we have a working board and is there a difference in the order of assignment?

@xCuri0
Copy link
Owner

xCuri0 commented Nov 7, 2022

@Tokobotenkai

Prazola on win-raid's Asrock Z97 Extreme9

image
It also is different for Port 5
image

My Gigabyte B75M-D3H

image
Port 7 has "Extra Bus Reserved" set to 7
image

Romulus_ut3 on win-raid's Asus P8Z77-V PRO

image

Like my board port 7 has "Extra Bus Reserved" set to 7
image

all of these don't have the "Prefetchable Memory above 4G"

@val3nt33n
Copy link
Author

@val3nt33n in cursemex's screenshot it shows "PCIE Port 1 is assigned to LAN". The one with the GPU on is what needs to be changed.

They all say that(there is not option to change this). And I changed the settings on all ports. I also noticed that on higher ports there are more extra bus reserved and higher Reserved I/O. Playing with them didn't do anything for me.

@cursemex
Copy link

cursemex commented Nov 7, 2022

Silly question, but how do I know which "root port" my gpu is connected to? HWinfo doesn't state the gpu to be on a "root port", but does for my sound card.

@xCuri0
Copy link
Owner

xCuri0 commented Nov 7, 2022

i think i found the problem. PciBus driver is downgrading 64-bit resources to 32-bit ones automatically on Z97 it seems.

Asus Z97(bad)
image

Asus Z77 (good)
image

@aquamacho1
Copy link

aquamacho1 commented Nov 7, 2022

@xCuri0 can this also be related to #9 ?

@xCuri0
Copy link
Owner

xCuri0 commented Nov 7, 2022

@val3nt33n

here's the hex patch if you want to try it. it probably will work, pcihostbridge seems ok for it but only using 32-64GB range for resource allocation which won't be enough for 32GB BAR cards (eg 3090 or others with more than 16GB of VRAM). They seem to have re-used code from Ivy Bridge because Haswell supports upto 512GB physical address. Still there's a risk of it not working so wouldn't recommend trying on non-dual bios unless you have flasher.

in PciBus.efi replace 83 3E 06 75 06 C7 06 04 00 00 00 83 3E 07 75 06 C7 06 05 00 00 00 with 66 90 66 90 66 90 66 90 66 90 66 90 66 90 66 90 66 90 66 90 66 90.

If you want to use UEFIPatch

# PciBus | Don't downgrade 64-bit BARs to 32-bit (Haswell)
3C1DE39F-D207-408A-AACC-731CFB7F1DD7 10 P:833E067506C70604000000833E077506C70605000000:66906690669066906690669066906690669066906690

You'll need to do the fix for pad file problem which is in README

@val3nt33n
Copy link
Author

I was getting ready to re-program the chip in case it doesn't boot anymore and to my surprise I found a tiny chip that I don't think I can program(see macro photo attached). My programmer is for a generic(much bigger chip) with fewer pins. Also I don't have USB flashback. The manual suggests that I can upload a new BIOS from a USB drive but inside the BIOS UI. Looks like I was adventuring in all this without any backup.

z97i-plus

@val3nt33n
Copy link
Author

val3nt33n commented Nov 7, 2022

@Tokobotenkai can you try to patch first since your board has dual BIOS?
@cursemex I think you can try it too.

@xCuri0 does the same code exist on Asus Z97-Pro?

@xCuri0
Copy link
Owner

xCuri0 commented Nov 7, 2022

@val3nt33n yes it does (i tried uefipatch it found and patched). There is the pad file problem though but I've written in README how to fix it. Without doing the fix for the pad file you get no boot on Asus boards

@val3nt33n
Copy link
Author

@xCuri0 BTW is there any reason why you are suggesting to use MMTool to do the replacement instead of UEFITool?
I tried both and in the final file they have different size for the PciBus module. Not sure which one is correct. I have UEFITool_0.28.0_win32 and MMTool 4.50.0.23

@xCuri0
Copy link
Owner

xCuri0 commented Nov 7, 2022

MMTool doesn't mess up the pad file like UEFITool does (broken pad file causes no boot). But MMTool can only replace the FFS unlike UEFITool which lets you replace the PE32 executable inside the FFS. Which is why in the README it says to create your modified FFS with UEFITool.

@val3nt33n
Copy link
Author

val3nt33n commented Nov 7, 2022

I see. When I replaced the NvramSmi module I used UEFITool because MMTool did not show the string for NvramSmi (it was empty at the line where it should have been. If I tried to replace that, it stores only a 24B empty module (similar to a pad, but not a pad). NvramSmi is Combined SMM/DXE type, which looks like MMTool can't replace properly.

@Tokobotenkai
Copy link

Tokobotenkai commented Nov 7, 2022

I am going to work soon so probably get back to you guys in about 15-16 hours

But great catch @xCuri0 !

@val3nt33n

here's the hex patch if you want to try it. it probably will work, pcihostbridge seems ok for it but only using 32-64GB range for resource allocation which won't be enough for 32GB BAR cards (eg 3090 or others with more than 16GB of VRAM). They seem to have re-used code from Ivy Bridge because Haswell supports upto 512GB physical address.

in PciBus.efi replace 83 3E 06 75 06 C7 06 04 00 00 00 83 3E 07 75 06 C7 06 05 00 00 00 with 66 90 66 90 66 90 66 90 66 90 66 90 66 90 66 90 66 90 66 90 66 90.

If you want to use UEFIPatch

# PciBus | Don't downgrade 64-bit BARs to 32-bit (Haswell)
3C1DE39F-D207-408A-AACC-731CFB7F1DD7 10 P:833E067506C70604000000833E077506C70605000000:66906690669066906690669066906690669066906690

You'll need to do the fix for pad file problem which is in README

@xCuri0 does that mean that I can use a hex editor to modify the existing BIOS? Just search for the string and replace it.

@val3nt33n
Copy link
Author

I confirm that PciBus | Don't downgrade 64-bit BARs to 32-bit (Haswell) patch works. Thanks a lot @xCuri0
arc control

@val3nt33n
Copy link
Author

I tried some games and none of them work. They crash shortly after they start loading to VRAM.

@xCuri0
Copy link
Owner

xCuri0 commented Nov 10, 2022

@val3nt33n does a driver reinstall help ? me and several other amd users don't have any instability but i think you're the first one to try on windows with Arc.

@val3nt33n
Copy link
Author

I did reinstall the driver (after DDU) and no change. I tried lowering the BAR size and only at 1GB is stable. Above 1GB all games crash.

@xCuri0
Copy link
Owner

xCuri0 commented Nov 10, 2022

@val3nt33n can you send a screenshot showing Device Manager Resources of the GPU with 1GB BAR ? To see if 1GB BAR makes it allocated in the 32-bit space

image

@xCuri0
Copy link
Owner

xCuri0 commented Nov 10, 2022

@cursemex you can try this patch with the 3503 BIOS and 32GB RAM

# PciHostBridge | Replace 32/48GB - 63GB MMIO region with 32/48GB - 128GB (Haswell)
8D6756B9-E55E-4D6A-A3A5-5E4D72DDF772 10 P:3BC3771548BE000000C00F000000482B:3BC3771548BE0000000020000000482B

If that one doesn't work you can try the below one though it's less likely to get 16GB BAR and 32GB RAM working.

# PciHostBridge | Replace 32/48GB - 63GB MMIO region with 32/48GB - 64GB (Haswell)
8D6756B9-E55E-4D6A-A3A5-5E4D72DDF772 10 P:3BC3771548BE000000C00F000000482B:3BC3771548BE0000000010000000482B

@val3nt33n
Copy link
Author

I increased the graphical settings in AC Valhalla(which uses more VRAM) and it crashed even with 1GB

1GB

@xCuri0
Copy link
Owner

xCuri0 commented Nov 10, 2022

@val3nt33n send one with 256MB then. if 256MB still crashes then you need to use the stock BIOS.

@val3nt33n
Copy link
Author

val3nt33n commented Nov 10, 2022

I played with 1GB more(with ultra settings in games). No more crashing so far. 2GB is also stable.

Here's the allocation for 256MB
256MB

and 8GB
8GB

@val3nt33n
Copy link
Author

Most games just crash to desktop without any error. This one did throw an error(using 8GB)
SOTR crash

@val3nt33n
Copy link
Author

val3nt33n commented Nov 10, 2022

Oh well, it was a fun experiment. I don't think this can be fixed.
@Tokobotenkai I'm curious if you have better luck with your A770.

@xCuri0
Copy link
Owner

xCuri0 commented Nov 10, 2022

I don't have much knowledge about how PCIe devices work/memory attributes etc but I do think with the increased popularity of this module these issues will eventually be figured out by others.

@cursemex
Copy link

cursemex commented Nov 10, 2022

@cursemex you can try this patch with the 3503 BIOS and 32GB RAM

# PciHostBridge | Replace 32/48GB - 63GB MMIO region with 32/48GB - 128GB (Haswell)
8D6756B9-E55E-4D6A-A3A5-5E4D72DDF772 10 P:3BC3771548BE000000C00F000000482B:3BC3771548BE0000000020000000482B

If that one doesn't work you can try the below one though it's less likely to get 16GB BAR and 32GB RAM working.

# PciHostBridge | Replace 32/48GB - 63GB MMIO region with 32/48GB - 64GB (Haswell)
8D6756B9-E55E-4D6A-A3A5-5E4D72DDF772 10 P:3BC3771548BE000000C00F000000482B:3BC3771548BE0000000010000000482B

@xCuri0 Okay, I wasn't crazy. I tried the first patch multiple times and got the gpu failure beeping code even with 16gb of ram. Lo and behold, for some reason 4G decode was off according to GPU-Z even though it is turned on in the bios.
I haven't tried to force 4G decode on via bios or EFI.

image

The second patch worked with 14-15 values with both 16GB and 24GB of ram respectively. (32GB caused post errors)
Value 14 at 16GB:
image
image

Value 15 at 24GB:
image
image

@xCuri0
Copy link
Owner

xCuri0 commented Nov 10, 2022

@cursemex does seem like the BIOS doesn't want to allocate to addresses above 64GB (despite haswell supporting upto 512GB). Force enabling 4G decode or anything isn't going to help. It probably could be fixed with a different patch.

Atleast the second patch is working with 16/24GB. Getting 16GB BAR working with 32GB RAM is going to be a challenge it looks like

@Tokobotenkai
Copy link

Tokobotenkai commented Nov 10, 2022

@xCuri0

@Tokobotenkai it's 800000000 (32GB) to fbfffffff (63GB) (PCI Bus 0000:00) which should be good for upto 16GB BAR (given that you have the 16GB patch).

Sorry for taking so long (shift work).

I managed to get another PCIe cable for the A770.

For some reason, I could boot with 16GB ReBar size with the Asrock Intel A380 but it doesn't work with both of my A770s (Intel and Acer's).

I have to reduce the ReBar size to 8GB else it would not even post and once I switched to an old Nvidia card the error message said that the VGA card is not supported by the UEFI driver and CSM was turned on.

I don't have the 16GB patch enabled though. I just did

  • NVRAM replacement
  • ReBar DEX driver
  • 64-bit memory patch.

Does that mean I have to do the 16GB RAM patch?

@val3nt33n
Let me try games, so far Legends of Runeterra on Lutris is working fine, let me install Shadow of the Tomb Raider on Steam and see if it runs.

@xCuri0
Copy link
Owner

xCuri0 commented Nov 10, 2022

@Tokobotenkai You need the 16GB BAR patch "Remove <16GB BAR size limit" otherwise 16GB and larger BARs don't work

@Tokobotenkai
Copy link

@xCuri0 Patched and working somewhat.

I still get the not detected keyboard issue randomly, not too sure if it is the age of the system.

I do get the same UEFI driver errors randomly at 16GB compared to 8GB.

@val3nt33n I am able to run SoTR on Linux natively. Anything vulkan related works fine. OpenGL games are horrible.

@val3nt33n
Copy link
Author

@Tokobotenkai Thanks for checking. I only tried Windows gaming. I guess it's worth trying Linux as well.

@Tokobotenkai
Copy link

@val3nt33n Considering the age of the system, I was actually thinking to try upgrading the RAM from 1333MHz to 2400MHz and maybe the processor to a 4790k. But because I have an existing Ryzen 3600, I wonder if it is worth doing so and instead buy a cheap B450 mainboard+3200MHz RAM because I just want to test the Arc A770 (the former is like 30USD more than the latter).

@val3nt33n
Copy link
Author

@xCuri0 I found the problem that was causing crashes with large BARs. I checked Windows Event log and found that it was running out of virtual memory(pagefile was too small). So, after I increased that no more crashes with 8GB BAR.

event log

@xCuri0
Copy link
Owner

xCuri0 commented Nov 11, 2022

Since everyone here has got resizable BAR working properly I'm closing this issue.

@cursemex still has the problem with 32GB RAM + 16GB BAR but that's a different issue and a new issue for that can be created if needed.

@dsanke
Copy link

dsanke commented Dec 9, 2022

All ASUS 100/200 motherboards which I can find BIOS on ASUS website have the 64-bit downgrade problem(latest BIOS), except Z270-WS and need BIOS version 0602(included) or later.
I guess ASUS fix this problem because someone reported it, which Z270-WS offer quad PCIE x16 via PLX chip so users may have more probability installing lots of high-end GPU on it and found this problem.

@DawgNewb
Copy link

DawgNewb commented Feb 9, 2023

Excuse my ignorance this must really be a simple question for you guy.

I'm on VII Ranger and I got GetLastError: 5
(after press clear_cmos button in my MB (without pulling-off battery) and load up no csm & 4g profile)

  1. Do I need to pull my battery out in order to work? or it's normal circumstance that need below method to fix it?

aasdasd

1234

  1. Can I applied these setting in my VII Ranger 3503 as well?
# PciBus | Remove <16GB BAR size limit (Ivy Bridge/Haswell)
3C1DE39F-D207-408A-AACC-731CFB7F1DD7 10 P:B8FFFFFFFF030000004C3B:B8FFFFFFFFFFFFFF004C3B
# PciBus | Don't downgrade 64-bit BARs to 32-bit (Haswell)
3C1DE39F-D207-408A-AACC-731CFB7F1DD7 10 P:833E067506C70604000000833E077506C70605000000:66906690669066906690669066906690669066906690
# PciHostBridge | Replace 32/48GB - 63GB MMIO region with 32/48GB - 64GB (Haswell)
8D6756B9-E55E-4D6A-A3A5-5E4D72DDF772 10 P:3BC3771548BE000000C00F000000482B:3BC3771548BE0000000010000000482B

This is my VII Ranger 3503 with ReBarDxe.ffs so far.
3503.zip

Thank you. 😄

@xCuri0
Copy link
Owner

xCuri0 commented Feb 10, 2023

@DawgNewb apply all the patches not just the ones you listed. There's one for nvram module fixes this issue. And don't forget to check for and fix pad file issue

@DawgNewb
Copy link

DawgNewb commented Feb 10, 2023

@DawgNewb apply all the patches not just the ones you listed. There's one for nvram module fixes this issue. And don't forget to check for and fix pad file issue

Thank you, I am fairly lost in this bios modding scene.
All I did was adding ReBarDxe.ffs to .CAP and I hope it work but it look like it wouldn't. 🤣

A bit more question about NvramSmi in from @cursemex (Asus Z97 VII Hero) and valip (Link) they were mention about it.

Since I really don't understand what happening here and I'm Asus as well (Z97 VII Ranger), I wonder if I need.

Both UEFIPatch with NvramSmi NVRAM whitelist unlock (by @vit9696) and Older NvramSmi
image
or
Only UEFIPatch with NvramSmi NVRAM whitelist unlock (by @vit9696) is enough to fix.

❤ Thanks again.

@DawgNewb you only need the UEFIPatch

The thing of replacing module with old one was used before the patch was discovered

That nice. I'll report it again, I'm currently sick and need some rest. 🛌

@xCuri0
Copy link
Owner

xCuri0 commented Feb 10, 2023

@DawgNewb you only need the UEFIPatch

The thing of replacing module with old one was used before the patch was discovered

@DawgNewb
Copy link

DawgNewb commented Feb 19, 2023

Hello again.
It's now appear (32 in ReBarState.exe) although no game test yet I'll report if anything happen.

image
image
image

Not sure why but it's quite crash often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bios issue with firmware that needs patching help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants