Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

I suggest we bring back "Boot without caches"...

- it is still useful on current versions... although it doesn't do what it used to, -f is still needed for cases using injector kexts with symlinks (aka. "Dummy kexts")

- and it is also useful for older versions of OS X, where still works as it originally did (I have a system that can run all versions SL->Sierra)

 

The diffs:

 

--- rEFIt_UEFI/entry_scan/loader.c (revision 4093)
+++ rEFIt_UEFI/entry_scan/loader.c (working copy)
@@ -759,7 +759,6 @@
     }
 
     
-//    AddMenuCheck(SubScreen, "Without caches",       OSFLAG_NOCACHES, 69);
 //    AddMenuCheck(SubScreen, "With injected kexts",  OSFLAG_WITHKEXTS, 69);
     AddMenuInfo(SubScreen, L"=== boot-args ===");
     if (!KernelIs64BitOnly) {
@@ -767,6 +766,7 @@
       AddMenuCheck(SubScreen, "macOS 64bit",          OPT_X64,  68);
     }
     AddMenuCheck(SubScreen, "Verbose (-v)",                               OPT_VERBOSE, 68);
+    AddMenuCheck(SubScreen, "Without caches (-f)",       OSFLAG_NOCACHES, 69);
     AddMenuCheck(SubScreen, "Single User (-s)",                           OPT_SINGLE_USER, 68);
     AddMenuCheck(SubScreen, "Safe Mode (-x)",                             OPT_SAFE, 68);
     AddMenuCheck(SubScreen, "Disable KASLR (slide=0)",                    OPT_SLIDE, 68);
  • Like 3
Link to comment
Share on other sites

Few new NVIDIA IDS and cleanup
nvidia.c -> New_nvidia_IDs_cleanup.zip

ATI VEGA10 and missed Polaris12 IDs source->amdgpu_drv.c or this commit
ati.c and ati.h -> Vega10.zip

Same as VEGA10 changes, plus Mork vom Ork FB
previus post ->http://www.insanelymac.com/forum/topic/306156-clover-bugissue-report-and-patch/?p=2438868

ati.c and ati.h -> Vega10_new_FB.zip

ErmaC

  • Like 6
Link to comment
Share on other sites

Hi devs, I've got a friend that's been having a problem with Clover's CPU detection. He says it worked perfectly fine up to 4035 but any newer rev changes the FSB value from 267MHz to 66MHz (the correct for a C2D E7200 would be 1066/4). I believe this happened in rev 4043, where a check was added to calculate the external clock:

+  // Check if QPI is used
+  if (gSettings.QPI == 0) {
+    // Not used, quad-pumped FSB; multiply ExternalClock by 4
+    ExternalClock = gCPUStructure.ExternalClock * 4;
+  } else {
+    // Used; keep the same value for ExternalClock
+    ExternalClock = gCPUStructure.ExternalClock;
+  }

Here's a bootlog from rev4035 with correct values:

1:769  0:000  === [ GetCPUProperties ] ==================================
1:769  0:000  CPU Vendor = 756E6547 Model=10676
1:769  0:000   The CPU supported SSE4.1
1:769  0:000  got cores from CPUID_1 = 2
1:769  0:000  The CPU not supported turbo
1:769  0:000  BrandString = Intel(R) Core(TM)2 Duo CPU     E7200  @ 2.53GHz
1:769  0:000  MSR dumps:
1:769  0:000  	@0x00CD=800
1:769  0:000  	@0x0198=61A491F0600491F
1:769  0:000  FSBFrequency=266MHz DMIvalue=267000kHz
1:769  0:000  Corrected FSBFrequency=267MHz
1:769  0:000  MaxDiv/MinDiv: 9.5/6
1:769  0:000  Turbo: 10/0/0/0
1:769  0:000  Features: 0xBFEBFBFF
1:769  0:000  Threads: 2
1:769  0:000  Cores: 2
1:769  0:000  FSB: 267 MHz
1:769  0:000  CPU: 2533 MHz
1:769  0:000  TSC: 2533 MHz
1:769  0:000  PIS: 1068 MHz

And one with rev4047:

