Jump to content
vit9696

AptioMemoryFix

604 posts in this topic

Recommended Posts

Posted (edited)

I booted with a Debug build. These are the devirt log outputs:

OCABC: MMIO devirt start
OCABC: MMIO devirt 0xE0000000 (0x10000 pages, 0x800000000000100D) skip 0
OCABC: MMIO devirt 0xFE000000 (0x11 pages, 0x8000000000000001) skip 0
OCABC: MMIO devirt 0xFEC00000 (0x1 pages, 0x800000000000100D) skip 0
OCABC: MMIO devirt 0xFED00000 (0x4 pages, 0x800000000000100D) skip 0
OCABC: MMIO devirt 0xFEE00000 (0x1 pages, 0x8000000000000001) skip 0
OCABC: MMIO devirt 0xFF000000 (0x1000 pages, 0x800000000000100D) skip 0
OCABC: MMIO devirt end, saved 278620 KB
OCABC: Only 174/256 slide values are usable!
OCABC: Valid slides - 0-131, 203-244

 

It seems that everything is working, right? So I should not use ProtectUefiServices, right?

Edited by r!ppz

Share this post


Link to post
Share on other sites
Advertisement
Posted (edited)
On 5/27/2018 at 6:06 PM, Pene said:

Hello vit9696,

 

I noticed on my system that I cannot boot to linux when AptioMemoryFix (latest) is loaded before grub starts.

Grub (UEFI) manages to start properly, but the system hangs when it boots the linux distro (Ubuntu in my case).

When AptioMemoryFix is not loaded, Ubuntu starts without problems.

(I'm unsure if this happens only on my system, or only with ubuntu, or if this is more widespread. I'm on a pure UEFI system, no CSM)

On 5/27/2018 at 6:26 PM, vit9696 said:

Hi,

The issue indeed is (was) unknown, yet I suppose it should not happen.

 

Firstly, may I ask you to provide more details about your installation? I.e. Ubuntu version, architecture installation method, why did you use grub (I thought Linux supports native EFI loading?), anything you may find important. It will be great to have a virtual machine (e.g. VMware) where the issue could be reproduced (i.e. by loading AptioMemoryFix from UEFI Shell and then starting grub). Also, do you see any messages from your Linux distro? It should also have some kind of panic log (via serial or swap), which might be helpful if you can get it.

 

Secondly, I could suggest you to do some debugging that may possibly hint where the problem is. Could you go to AptioMemoryFix.c and 

https://github.com/vit9696/AptioFixPkg/blob/master/Platform/AptioMemoryFix/AptioMemoryFix.c#L109 and try commenting the shim installation lines?


  InstallRtShims (GetVariableCustomSlide);
  InstallBsOverrides ();
  InstallRtOverrides ();

That would break macOS, but it should pretty certainly fix Linux. If it does, try finding which exact line breaks it (i.e. by uncommenting).

 

Similarly after you find the culprit you could step further and narrow it down to the exact function:

https://github.com/vit9696/AptioFixPkg/blob/master/Platform/AptioMemoryFix/RtShims.c#L126


    gRT->GetVariable               = (EFI_GET_VARIABLE)((UINTN)gRtShims              + ((UINTN)&RtShimGetVariable          - (UINTN)&gRtShimsDataStart));
    gRT->SetVariable               = (EFI_SET_VARIABLE)((UINTN)gRtShims              + ((UINTN)&RtShimSetVariable          - (UINTN)&gRtShimsDataStart));
    gRT->GetNextVariableName       = (EFI_GET_NEXT_VARIABLE_NAME)((UINTN)gRtShims    + ((UINTN)&RtShimGetNextVariableName  - (UINTN)&gRtShimsDataStart));
    gRT->GetTime                   = (EFI_GET_TIME)((UINTN)gRtShims                  + ((UINTN)&RtShimGetTime              - (UINTN)&gRtShimsDataStart));
    gRT->SetTime                   = (EFI_SET_TIME)((UINTN)gRtShims                  + ((UINTN)&RtShimSetTime              - (UINTN)&gRtShimsDataStart));
    gRT->GetWakeupTime             = (EFI_GET_WAKEUP_TIME)((UINTN)gRtShims           + ((UINTN)&RtShimGetWakeupTime        - (UINTN)&gRtShimsDataStart));
    gRT->SetWakeupTime             = (EFI_SET_WAKEUP_TIME)((UINTN)gRtShims           + ((UINTN)&RtShimSetWakeupTime        - (UINTN)&gRtShimsDataStart));
    gRT->GetNextHighMonotonicCount = (EFI_GET_NEXT_HIGH_MONO_COUNT)((UINTN)gRtShims  + ((UINTN)&RtShimGetNextHighMonoCount - (UINTN)&gRtShimsDataStart));
    gRT->ResetSystem               = (EFI_RESET_SYSTEM)((UINTN)gRtShims              + ((UINTN)&RtShimResetSystem          - (UINTN)&gRtShimsDataStart));

