Jump to content

Clover General discussion


ErmaC
30,171 posts in this topic

Recommended Posts

why the latest commit to ignore OpenRuntime.efi? caused an issue for me.

 

I understand skiping OcQuirks.efi (as that is built-in now). But seems that many will need either OpenRuntime OR AptioMemoryFix or the other options?

$ ls -l /opt/Source/Clover/CloverPackage/CloverV2/EFI/CLOVER/drivers/off/UEFI/MemoryFix

total 184

-rw-rw-r--  1 tluck  wheel  30432 Oct  9 10:18 AptioMemoryFix.efi

-rw-rw-r--  1 tluck  wheel   7232 Oct  9 10:18 OpenRuntime.efi

-rw-rw-r--  1 tluck  wheel  23072 Oct  9 10:18 OsxAptioFix3Drv.efi

-rw-rw-r--  1 tluck  wheel  23040 Oct  9 10:18 OsxAptioFixDrv.efi

-rw-rw-r--  1 tluck  wheel   3840 Oct  9 10:18 OsxLowMemFixDrv.efi

 

  DirIterOpen(&self.getCloverDir(), Path, &DirIter);
  while (DirIterNext(&DirIter, 2, L"*.efi", &DirEntry)) {
    Skip = (DirEntry->FileName[0] == L'.');
    for (size_t i=0; i<gSettings.DisabledDriverArray.size(); i++) {
      if (StrStr(DirEntry->FileName, gSettings.DisabledDriverArray[i].wc_str()) != NULL) {
        Skip = TRUE;   // skip this
        break;
      }
    }
    if (Skip) {
      continue;
    }
    if ( LStringW(DirEntry->FileName).containsIC("OcQuirks") ) {
      continue;
    }
    if ( LStringW(DirEntry->FileName).containsIC("AptioMemoryFix") ) {
      continue;
    }
    if ( LStringW(DirEntry->FileName).containsIC("OpenRuntime") ) {
      continue;
    }

and what about this - isn't skip with harsh warning better than a panic?

+ it might be good to mention when a driver is present but skipped?

 

if ( OSTYPE_IS_OSX(LoaderType) || OSTYPE_IS_OSX_RECOVERY(LoaderType) || OSTYPE_IS_OSX_INSTALLER(LoaderType) ) {

  {
    EFI_HANDLE Interface = NULL;
    Status = gBS->LocateProtocol(&gAptioMemoryFixProtocolGuid, NULL, &Interface );
    if ( !EFI_ERROR(Status) ) {
      panic("Remove AptioMemoryFix.efi and OcQuirks.efi from your driver folder\n");
    }
  }

 

Edited by tluck
Link to comment
Share on other sites

I test with as config.plist with mojave ( and r5123.pkg):

 

I lost  screen display, and no change is anymore possible (including applications)

by the way i get as so quick message in red color  that i could saw it, but it seem that radeon.kext are not load.

it may be some other

 

 

@tluck: interesting, because  OcQuirks, AptionMemoryFix OpenRuntime for all mac os , excepted big sur

if anyone has the answer

So who could you confirm this point ? or may i wrong ?

 

Edited by maclinuxG4
Link to comment
Share on other sites

13 hours ago, Jief_Machak said:

Make files with what ? 

 

@Everyone : duplicated settings are now ignored from Quirks section.

 

 

@Jief_Machak, @Slice,

 

As I mentioned in my previous post, the recent commit r5123_641b75e will cause problems for users migrating from old Clover because of backwards incompatibility with their old config.plist settings.

 

Old Clover KernelAndKextPatches settings matched to OC 0.6.1 Kernel/Quirks

  • OC AppleCpuPmCfgLock = Clover's AppleIntelCPUPM (power management for Sandy/IvyBridge CPUs needing patched AppleIntelCPUPowerManagement.kext, not Clover's KernelPm which enables Kernel Power Management for Haswell and newer CPUs)
  • OC AppleXcpmCfgLock = Clover's KernelPm (not KernelXCPM which was for IvyBridge CPUs according to old Clover wiki @SourceForge).

In order to boot with r5123_641b75e or newer on my NUC6i5SYH, I have to replace config.plist/KernelAndKextPatches/KernelPm=Yes with config.plist/KernelAndKextPatches/KernelXCPM=Yes, otherwise early boot hang due to locked kernel msrs...

Spoiler

796936134_KernelPmvsKernelXCPM.thumb.png.506b6c052a25550409fa14bfd7e6a948.png

 

  • Like 1
  • Confused 1
Link to comment
Share on other sites

@tluck OpenRuntime.efi prevent linux to boot. I didn't see OpenRuntime.efi being used but maybe I didn't look close enough.

The panic isn't suppose to happen, as the driver was ignored. But yes, a warning system would be good, but we do with what we have.

 

Comment out these line and without changing anything else. If it makes your config working, it'll prove that Openruntime is used.

3 minutes ago, fusion71au said:

As I mentioned in my previous post, the recent commit r5123_641b75e will cause problems for users migrating from old Clover because of backwards incompatibility with their old config.plist settings.

If we made a mistake, we'll correct it...

Link to comment
Share on other sites

Technically, you should be able to use the OpenCore patches right for AMD patches? Since you're using OC to do patching. I think you need to hook up the masking stuff and Skip/Count since the patches do use those.

Edited by 1Revenger1
  • Like 1
Link to comment
Share on other sites

19 hours ago, fusion71au said:

 

@Slice, @stevezheng,

 

About recent commit 641b75e based on the above post.

 

AFAIK,

 

OC AppleCpuPmCfgLock = Clover's AppleIntelCPUPM

OC AppleXcpmCfgLock = Clover's KernelPm

 

Please confirm with OC 0.6.1 Configuration.pdf

After a closer look, I agree that Clover's KernelPM functions more similar to OC's AppleXcpmCfgLock. Still needs a closer look, as I didn't figure out what Clover's KernelXCPM does (maybe enable XCPM on old platforms such as Haswell?).

 

 

The definition for Clover's KernelPm is at here: https://github.com/CloverHackyColor/CloverBootloader/blob/f312117030cc0e7f903b12da26cc1aeea03caff7/rEFIt_UEFI/Platform/kernel_patcher.cpp#L917

 

The definition for OpenCore's AppleXcpmCfgLock is at here:

https://github.com/acidanthera/OpenCorePkg/blob/ecbed230e0786c8aa250504c6fe72924260d92fc/Library/OcAppleKernelLib/CommonPatches.c#L203

 

I can see they both play with _xcpm_core_scope_msrs and patch them. But maybe Clover's KernelPm does more than zero out 0xE2 MSR, more tests are needed.

 

I also agree that OC's AppleCpuPmCfgLock is a replacement for Clover's AppleIntelCPUPM.

 

The definition of Clover's AppleIntelCPUPM is at here: https://github.com/CloverHackyColor/CloverBootloader/blob/f312117030cc0e7f903b12da26cc1aeea03caff7/rEFIt_UEFI/Platform/kext_patcher.cpp#L473

 

And for OpenCore:

https://github.com/acidanthera/OpenCorePkg/blob/ecbed230e0786c8aa250504c6fe72924260d92fc/Library/OcAppleKernelLib/CommonPatches.c#L42

 

They all patch with nops, and check registers with value 0xC9, 0xB9, etc.

 

CC @Slice

 

 

  • Like 1
Link to comment
Share on other sites

57 minutes ago, 1Revenger1 said:

Technically, you should be able to use the OpenCore patches right for AMD patches? Since you're using OC to do patching. I think you need to hook up the masking stuff and Skip/Count since the patches do use those.

 

this is very important to be able to have Clover working on AMD and especially for Big Sur
There was no evolution for "traditional" kernel patches with Clover, development went ahead on the method used with OC

  • Like 1
Link to comment
Share on other sites

5 hours ago, Jief_Machak said:

By the way, skip won't work because you'll get a crash in OpenCore if that protocol exists before calling OcMain.

ok. 

5 hours ago, Jief_Machak said:

@tluck OpenRuntime.efi prevent linux to boot. I didn't see OpenRuntime.efi being used but maybe I didn't look close enough.

The panic isn't suppose to happen, as the driver was ignored. But yes, a warning system would be good, but we do with what we have.

 

Comment out these line and without changing anything else. If it makes your config working, it'll prove that Openruntime is used.

If we made a mistake, we'll correct it...

regardless I/we need OpenRuntime.efi  or another "memory fix" alternative. or instant panic for macOS.

i reverted your last commit and built clover. so with OpenRuntime.efi - boots as usual. without it - instant panic. 

Link to comment
Share on other sites

No!

    if ( LStringW(DirEntry->FileName).containsIC("OpenRuntime") ) {
      continue;
    }

The driver is needed for macOS. It performs all Quirks.

May be for linux we have to filter one Quirk. But I don't know exactly which one.

  • Like 1
Link to comment
Share on other sites

47 minutes ago, Slice said:

It performs all Quirks.

I really don't think all of them. Look at OpenRuntime.c, it wraps few things. There is one that is needed, for tluck for example. We have to find which one and do it in Clover. Needing OpenRuntime.efi will be a nightmare.

Let's do it more subtle.

@tluck Could you share your efi folder ? I'd like to reproduce the issue locally.

EDIT : I meant : sharing the Clover folder is enough, I think. The one that is able to boot with OpenRuntime.efi, and NOT able without it.

Edited by Jief_Machak
Link to comment
Share on other sites

8 hours ago, stevezheng said:

After a closer look, I agree that Clover's KernelPM functions more similar to OC's AppleXcpmCfgLock. Still needs a closer look, as I didn't figure out what Clover's KernelXCPM does (maybe enable XCPM on old platforms such as Haswell?).

 

 

The definition for Clover's KernelPm is at here: https://github.com/CloverHackyColor/CloverBootloader/blob/f312117030cc0e7f903b12da26cc1aeea03caff7/rEFIt_UEFI/Platform/kernel_patcher.cpp#L917

 

The definition for OpenCore's AppleXcpmCfgLock is at here:

https://github.com/acidanthera/OpenCorePkg/blob/ecbed230e0786c8aa250504c6fe72924260d92fc/Library/OcAppleKernelLib/CommonPatches.c#L203

 

I can see they both play with _xcpm_core_scope_msrs and patch them. But maybe Clover's KernelPm does more than zero out 0xE2 MSR, more tests are needed.

 

I also agree that OC's AppleCpuPmCfgLock is a replacement for Clover's AppleIntelCPUPM.

 

The definition of Clover's AppleIntelCPUPM is at here: https://github.com/CloverHackyColor/CloverBootloader/blob/f312117030cc0e7f903b12da26cc1aeea03caff7/rEFIt_UEFI/Platform/kext_patcher.cpp#L473

 

And for OpenCore:

https://github.com/acidanthera/OpenCorePkg/blob/ecbed230e0786c8aa250504c6fe72924260d92fc/Library/OcAppleKernelLib/CommonPatches.c#L42

 

They all patch with nops, and check registers with value 0xC9, 0xB9, etc.

 

CC @Slice

 

 


Thanks @stevezheng @Slice

In "converting common proprieties from Clover to Opencore" (Dortania Guide), I see that : Clover's KernelXCPM is replaced by OC's AppleXcpmExtraMsrs 

What do you think about ! Please.

  • Like 1
Link to comment
Share on other sites

12 minutes ago, Matgen84 said:


Thanks @stevezheng @Slice

In "converting common proprieties from Clover to Opencore" (Dortania Guide), I see that : Clover's KernelXCPM is replaced by OC's AppleXcpmExtraMsrs 

What do you think about ! Please.

looks like true

  • Like 1
Link to comment
Share on other sites

5 hours ago, tluck said:

ok. 

regardless I/we need OpenRuntime.efi  or another "memory fix" alternative. or instant panic for macOS.

i reverted your last commit and built clover. so with OpenRuntime.efi - boots as usual. without it - instant panic. 

As well as me.

  • Like 1
Link to comment
Share on other sites

40 minutes ago, Slice said:

As well as me.

@Slice Is Openruntime always present in CloverPkg ? I don't find it in my last build. OcQuirks file is it  unnecessary now?
Maybe I mistaked somewhere.

Sorry for my bad English, I don't understand what @tluck said.

Edited by Matgen84
Link to comment
Share on other sites

2 hours ago, Matgen84 said:
2 hours ago, Matgen84 said:


Thanks @stevezheng @Slice

In "converting common proprieties from Clover to Opencore" (Dortania Guide), I see that : Clover's KernelXCPM is replaced by OC's AppleXcpmExtraMsrs 

What do you think about ! Please.

I don't think AppleXcpmExtraMsrs exactly matches Clover's KernelXCPM, but I agree it can replace KernelXCPM.

 

In Clover's KernelXCPM, kernel patcher will patch _cpuid_set_info accordingly based on platform and macOS version. In OpenCore's AppleXcpmExtraMsrs, it seems like a more general approach to patch xcpm_msr_applicable_cpus and write to MSR_MISC_PWR_MGMT, regardless of macOS version. 

 

There's a detailed document of OpenCore's AppleXcpmExtraMsrs at here: https://github.com/acidanthera/bugtracker/issues/365. According to that, the methods used by OpenCore and Clover are very different. OpenCore's AppleXcpmExtraMsrs may include the functionality of Clover's KernelXCPM and some other stuff discussed in that link.

  • Like 1
Link to comment
Share on other sites

32 minutes ago, iCanaro said:

@Matgen84 which hack are you testing? 
If on the p8Z77 and you can get to desktop, would you pass me the Clover you use and the config? 
In my Z68 and Z97 systems I could not get to desktop with no Clover release after the 5122


@iCanaro I only test Z390 system up to commits 2fddd11, to boot Big Sur. Sorry, I don't update P8Z77 since r5122 (648f5c3d3). IvyBridge is on my TODO list.

  • Thanks 1
Link to comment
Share on other sites

15 hours ago, fusion71au said:

 

@Jief_Machak, @Slice,

 

As I mentioned in my previous post, the recent commit r5123_641b75e will cause problems for users migrating from old Clover because of backwards incompatibility with their old config.plist settings.

 

Old Clover KernelAndKextPatches settings matched to OC 0.6.1 Kernel/Quirks

  • OC AppleCpuPmCfgLock = Clover's AppleIntelCPUPM (power management for Sandy/IvyBridge CPUs needing patched AppleIntelCPUPowerManagement.kext, not Clover's KernelPm which enables Kernel Power Management for Haswell and newer CPUs)
  • OC AppleXcpmCfgLock = Clover's KernelPm (not KernelXCPM which was for IvyBridge CPUs according to old Clover wiki @SourceForge).

In order to boot with r5123_641b75e or newer on my NUC6i5SYH, I have to replace config.plist/KernelAndKextPatches/KernelPm=Yes with config.plist/KernelAndKextPatches/KernelXCPM=Yes, otherwise early boot hang due to locked kernel msrs...

  Hide contents

796936134_KernelPmvsKernelXCPM.thumb.png.506b6c052a25550409fa14bfd7e6a948.png

 

now i know the reason why i recieving a kernel panic or instant reboot on my i5 2500 with b75m board using clover 5123

Link to comment
Share on other sites

×
×
  • Create New...