csmwrap
csmwrap copied to clipboard
No setting to disable above 4g decoding?
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?
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.
"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.
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.
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.
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
Update: we've done some work to get PCI relocation up and running, could anyone interested please try this:
NOTE: The .gz extension is fake, please just rename the file to omit it.
@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
Doesn't seem to work on my HP zBook device. Last output is
First attempt gave a DMA Protection error.
When I disabled that in the uefi setup, nothing changed as far as seabios.
Happy to try more builds or test other stuff.
No improvement here either I'm afraid.
@Gelip @RaymiiOrg @PluMGMK could you please try this one and report back any video output logging?
@mintsuki Same as before :-(
@mintsuki
EHCI can not work , can not boot on nvme, only sata disk can work on Z890
@Gelip @RaymiiOrg @PluMGMK could you please try this one and report back any video output logging?
The output is different:
After about 30 seconds it reboots.
I'm also booting from an (internal) NVMe drive. My device has no SATA disks.
@Gelip @RaymiiOrg @PluMGMK could you please try this one and report back any video output logging?
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
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).
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.
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
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
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
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.
@Gelip @RaymiiOrg @PluMGMK could you please try this one and report back any video output logging?
Doesn't work on my Lenovo Legion 7 16ACHG6.
@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
@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?