1:765  0:000  === [ GetCPUProperties ] ==================================
1:765  0:000  CPU Vendor = 756E6547 Model=10676
1:765  0:000   The CPU supported SSE4.1
1:765  0:000  got cores from CPUID_1 = 2
1:765  0:000  The CPU not supported turbo
1:765  0:000  BrandString = Intel(R) Core(TM)2 Duo CPU     E7200  @ 2.53GHz
1:765  0:000  MSR dumps:
1:765  0:000  	@0x00CD=800
1:765  0:000  	@0x0198=61A491F0600491F
1:765  0:000  FSBFrequency = 266 MHz, DMI FSBFrequency = 267 MHz, Corrected FSBFrequency = 267 MHz
1:765  0:000  MaxDiv/MinDiv: 9.5/6
1:765  0:000  Turbo: 10/0/0/0
1:765  0:000  Features: 0xBFEBFBFF
1:765  0:000  Threads: 2
1:765  0:000  Cores: 2
1:765  0:000  FSB: 66 MHz
1:765  0:000  CPU: 2533 MHz
1:765  0:000  TSC: 2533 MHz
1:765  0:000  PIS: 267 MHz
  • Like 1
Link to comment
Share on other sites

If I remembered correctly, no cache mode got deprecated since a beta version of 10.12?

 

Kernel flag "-f" not deprecated. As I wrote, it still does something and is still useful.

It may not do exactly what it used to, but still useful.

And besides that, Clover is still used with older OS X.

  • Like 1
Link to comment
Share on other sites

Kernel flag "-f" not deprecated. As I wrote, it still does something and is still useful.

What exactly does it do now? I knew it was still present in boot.efi, but not what it was actually used for after prelinkedkernel was made the only way to boot.

  • Like 1
Link to comment
Share on other sites

What exactly does it do now? I knew it was still present in boot.efi, but not what it was actually used for after prelinkedkernel was made the only way to boot.

 

This is how it is used... (no idea what it is actually doing)...

It is very common for AppleHDA to "fall out of cache" during updates, or when installing kexts (no idea why...)

After that happens, Clover KextsToPatch will not apply, as it will not be loading from kernel cache.

The only way to jumpstart things at that point, is to boot without caches (kernel flag -f), which causes AppleHDA to load.  Following that, a kernel cache rebuild will get it back in cache, where you can then boot normally (with cache) with the AppleHDA KextsToPatch being applied... until the next time it breaks.

 

Bottom line:

- kernel flag -f is still useful on current macOS

- and Clover is still used with older systems (as I mentioned) anyway (even if -f stopped doing anything in 10.13+)

- therefore, the option in Clover should never have been removed

 

Obviously, the work around here is to just add -f to Boot/Arguments (from Clover options), but that is not nearly as convenient as the "spacebar menu".

I think "-f" is much more commonly used than some of the other flags available in the "spacebar menu"!

  • Like 3
Link to comment
Share on other sites