https://github.com/vit9696/AptioFixPkg/blob/master/Platform/AptioMemoryFix/ServiceOverrides.c#L124


  gBS->AllocatePages      = MOAllocatePages;
  gBS->GetMemoryMap       = MOGetMemoryMap;
  gBS->ExitBootServices   = MOExitBootServices;
  gBS->HandleProtocol     = MOHandleProtocol;
  gBS->StartImage         = MOStartImage;

https://github.com/vit9696/AptioFixPkg/blob/master/Platform/AptioMemoryFix/ServiceOverrides.c#L143


gRT->SetVirtualAddressMap = MOSetVirtualAddressMap;

Once we know the details I should hopefully be able to provide some help. Also, does Windows work fine?

Hi,

 

I think this issue is back with (latest) OpenRuntime.

https://github.com/CloverHackyColor/CloverBootloader/issues/96

Edited by Pene

Share this post


Link to post
Share on other sites
On 10/12/2019 at 10:59 AM, Killuminati91 said:

Can anyone help me through this? I am kinda lost here, I tried all different aptiofix drivers.

I recommend you to try opencore with ProtectUEFIServices and DevirtualizeMMIO, you can also use those quirks with OcQuirks.plist but i recommend using OpenCore.

 

Also, can you please extract your tables using F4 from the CLOVER GUI and post here your origin folder please?

 

Thanks.

 

Share this post


Link to post
Share on other sites
Posted (edited)
On 3/26/2020 at 11:42 AM, 1Ale1 said:

I recommend you to try opencore with ProtectUEFIServices and DevirtualizeMMIO, you can also use those quirks with OcQuirks.plist but i recommend using OpenCore.

 

Also, can you please extract your tables using F4 from the CLOVER GUI and post here your origin folder please?

 

Thanks.

 

 

Heyo, ditched the S740 but swapped it for a S940 which just arrived. Same processor. Attached the first clover dump. Will begin working on this one tonight.

 

----------------------------------------------------

 

So this is my current setup:

Lenovo S940



i7-1065g7

16GB RAM

512GB NVME SSD

 

Bios, everything kept on initial values except:

BIOS Backflash: Enabled



Flip to Boot: Disabled

Application Policy: Disabled

Intel Platform Trust Technology: Disabled

Secure Boot: Disabled

 

Created an installer drive with Catalina 10.15.4 and Clover. SMBios: Macbook Pro 15,4 (as the 2020 air is not available yet). All necessary SSDT's generated and modified according to my DSDT dump. Using OCQuirks instead of aptiofixes, enabled "ProtectUEFIServices" and "DevirtualizeMMIO"

 

STATUS: Stuck at "+++++++" which looks a bit different now than previously.

 

Attached "origin", "CLOVER" and a screenshot of the verbose output.

origin Lenovo S940.zip

EFI.zip

IMG_0234.jpg

Edited by Killuminati91

Share this post


Link to post
Share on other sites
Posted (edited)

I imagine you need to fix your CPU setup as there are no macs with 10th gen i7s (or any 10th gen for that matter). Also it looks like it is failing to create and load the modified prelinked kernel.

 

