csmwrap icon indicating copy to clipboard operation
csmwrap copied to clipboard

No setting to disable above 4g decoding?

Open RaymiiOrg opened this issue 6 months ago • 22 comments

I can't find anything to disable above 4G decoding in the setup of my device. (HP zBook).

I did find an issue about bar relocating (#42). However I don't funny understand all this.

If that issue is solved, would that mean that it's no longer needed to disable that setting?

Or is there some thing else I can try?

RaymiiOrg avatar Jun 03 '25 19:06 RaymiiOrg

Hi @RaymiiOrg,

You're correct that the option to disable "Above 4G Decoding" is often found in the UEFI firmware settings, but its availability depends on the system vendor and model. On some devices, like certain HP ZBook models, this setting might not be present at all.

As noted in the README, it's important to disable "Above 4G Decoding", "Resizable BAR", and "Smart Access Memory" to ensure compatibility with legacy VBIOS. These features can cause the GPU's (or PCIe in general) memory to be mapped above the 4GB address space, which isn't accessible in legacy BIOS mode, potentially leading to issues.

"Above 4G Decoding" allows 64-bit PCIe devices to use addresses in the 64-bit address space. Since 32-bit operating systems cannot access that space, this option exists mainly for compatibility. In most cases, it does not need to be enabled. In my experience, most motherboards default to having this setting turned off.

Regarding issue #42 on BAR relocation: it's still open and hasn't been implemented yet. Once resolved, it might help make "Above 4G Decoding" less of a concern. Until then, disabling it (if possible) remains necessary.

FarelRA avatar Jun 03 '25 22:06 FarelRA

"Above 4G Decoding" allows 64-bit PCIe devices to use addresses in the 64-bit address space. Since 32-bit operating systems cannot access that space, this option exists mainly for compatibility. In most cases, it does not need to be enabled. In my experience, most motherboards default to having this setting turned off.

Yeah, but all those motherboards which do have the setting and/or have it defaulted to off are older motherboards which have CSM built-in already, on which CSMWrap is of limited usefulness...

It is essential to finish implementing #42, else, dare I say, CSMWrap is 20% as useful as it can be. In short this issue is somewhat of a duplicate of #42.

mintsuki avatar Jun 04 '25 08:06 mintsuki

I did find an issue about bar relocating (#42). However I don't funny understand all this.

If that issue is solved, would that mean that it's no longer needed to disable that setting?

Assuming we get it working properly, yes.

mintsuki avatar Jun 04 '25 08:06 mintsuki

Some platforms will move BAR to under 4G if they see a OpROM on devices, some others doesn't have above 4G non-prefetchable memory at all (all high bars are prefetchable).

So it really depends, I know many machines working fine without disabling it.

FlyGoat avatar Jun 04 '25 09:06 FlyGoat

I tested xp32 and works same if Memory Remap Enabled or Disabled: https://msfn.org/board/topic/186793-csmwrap-boot-csm-on-uefi-only-systems/page/10/#findComment-1280453

Gelip avatar Jun 06 '25 16:06 Gelip

Update: we've done some work to get PCI relocation up and running, could anyone interested please try this:

csmwrap.efi.gz

NOTE: The .gz extension is fake, please just rename the file to omit it.

mintsuki avatar Jun 11 '25 15:06 mintsuki

@mintsuki I test this on Haswell but not good:

  • xHCI still not work
  • yellow exclamation mark in XP32 on PCIe graphics card and on integrated LAN

Gelip avatar Jun 11 '25 16:06 Gelip

Doesn't seem to work on my HP zBook device. Last output is

Image

First attempt gave a DMA Protection error.

Image

When I disabled that in the uefi setup, nothing changed as far as seabios.

Happy to try more builds or test other stuff.

RaymiiOrg avatar Jun 11 '25 16:06 RaymiiOrg

No improvement here either I'm afraid.

PluMGMK avatar Jun 11 '25 17:06 PluMGMK

@Gelip @RaymiiOrg @PluMGMK could you please try this one and report back any video output logging?

csmwrap.efi.gz

mintsuki avatar Jun 12 '25 02:06 mintsuki

@mintsuki Same as before :-(

Gelip avatar Jun 12 '25 04:06 Gelip

@mintsuki EHCI can not work , can not boot on nvme, only sata disk can work on Z890 Image

Canonkong avatar Jun 12 '25 05:06 Canonkong

@Gelip @RaymiiOrg @PluMGMK could you please try this one and report back any video output logging?

csmwrap.efi.gz

The output is different:

Image

After about 30 seconds it reboots.

I'm also booting from an (internal) NVMe drive. My device has no SATA disks.

RaymiiOrg avatar Jun 12 '25 05:06 RaymiiOrg

@Gelip @RaymiiOrg @PluMGMK could you please try this one and report back any video output logging?

csmwrap.efi.gz

It actually passed all the way down to SeaBIOS, but then got stuck with "problem" when any usb ports become disabled, therefore "no bootable device" error appears

Gadel9152 avatar Jun 12 '25 08:06 Gadel9152

Again, I'm pretty sure this is trying to solve a different problem (BAR locations) to the one I have (SeaBIOS not being able to drive Haswell xHCI), so I don't think I'm adding much to this conversation. This one took a lot longer to get to SeaBIOS (it gave a lot of output and hung for several seconds) but once it got there the result was the same (USB keyboard goes dead).

PluMGMK avatar Jun 12 '25 17:06 PluMGMK

Found this link - https://github.com/xCuri0/ReBarUEFI/wiki/Enabling-hidden-4G-decoding. To disable just invert values. The main problem it is individual and no guaranty.

NewcomerAl avatar Jul 01 '25 16:07 NewcomerAl

Found this link - https://github.com/xCuri0/ReBarUEFI/wiki/Enabling-hidden-4G-decoding. To disable just invert values. The main problem it is individual and no guaranty.

For me that sucks a bit because I found out pretty late that it can't be disabled on my 2023 Lenovo V14 G4, you can only move the MMIO up and down the address space

However during this exploration I found out you can directly change these hidden settings from Smokeless UMAF on laptops like mine (the section extracted literally was accessible from the menus of the utility) and gain a lot of time.

EDIT : I tried all of this because I wanted to install MS-DOS natively, I know this may seem dumb but I wanted to push the limits of retrocompatibility farther than anyone could

ff66theone avatar Aug 04 '25 20:08 ff66theone

Found this link - https://github.com/xCuri0/ReBarUEFI/wiki/Enabling-hidden-4G-decoding. To disable just invert values. The main problem it is individual and no guaranty.

For me that sucks a bit because I found out pretty late that it can't be disabled on my 2023 Lenovo V14 G4, you can only move the MMIO up and down the address space

If you can move it to under 4G than it would work. We just want to make sure every boot device got MMIO under 4G. Leaving decoding functionality on is fine (despite Windows XP may have acpi issue.)

However during this exploration I found out you can directly change these hidden settings from Smokeless UMAF on laptops like mine (the section extracted literally was accessible from the menus of the utility) and gain a lot of time.

EDIT : I tried all of this because I wanted to install MS-DOS natively, I know this may seem dumb but I wanted to push the limits of retrocompatibility farther than anyone could

FlyGoat avatar Aug 08 '25 11:08 FlyGoat

Found this link - https://github.com/xCuri0/ReBarUEFI/wiki/Enabling-hidden-4G-decoding. To disable just invert values. The main problem it is individual and no guaranty.

For me that sucks a bit because I found out pretty late that it can't be disabled on my 2023 Lenovo V14 G4, you can only move the MMIO up and down the address space

If you can move it to under 4G than it would work. We just want to make sure every boot device got MMIO under 4G. Leaving decoding functionality on is fine (despite Windows XP may have acpi issue.)

However during this exploration I found out you can directly change these hidden settings from Smokeless UMAF on laptops like mine (the section extracted literally was accessible from the menus of the utility) and gain a lot of time.

EDIT : I tried all of this because I wanted to install MS-DOS natively, I know this may seem dumb but I wanted to push the limits of retrocompatibility farther than anyone could

Yes, however here comes the issue Lenovo took a perfectly fine AMI UEFI and massacred it, you can still see the unused CSM DXEs in the BIOS update capsule And when it comes to the MMIO above 4GB, you can't move it closer than 35 bits and farther than 48 bits. Any closer WILL require a BIOS patch though I'm not sure of the way I should do this. One way I could implement the patch could be by adding additional entries for 32-34 bits, but there is a chance the BIOS was so badly coded that it would not handle gracefully...

UPDATE : I may have a patch for my BIOS, I only had to patch 2 bytes (and some more for aesthetic reasons) A bit of hex editing was involved, but nothing was really hard to do Image

UPDATE 2 : Guys I need your help, because I'm unable to flash the modified BIOS. I have BIOS flashback enabled, but it looks like the update program checks a signature or something before actually flashing, so I don't know if I can manually flash it or something. Also I've checked the checksums and they're all OK.

ff66theone avatar Aug 10 '25 00:08 ff66theone

@Gelip @RaymiiOrg @PluMGMK could you please try this one and report back any video output logging?

csmwrap.efi.gz

Doesn't work on my Lenovo Legion 7 16ACHG6.

Image

ghost avatar Aug 19 '25 11:08 ghost

@mintsuki

Hello! You can make your CSMWrap modification for CSMWrap version 1.3.0. You have more new developments on CSMWrap modification for today. Your latest version doesn't work for me either. I'm booting from USB

RUSSTARUS avatar Aug 28 '25 14:08 RUSSTARUS

@mintsuki

Hello! Please take a look at this topic: https://github.com/FlyGoat/CSMWrap/issues/118 Can you include this in the new version and compile it?

RUSSTARUS avatar Sep 23 '25 14:09 RUSSTARUS