@savvamitrofanov How can you pass a path check with prefixed GUID? Mine always fail with existing "FileExists (Volume->RootDir, LoaderPath)" path check :(

0:881 (0:001) | - [19]: 'Preboot'
0:881 (0:000) |         --> [xxx] LoaderPath: \81E06FB1-7A87-4145-833F-85BFFCDDEC3D\boot.efi
0:882 (0:000) |         --> [xxx] LoaderPath: \81E06FB1-7A87-4145-833F-85BFFCDDEC3D\com.apple.installer\boot.efi
0:882 (0:000) |         --> [xxx] LoaderPath: \81E06FB1-7A87-4145-833F-85BFFCDDEC3D\System\Library\CoreServices\boot.efi
0:883 (0:000) |         --> [xxx] LoaderPath: \EFI\MICROSOFT\BOOT\bootmgfw.efi
0:883 (0:000) |         --> [xxx] LoaderPath: \EFI\MICROSOFT\BOOT\cdboot.efi
0:885 (0:001) | - [20]: 'macOS'
0:885 (0:000) |         --> [xxx] LoaderPath: \BD9C9859-6B02-4747-A585-A69049D9E88E\boot.efi
0:886 (0:000) |         --> [xxx] LoaderPath: \BD9C9859-6B02-4747-A585-A69049D9E88E\com.apple.installer\boot.efi
0:887 (0:000) |         --> [xxx] LoaderPath: \BD9C9859-6B02-4747-A585-A69049D9E88E\System\Library\CoreServices\boot.efi
0:887 (0:000) |         --> [xxx] LoaderPath: \EFI\MICROSOFT\BOOT\bootmgfw.efi
0:888 (0:000) |         --> [xxx] LoaderPath: \EFI\MICROSOFT\BOOT\cdboot.efi
0:889 (0:001) | - [21]: 'Recovery'
0:889 (0:000) |         --> [xxx] LoaderPath: \256C4EEB-4F06-4A91-87AA-F3732E7D0D35\boot.efi
0:889 (0:000) |         --> [xxx] LoaderPath: \256C4EEB-4F06-4A91-87AA-F3732E7D0D35\com.apple.installer\boot.efi
0:889 (0:000) |         --> [xxx] LoaderPath: \256C4EEB-4F06-4A91-87AA-F3732E7D0D35\System\Library\CoreServices\boot.efi
0:889 (0:000) |         --> [xxx] LoaderPath: \EFI\MICROSOFT\BOOT\bootmgfw.efi
0:889 (0:000) |         --> [xxx] LoaderPath: \EFI\MICROSOFT\BOOT\cdboot.efi

** Never saw "com.apple.installer\boot.efi" before

Link to comment
Share on other sites

The only way to jumpstart things at that point, is to boot without caches (kernel flag -f), which causes AppleHDA to load.  Following that, a kernel cache rebuild will get it back in cache, where you can then boot normally (with cache) with the AppleHDA KextsToPatch being applied... until the next time it breaks.

Thx for the info. This means that the kernel loads the kext after the FS driver loaded (boot.efi has no mechanism to load kexts since the drop of the 'original -f', as far as I am aware, though *could* be wrong). That also matches with people having issues with Clover's 'disable kexts' feature. ;)

 

** Never saw "com.apple.installer\boot.efi" before

If Clover won't support bless anytime soon, half of the 20gigs it's in size will be boot.efi paths........ (sarcasm)

  • Like 4
Link to comment
Share on other sites

Kernel flag "-f" not deprecated. 

Sure?

You can take XNU sources and find all kernel flags in them.

For example

    sSafeBoot = PE_parse_boot_argn("-x", bootArgBuffer,
        sizeof(bootArgBuffer)) ? true : false;

There is no "-f".

 

The bootargument was introduced in Chameleon. It is the bootloader that load kernel and kext into memory by itself. Later version also loaded kernelcache or extensions.mkexts if not "-f" specified

#define kOldSafeModeFlag     "-f"

    	if ( getValueForKey( kOldSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) {
        	gBootMode = kBootModeSafe;

        trycache = (((gBootMode & kBootModeSafe) == 0) &&

The flag has no relation to boot.efi or to kernel any version.

The flag "-f" absent in Clover since first revision.

Link to comment
Share on other sites

Sure?

You can take XNU sources and find all kernel flags in them.

For example

    sSafeBoot = PE_parse_boot_argn("-x", bootArgBuffer,
        sizeof(bootArgBuffer)) ? true : false;

There is no "-f".

 

The bootargument was introduced in Chameleon. It is the bootloader that load kernel and kext into memory by itself. Later version also loaded kernelcache or extensions.mkexts if not "-f" specified

#define kOldSafeModeFlag     "-f"

    	if ( getValueForKey( kOldSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) {
        	gBootMode = kBootModeSafe;

        trycache = (((gBootMode & kBootModeSafe) == 0) &&

The flag has no relation to boot.efi or to kernel any version.

The flag "-f" absent in Clover since first revision.

 

-f still having a measured effect here.

 

The situation is quite simple:

- AppleHDA injector installed, all appropriate Clover patches present, layout-id injected, etc.

- but it is not working (AppleHDA doesn't load)

- solution: boot with -f, rebuild cache (kextcache -i /), reboot (without booting with -f, rebuild cache alone will not fix)

It is enough proof for me that the -f flag does something.

 

Possible it is checking the flag somewhere other than the kernel.

 

And for Clover, it really doesn't matter.  The -f flag is still valid for older OS X.

Unless you're saying that the latest Clover is only for the latest macOS/OS X (and you don't believe me regarding -f usage with AppleHDA injector kexts).

 

Note: If you're looking to deprecate some flags, get rid of the ones related to GenericUSBXHCI.kext... because no one uses GenericUSBXHCI.kext (or should be using) with Intel xHCI anyway.

  • Like 3
Link to comment
Share on other sites

 

Hi devs, I've got a friend that's been having a problem with Clover's CPU detection. He says it worked perfectly fine up to 4035 but any newer rev changes the FSB value from 267MHz to 66MHz (the correct for a C2D E7200 would be 1066/4). I believe this happened in rev 4043, where a check was added to calculate the external clock:

+  // Check if QPI is used
+  if (gSettings.QPI == 0) {
+    // Not used, quad-pumped FSB; multiply ExternalClock by 4
+    ExternalClock = gCPUStructure.ExternalClock * 4;
+  } else {
+    // Used; keep the same value for ExternalClock
+    ExternalClock = gCPUStructure.ExternalClock;
+  }

Here's a bootlog from rev4035 with correct values:

1:769  0:000  === [ GetCPUProperties ] ==================================
1:769  0:000  CPU Vendor = 756E6547 Model=10676
1:769  0:000   The CPU supported SSE4.1
1:769  0:000  got cores from CPUID_1 = 2
1:769  0:000  The CPU not supported turbo
1:769  0:000  BrandString = Intel(R) Core(TM)2 Duo CPU     E7200  @ 2.53GHz
1:769  0:000  MSR dumps:
1:769  0:000  	@0x00CD=800
1:769  0:000  	@0x0198=61A491F0600491F
1:769  0:000  FSBFrequency=266MHz DMIvalue=267000kHz
1:769  0:000  Corrected FSBFrequency=267MHz
1:769  0:000  MaxDiv/MinDiv: 9.5/6
1:769  0:000  Turbo: 10/0/0/0
1:769  0:000  Features: 0xBFEBFBFF
1:769  0:000  Threads: 2
1:769  0:000  Cores: 2
1:769  0:000  FSB: 267 MHz
1:769  0:000  CPU: 2533 MHz
1:769  0:000  TSC: 2533 MHz
1:769  0:000  PIS: 1068 MHz

And one with rev4047:

1:765  0:000  === [ GetCPUProperties ] ==================================
1:765  0:000  CPU Vendor = 756E6547 Model=10676
1:765  0:000   The CPU supported SSE4.1
1:765  0:000  got cores from CPUID_1 = 2
1:765  0:000  The CPU not supported turbo
1:765  0:000  BrandString = Intel(R) Core(TM)2 Duo CPU     E7200  @ 2.53GHz
1:765  0:000  MSR dumps:
1:765  0:000  	@0x00CD=800
1:765  0:000  	@0x0198=61A491F0600491F
1:765  0:000  FSBFrequency = 266 MHz, DMI FSBFrequency = 267 MHz, Corrected FSBFrequency = 267 MHz
1:765  0:000  MaxDiv/MinDiv: 9.5/6
1:765  0:000  Turbo: 10/0/0/0
1:765  0:000  Features: 0xBFEBFBFF
1:765  0:000  Threads: 2
1:765  0:000  Cores: 2
1:765  0:000  FSB: 66 MHz
1:765  0:000  CPU: 2533 MHz
1:765  0:000  TSC: 2533 MHz
1:765  0:000  PIS: 267 MHz

 

i have a same issue.

i dont have any value in QPI

 

0:100  0:000  FSBFrequency = 100 MHz, DMI FSBFrequency = 100 MHz, Corrected FSBFrequency = 100 MHz

0:100  0:000  MaxDiv/MinDiv: 23.0/4
0:100  0:000  Turbo: 23/23/23/23
0:100  0:000  Features: 0xBFEBFBFF
0:100  0:000  Threads: 4
0:100  0:000  Cores: 2
0:100  0:000  FSB: 25 MHz
0:100  0:000  CPU: 2300 MHz

 

I will check this.

add. confirmed message in pike's AppleIntelInfo.kext

https://pikeralpha.wordpress.com/2015/12/29/skylake-bus-speed-tip/#comments

 

Settings:

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

logMSRs..................................: 1

logIGPU..................................: 1

logCStates...............................: 1

logIPGStyle..............................: 1

 

Warning: Clover hw.busfrequency error detected : 17d78400

InitialTSC...............................: 0x145d150a174 (60 MHz)

MWAIT C-States...........................: 286531872

Checked my laptop running 4090 and the FSB is being reported at 25MHz instead of 100.

 

That said, sysctl hw.busfrequency shows 100000000.

 

But now that I remember I also have QPI set to 100.

 

okay i confirmed all.

 

0:100  0:000  FSBFrequency = 100 MHz, DMI FSBFrequency = 100 MHz, Corrected FSBFrequency = 100 MHz

0:100  0:000  MaxDiv/MinDiv: 23.0/4
0:100  0:000  Turbo: 23/23/23/23
0:100  0:000  Features: 0xBFEBFBFF
0:100  0:000  Threads: 4
0:100  0:000  Cores: 2
0:100  0:000  FSB: 100 MHz
0:100  0:000  CPU: 2300 MHz

 

 

Sherlocksui-MBP:~ sherlocks$ sysctl hw.busfrequency

hw.busfrequency: 100000000

Sherlocksui-MBP:~ sherlocks$ sysctl hw.busfrequency_min

hw.busfrequency_min: 100000000

Sherlocksui-MBP:~ sherlocks$ sysctl hw.busfrequency_max

hw.busfrequency_max: 100000000

Sherlocksui-MBP:~ sherlocks$ 

 

in pike's kext

 

AppleIntelInfo.kext v2.5 Copyright © 2012-2017 Pike R. Alpha. All rights reserved.

 

Settings:

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

logMSRs..................................: 1

logIGPU..................................: 1

logCStates...............................: 1

logIPGStyle..............................: 1

InitialTSC...............................: 0xa651b169c0 (31 MHz)

MWAIT C-States...........................: 286531872

 

 

please test.

 

after more more test, i will commit fix code.

 

 

thanks in advance

test.zip

  • Like 4
Link to comment
Share on other sites

I'm getting that "Warning: Clover hw.busfrequency error detected" error in AppleIntelInfo. sysctl hw.busfrequency gives me 396000000. This is why I had QPI set to 100.

Yes. I also have to set QPI 100.

I didnt check pikes kext. Maybe pike's kext recognized it if sandy or newer cpu has QPI 100 like apple.

 

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

Real iMac15,1 has this SMBIOS table type 4

	Version: Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
	Voltage: 1.0 V
	External Clock: 25 MHz
	Max Speed: 3500 MHz
	Current Speed: 3500 MHz

So why Pike proposed to use FSB/4 in the table.

Done!

  • Like 2
Link to comment
Share on other sites

This is what i get with sherlocks bootx64.efi and CLOVERX64.efi:

 

AppleIntelInfo.kext v2.6 Copyright © 2012-2017 Pike R. Alpha. All rights reserved.

Settings:
------------------------------------------
logMSRs..................................: 1
logIGPU..................................: 1
logCStates...............................: 1
logIPGStyle..............................: 1

Warning: Clover hw.busfrequency error detected : 179a7b00
InitialTSC...............................: 0x7f27b0a196 (13 MHz)
MWAIT C-States...........................: 1319200

Processor Brandstring....................: Intel® Core i7-6700K CPU @ 4.00GHz

 

and this is what i get when set QPI = 100:

 

Settings:
------------------------------------------
logMSRs..................................: 1
logIGPU..................................: 1
logCStates...............................: 1
logIPGStyle..............................: 1
InitialTSC...............................: 0x5939c7b69b (9 MHz)
MWAIT C-States...........................: 1319200

Processor Brandstring....................: Intel® Core i7-6700K CPU @ 4.00GHz

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...