EDIT: Also it looks like you are booting directly from the installer image, which means that you probably can't write to the disk which is needed for the modified prelinked kernel.

Edited by apianti

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, apianti said:

I imagine you need to fix your CPU setup as there are no macs with 10th gen i7s (or any 10th gen for that matter). Also it looks like it is failing to create and load the modified prelinked kernel.

 

EDIT: Also it looks like you are booting directly from the installer image, which means that you probably can't write to the disk which is needed for the modified prelinked kernel.

 

Any way to SPOOF the CPU on OpenCore?

 

This is my latest result, shifted from Clover to OpenCore because of issues in recent clover builds.

 

307:451 00:093 OCB: Performing OcShowSimpleBootMenu... 0
307:543 00:092 OCB: BootNext has not been found
307:650 00:106 OCB: BootOrder is unavailable - Not Found
307:742 00:092 OCB: Initial default is 0, fallback
321:469 13:726 OCB: Should boot from Install macOS Catalina (T:2|F:0|DEF:0)
321:569 00:100 OCB: Perform boot Install macOS Catalina to dp PciRoot(0x0)/Pci(0x14,0x0)/USB(0x0,0x0)/HD(2,GPT,4CE3D327-4F1C-48A6-ABB3-CBE00EC1A5D6,0x64028,0x38A3AD8)/\System\Library\CoreServices\boot.efi (0/0)
321:980 00:411 OCB: Matching <> args on type 2 0
322:075 00:094 OCABC: Recovering trashed GetMemoryMap pointer
322:186 00:110 OCOS: OS set: <null> Mac OS X 10.15
322:283 00:097 OCOS: OS set: Apple Inc. Mac OS X 10.15
322:747 00:463 Trying XNU hook on System\Library\PrelinkedKernels\prelinkedkernel.development
322:911 00:164 Kext reservation size 6266880
338:197 15:285 Result of XNU hook on System\Library\PrelinkedKernels\prelinkedkernel.development is Success
338:303 00:106 OC: Read kernel version 19.0.0 (190000)
338:397 00:093 OCAK: Replacing _xcpm_core_scope_msrs data 226 76
338:501 00:104 OCAK: Replacing _xcpm_core_scope_msrs data 226 13200
338:594 00:092 OCAK: Replacing _xcpm_core_scope_msrs data 226 16384
338:686 00:092 OCAK: Not matching _xcpm_core_scope_msrs data 46 29660
338:787 00:100 OCAK: XcpmCfgLockRel replace count - 2
338:899 00:112 OCAK: PanicKextDump replace count - 1
338:991 00:091 OCAK: Patch success kext dump
339:094 00:103 OCAK: PowerStateTimeout replace count - 1
339:196 00:101 OCAK: Patch success power state
339:319 00:123 OCAK: AppleCpuPmCfgLock v1 replace count - 10
339:412 00:092 OCAK: Patch v1 success com.apple.driver.AppleIntelCPUPowerManagement
339:504 00:092 OCAK: AppleCpuPmCfgLock v2 replace count - 0
339:600 00:095 OCAK: RemoveUsbLimitIoP1 replace count - 1
339:692 00:092 OCAK: Patch success com.apple.iokit.IOUSBHostFamily
339:794 00:102 OCAK: RemoveUsbLimitV2 replace count - 1
339:894 00:099 OCAK: Patch success com.apple.driver.usb.AppleUSBXHCI
339:986 00:092 OCAK: AppleIoMapper replace count - 1
340:080 00:094 OCAK: Patch success com.apple.iokit.IOPCIFamily AppleIoMapper
340:191 00:110 OC: Prelink injection Lilu.kext () - Success
340:291 00:100 OC: Prelink injection VirtualSMC.kext () - Success
340:390 00:099 OC: Prelink injection NVMeFix.kext () - Success
340:505 00:114 OC: Prelink injection USBInjectAll.kext () - Success
340:607 00:101 OC: Prelink injection WhateverGreen.kext () - Success
340:760 00:152 Prelinked status - Success
340:864 00:103 OCSMC: SmcReadValue Key 4D535463 Size 1
340:958 00:094 OCSMC: SmcReadValue Key 4D534163 Size 2
341:051 00:092 OCABC: MMIO devirt start
341:143 00:091 OCABC: MMIO devirt end, saved 0 KB

 

Slide=90 does its job, but it is still just hanging at that point, refusing to go on.

 

329802139_Bildschirmfoto2020-04-09um13_13_55.thumb.png.6b89d107ff0e631386ad48d90a5d0f33.png

EFI.zip

opencore-2020-04-09-130243.txt

Edited by Killuminati91

Share this post


Link to post
Share on other sites
On 4/9/2020 at 1:39 AM, apianti said:

I imagine you need to fix your CPU setup as there are no macs with 10th gen i7s (or any 10th gen for that matter).

The MacBook Air 2020 has Ice Lake 10th gen i3 or i5 with Gen11 graphics supporting DisplayPort 1.4 and DSC.

Share this post


Link to post
Share on other sites
On 4/10/2020 at 10:21 PM, joevt said:

The MacBook Air 2020 has Ice Lake 10th gen i3 or i5 with Gen11 graphics supporting DisplayPort 1.4 and DSC.

 

@Killuminati91 we managed to workaround the problem you had here

On 4/1/2020 at 5:09 PM, Killuminati91 said:

STATUS: Stuck at "+++++++" which looks a bit different now than previously.

 

You just needed to Add ProtectUefiServices=true, DevirtualizeMMIO=true, enablewriteunprotector=FALSE (on the laptop in question which is the same as mine which has MAT support according to the OpenCore log.) and RebuildAppleMemoryMap=True and SyncRuntimePermissions=true.

 

I have a lenovo Yoga S740, with the i7 1065G7 (pretty much the same CPU as the MacBookAir9,1 which has only a different SKU, "i7 1060NG7" but it's the same chip) - a little O.T, i managed to unlock the MSR 0xE2 register on this machine by manually editing the parameter "01" at the offset 0x43 from bios, changed it to "00" and confirmed by VerifyMsrE2.efi, so in the EFI attached you won't find AppleXCPMCfgLock.

 

This was the situation at first glance

 

index.thumb.jpg.656d3f493225367c9b58fc19c5067b29.jpg

 

 

We've also found by checking the DSDT that the USBs are defined in then DSDT and we also discoveredthe thunderbolt controller is embedded in the CPU. With ReleaseUSBOwnership (Clover equivalent would be FixOwnership) we sometimes managed to skip this issue as well.

 

 

index1.thumb.jpg.dce81c521bbd78696831700687d369ab.jpg

 

 

But...

No luck so far with Ice Lake, I'm trying to make it boot but I'm getting always the same errors, either stalls at Pci Configuration End,

or Kernel Panics on "FaultCR2" (i have also tried with fixHeaders with clover, also tried different clover versions, also tried all what i said before with only fakeSMC which is independent and requires no plugins), but here's the result

 

index2.thumb.jpg.b13057e47789b7517a40e55c3edcc4ce.jpg

 

 

When trying with VirtualSMC + Lilu and Clover however, we haven't been able to boot yet, even with -igfxvesa and a fakeCPUID.

 

index3.thumb.jpg.72faa6d4cc213d166f7a02207004b9d9.jpg

 

We've also tried OpenCore, but still the issue persists either on that kernel panic if the DSDT is loaded, or stalls at

 

PCI configuration End here

 

1935476778_Screenshot2020-04-12at22_24_06.thumb.png.b29152d1e452df9106ddef9fbd1ffb46.png

 

Or when loading the DSDT here (this is the furthest we've gone so far) with WeG Lilu and Virtual SMC compiled at the latest commit today at 21:00 (GMT +1:00)

 

inde6x.thumb.jpg.e9aa8307c5e5496188b4790e9d64a317.jpg

 

I attach here the EFI.zip and the screenshots. We managed to find some workarounds to this issue by hiding the thunderbolt from devices/properties, and also to solve the battery ACPI alert by editing the DSDT, but still stuck here.

 

Could we assume that the issue is the CPU itself?

 

@vit9696 Is ice Lake fully supported in this situation or do we need to wait for the release of the new OpenCore 0.5.8 and new Kexts such as Lilu 1.4.4, the new WeG 1.3.9 and virtualSMC 1.1.3?

 

Maybe something more needs to be added in those libraries and on OpenCore or is everything dependent upon Catalina to support this CPU?

 

And what about the Iris Plus Graphics (the intel G7)?

 

I've seen that these days @Andrey1970 has updated the manuals (FAQ.Intel.en.md) but still we don't have framebuffers with fbmem different from Zero yet? (but this is another story since here we're still stuck on this kernel panic).

 

I'm stuck here, but I don't know what the problem could be.

 

Any help is highly appreciated, also lots of this work was made by the awesome community at macos86.it

image.png

Share this post


Link to post
Share on other sites
Posted (edited)

@1Ale1 Thanks for the huge update. I am currently trying this guide, seems like they got it documented a bit.

 

I've found the values for CFG Lock (0x43), DVMT prealloc (0xA4) and DVMT Total (0xA5) in my Bios. I CAN modify CFG Lock to 0x00, it is still turned on according to VerifyMSRE2 though.

Stolenmem and Maxmem can not be modified by the shell, seems like there is a protection in place (cant set variable using efi).

 

Which shell did you use?

 

Unlocking the advanced bios menu could help us get further, but I have found no combination that works for me. Even setting the var (0x467) I found in my bios to unlock it does not show it.

Edited by Killuminati91

Share this post


Link to post
Share on other sites
On 4/13/2020 at 7:56 AM, Killuminati91 said:

Unlocking the advanced bios menu could help us get further, but I have found no combination that works for me. Even setting the var (0x467) I found in my bios to unlock it does not show it

I used the official utility from InsydeH2O (the bios company manufacturer)

 

Guide here: https://translate.google.com/translate?hl=&sl=zh-CN&tl=en&u=https%3A%2F%2Fgithub.com%2Flietxia%2FXiaoXinAir14IML_2019_hackintosh%2Fwiki%2FDVMT

 

please be careful not to brick your laptop, I followed the command line method with UVETool (inside the zip file in the guide you'll find two tools, use UVETool only, you do not need to care about the other one inside the package)

Share this post


Link to post
Share on other sites

Whenever I enable the integrated graphics of my I9-9900K (in addition to my dGPU and TB3 Titan Ridge) Open Core hangs after exiting boot services:

C822AA39-4DDE-49AA-B4FD-A62E2B94A53D_1_105_c.thumb.jpeg.82637ab2e749df6a93137608971118ee.jpeg

 

This is where it hangs forever. Enabled booter quirks:

AvoidRuntimeDefrag

DevirtualiseMmio

ProvideCustomSlide

ProtectUefiServices

RebuildAppleMemoryMap

SyncRuntimePermissions

 

Any ideas?

Share this post


Link to post
Share on other sites
Posted (edited)

Hello guys,

Another lost soul here. Following a wip guide I was able to "almost boot the installer". After this screen I end up with Stop sign and scrambled text. It seems that Catalina doesn't recognize my USB controller. Correct PCIID is injected via kext.

I have attached my EFI folder and boot log.

My hardware:

Razer Blade Stealth Mercury Wihte(The version w/o dedicated gpu)
CPU: IceLake i7 1065G7
GPU: Intel Iris Plus Graphics G7
RAM: 16GB(onboard)
HD: Samsung PM981/PM961 nvme
Motherboard Chipset: Intel 495
Audio Codec: ALC298
Ethernet Card: N/A
Wifi/BT Card: DW1560

 

EFI.ZIP

opencore-2020-04-13-193150.txt

IMG_20200413_192621.jpg

Edited by zyt

Share this post


Link to post
Share on other sites

Hello guys, I have a Lenovo ideapad s145 with i7 1065g7 too and I'm using open core. It gets stuck here. Any tips to solve it? Thank you guys. I uploaded my efi folder.  

photo_2020-04-21 00.55.22.jpeg

EFI.zip

Share this post


Link to post
Share on other sites
On 4/10/2020 at 4:21 PM, joevt said:

The MacBook Air 2020 has Ice Lake 10th gen i3 or i5 with Gen11 graphics supporting DisplayPort 1.4 and DSC.

 

That is true... But I was just being specious and was referring to the SMBIOS models that have support. I don't think there was any support when I made that comment. There might be now, I don't know, been preoccupied. Looks like there is not though from following previous posts.

Share this post


Link to post
Share on other sites
On 4/10/2020 at 10:21 PM, joevt said:

The MacBook Air 2020 has Ice Lake 10th gen i3 or i5 with Gen11 graphics supporting DisplayPort 1.4 and DSC.

But do they run mainline macOS already?

Share this post


Link to post
Share on other sites

one question, has anyone had luck with icelake so far?

Looking at the tests done above, nobody yet managed to boot...

Could it be a drivers/kext/bootloader issue?

 

On 4/14/2020 at 4:02 PM, r!ppz said:

AvoidRuntimeDefrag

DevirtualiseMmio

ProvideCustomSlide

ProtectUefiServices

RebuildAppleMemoryMap

SyncRuntimePermissions 

  

Any ideas?

So without the iGPU enabled youre fine with those?

Can you post which of them are you using right now?

 

Maybe you need to play around with the Quirks, try with EnableWriteUnprotector True and RebuildAppleMemorymap and SyncRUntimepermissions false on OC, or use OcQuirks even if i recommend to use OpenCore. Then, same test with all three of them enabled, but i doubt it will work.

I think there's not enough space on that chipset, Z390 is famous to have {censored} memory maps...

 

Share this post


Link to post
Share on other sites
4 hours ago, Download-Fritz said:

But do they run mainline macOS already?

 

This is my thought as well, there's very low probability that these machines aren't using a newer build than the main app store channel. I don't think the support is there yet...

Share this post


Link to post
Share on other sites
7 hours ago, joevt said:

I think the MacBook Air 2020 came with 10.15.3 but 10.15.4 is the mainline so it should be good?
https://everymac.com/systems/apple/macbook-air/specs/macbook-air-core-i7-1.2-quad-core-13-retina-display-2020-scissor-specs.html

 

version numbers do not matter, maybe that's not well known, but Macs with brandnew hardware often ship with customised macOS builds and may even get customised updates for a short while. Once mainline macOS has support, the models are moved

Share this post


Link to post
Share on other sites
15 hours ago, Download-Fritz said:

version numbers do not matter, maybe that's not well known, but Macs with brandnew hardware often ship with customised macOS builds and may even get customised updates for a short while. Once mainline macOS has support, the models are moved

You are saying that if I downloaded the 10.15.4 installer that it would not work to create a clean install on the MacBook Air 2020?

 

My Mac mini 2018 with 10.15.4 at least contains Ice Lake drivers "AppleIntelICL*". My other Mac with 10.15.3 does not.

Share this post


Link to post
Share on other sites
18 hours ago, joevt said:

You are saying that if I downloaded the 10.15.4 installer that it would not work to create a clean install on the MacBook Air 2020?

 

I'm actually not sure how it behaves, I think for some time mainline versions would not even have new hardware boot IDs listed such that they refused to boot the installers. Internet Recovery and such work based off the model IDs, you may not get served mainline builds from there.

I don't know of the support state of ICL, but nice to hear things appeared in mainline, whether that's all or not.

Share this post


Link to post
Share on other sites
On 5/2/2020 at 11:27 AM, Download-Fritz said:

I don't know of the support state of ICL, but nice to hear things appeared in mainline, whether that's all or not.

The driver I see in 10.15.4 contains ICLLP in the name. LP could mean Low Power. It could mean there's a High Power variant that is not supported. We won't know until someone tries. I haven't seen Hackintosh success on Ice Lake from anyone yet (I haven't really looked though).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×