Jump to content

Clover General discussion


ErmaC
30,171 posts in this topic

Recommended Posts

Hello guys, long time no see! It has been a while that I haven't had enough time to pull some changes to Clover. 

 

I have made a new change for Intel Haswell low-end CPU, especially for Haswell Pentiumn and Celeron and newer platforms. Here's the change I made based on the latest r4131. And a new boolean key KernelHSWLowEndPatch has been introduced in KernelAndKextPatches section. 

 

Requirement:

CPU: Haswell Pentium/Celeron or newer Intel low-end process

 

Advantages:

  • No need to inject FakeCPUID manually
  • No need to add kernel patches manually(clean config.plist)
  • Automatically applying HWP speedshift for Skylake and newer process © syscl

 

Here's the code I've changed, and a prebuilt version of CLOVERX64.eft based on r4131

src_and_bin.zip

 

 

Credit also: Pike R.Alpha, Sherlocks, stinga11, vit9696, slice

 

Thanks in advance,

syscl

  • Like 4
Link to comment
Share on other sites

Hi,

 

i tried your suggestion and can confirm that with these settings arch is booting up with clover again.

 

With your suggestion i am seeing for 5 seconds a black screen after selecting "Arch Linux" in Clover, then Arch is booting up correctly.

 

I assume that in this 5 seconds the systemd bootscreen should now get displayed, right? (because of a configured 5 secs timeout in systemd boot, to be able to choose from the starup items: arch, arch-lts, win10).

 

black screen maybe caused by using a 4K Display, any idea how the systemd-boot menu can be made visible?

 

Thanks much anyways for helping out here,

appreciate it very much!

 

Cheers,

Max

Sounds about right to me. Ill boot mine and test.

Or not, Once i choose arch from boot menu its about half a second then i see the arch verbose boot.

Depends on your hardware to how long it takes i guess.

Link to comment
Share on other sites

Clover 4131

8:409  0:000  Intel HD Graphics 4400 [8086:0A16] :: PciRoot(0x0)\Pci(0x2,0x0)
8:409  0:000    Found Full Wide XGA Display - 16:9 :: Width=1366 Height=768
8:409  0:000    AAPL00,DualLink = 1
8:409  0:000    FakeID Intel GFX = 0x04128086
8:409  0:000    ig-platform-id = 0x0A260006
8:409  0:000  Intel GFX revision  = 0xB
8:409  0:000   setting specified layout-id=4 (0x4)
8:409  0:000   setting specified layout-id=4 (0x4)
8:410  0:000  stringlength = 2792
8:410  0:000  CurrentMode: Width=1366 Height=768
8:410  0:000  Beginning FSInjection

Or do you need it with your test files?
Did you set duallink 1 on config.plist?

 

Give me full log

 

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

Yes I did set duallink to 1. Will post full log soon.

 

Sent from my SM-G930F using Tapatalk

One your duallink set 1. Get log

Two remove duallinl on config.plist. get log

 

Thanks in advance

 

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

 

One your duallink set 1. Get log

Two remove duallinl on config.plist. get log

 

Thanks in advance

 

나의 LG-F800S 의 Tapatalk에서 보냄

Why you use duallink 1?

 

 

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

Isn't that what you wanted to test?

 

Sent from my SM-G930F using Tapatalk

For test, set 1 log is fine.

On r4131, remove duallink on config.plist, then get log?

 

Clover can read resolution on your system.

I recommend remove duallink on your config. Then clover automately detect duallink.

 

 

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

Hello guys, long time no see! It has been a while that I haven't had enough time to pull some changes to Clover. 

 

I have made a new change for Intel Haswell low-end CPU, especially for Haswell Pentiumn and Celeron and newer platforms. Here's the change I made based on the latest r4131. And a new boolean key KernelHSWLowEndPatch has been introduced in KernelAndKextPatches section. 

 

Requirement:

CPU: Haswell Pentium/Celeron or newer Intel low-end process

 

Advantages:

  • No need to inject FakeCPUID manually
  • No need to add kernel patches manually(clean config.plist)
  • Automatically applying HWP speedshift for Skylake and newer process © syscl

 

Here's the code I've changed, and a prebuilt version of CLOVERX64.eft based on r4131

 

 

Credit also: Pike R.Alpha, Sherlocks, stinga11, vit9696, slice

 

Thanks in advance,

syscl

 

That's cool but why do you need to add a key for a patch that must be done for specific CPUs? Why not just perform the patch when those CPUs are detected? First detect check the cpuid, then the cpu description string, and finally cpu features (this stuff is all detected on start, you'd only need to check it). This will allow you to determine CPUs that need said patch. There are becoming way too many config keys that do stuff that could just be done by detection....

  • Like 2
Link to comment
Share on other sites

For test, set 1 log is fine.

On r4131, remove duallink on config.plist, then get log?

 

Clover can read resolution on your system.

I recommend remove duallink on your config. Then clover automately detect duallink.

 

 

나의 LG-F800S 의 Tapatalk에서 보냄

I did post a log without duallink 1 in config.plist. It's the one that just says bootlog.

 

Sent from my SM-G930F using Tapatalk

Link to comment
Share on other sites

Your welcome, So leave duallink as it is? blank.

 

i recommend removed duallink for various situation on config.plist

if you have problem that clover can't read correct resolution on some system(replace LCD screen hardware for high resolution), at time, you try to use duallink option.

 

check link

  • Like 1
Link to comment
Share on other sites

That's cool but why do you need to add a key for a patch that must be done for specific CPUs? Why not just perform the patch when those CPUs are detected? First detect check the cpuid, then the cpu description string, and finally cpu features (this stuff is all detected on start, you'd only need to check it). This will allow you to determine CPUs that need said patch. There are becoming way too many config keys that do stuff that could just be done by detection....

Thank you, I will do this change and upload it.

 

 

Base on @apianti suggestion, I remove the setting section in CloverGUI and added auto detection for Haswell+ Celeron/Pentium, no more settings are required. 

 
Now Clover can make Pentium and Celeron work without any additional patches! Here's the source and prebuilt Clover
 
@Sherlocks @Slice @vandroiy2012 @stinga11 please give the latest change a try on Celeron/Pentium(>= Haswell), thank you!
 

Have a good day,

syscl

  • Like 6
Link to comment
Share on other sites

Thank you, I will do this change and upload it.

 

 

Base on @apianti suggestion, I remove the setting section in CloverGUI and added auto detection for Haswell+ Celeron/Pentium, no more settings are required. 

 
Now Clover can make Pentium and Celeron work without any additional patches! Here's the source and prebuilt Clover
 
@Sherlocks @Slice @vandroiy2012 @stinga11 please give the latest change a try on Celeron/Pentium(>= Haswell), thank you!
 

Have a good day,

syscl

Hi,

I think for 10.11 or earlier versions of OS X, -xcpm boot-args should also be added to enable XCPM. (Or patch _xcpm_bootstrap() as well)

And unsupported MSRs might be problematic... (Instant reboot or so)

Link to comment
Share on other sites

Thank you, I will do this change and upload it.

 

 

Base on @apianti suggestion, I remove the setting section in CloverGUI and added auto detection for Haswell+ Celeron/Pentium, no more settings are required. 

 
Now Clover can make Pentium and Celeron work without any additional patches! Here's the source and prebuilt Clover
 
@Sherlocks @Slice @vandroiy2012 @stinga11 please give the latest change a try on Celeron/Pentium(>= Haswell), thank you!
 

Have a good day,

syscl

 

This looks good, has there been a lot of testing of this? I can commit the changes for you (that may take a minute as I am just now getting set back up) but I could also make you a developer on the project and you can commit the changes yourself, if you'd like. Let me know but if you do want to be added, just please don't go crazy lol.

 

EDIT: I went ahead and committed the changes to revision 4134 but still let me know if you want added, in case you want to make additional changes or add other nice features.

 

Hi,

I think for 10.11 or earlier versions of OS X, -xcpm boot-args should also be added to enable XCPM. (Or patch _xcpm_bootstrap() as well)

And unsupported MSRs might be problematic... (Instant reboot or so)

 

That's what this is doing:

    if (os_version < AsciiOSVersionToUint64("10.8.5")) {
        DBG("Haswell+ CPU requires macOS version at least 10.8.5, aborted\n");
        DBG("KernelHSWLowEndPatch() <===FALSE\n");
        return FALSE;
    }
    /**
     * _xcpm_bootstrap - IvyBridge (c) Pike R.Alpha
     */
    DBG("Searching _xcpm_bootstrap...\n");
    if (os_version <= AsciiOSVersionToUint64("10.12.5")) {
    else if (os_version >= AsciiOSVersionToUint64("10.12.6") && os_version < AsciiOSVersionToUint64("10.13")) {
    else if (os_version >= AsciiOSVersionToUint64("10.13") && os_version < AsciiOSVersionToUint64("10.14")){
  • Like 3
Link to comment
Share on other sites

 

This looks good, has there been a lot of testing of this? I can commit the changes for you (that may take a minute as I am just now getting set back up) but I could also make you a developer on the project and you can commit the changes yourself, if you'd like. Let me know but if you do want to be added, just please don't go crazy lol.

 

EDIT: I went ahead and committed the changes to revision 4134 but still let me know if you want added, in case you want to make additional changes or add other nice features.

 

 

That's what this is doing:

    if (os_version < AsciiOSVersionToUint64("10.8.5")) {
        DBG("Haswell+ CPU requires macOS version at least 10.8.5, aborted\n");
        DBG("KernelHSWLowEndPatch() <===FALSE\n");
        return FALSE;
    }
    /**
     * _xcpm_bootstrap - IvyBridge (c) Pike R.Alpha
     */
    DBG("Searching _xcpm_bootstrap...\n");
    if (os_version <= AsciiOSVersionToUint64("10.12.5")) {
    else if (os_version >= AsciiOSVersionToUint64("10.12.6") && os_version < AsciiOSVersionToUint64("10.13")) {
    else if (os_version >= AsciiOSVersionToUint64("10.13") && os_version < AsciiOSVersionToUint64("10.14")){

Nope... You will only get something like 

            if (bytes[i+0] == 0x83 && bytes[i+1] == 0xC3 && bytes[i+2] == 0xC4 &&
                bytes[i+3] == 0x83 && bytes[i+4] == 0xFB && bytes[i+5] == 0x22) {

on 10.12.0 - 10.12.5, as for earlier versions, you need to add -xcpm or find out the corresponding patches.

And also. In case some MSRs are unsupported... Then it will trigger an instant reboot.

Link to comment
Share on other sites

Nope... You will only get something like 

            if (bytes[i+0] == 0x83 && bytes[i+1] == 0xC3 && bytes[i+2] == 0xC4 &&
                bytes[i+3] == 0x83 && bytes[i+4] == 0xFB && bytes[i+5] == 0x22) {

on 10.12.0 - 10.12.5, as for earlier versions, you need to add -xcpm or find out the corresponding patches.

And also. In case some MSRs are unsupported... Then it will trigger an instant reboot.

 

Nah, you are misreading what's happening:

            if (bytes[i+0] == 0x83 && bytes[i+1] == 0xC3 && bytes[i+2] == 0xC4 &&
                bytes[i+3] == 0x83 && bytes[i+4] == 0xFB && bytes[i+5] == 0x22) {
                // syscl - we found _xcpm_bootstrap
                DBG("Found _xcpm_bootstrap\n");
                patchLocation = i + 2;
                break;
            }

Then later:

    // now substitule it to fix _xcpm_bootstrap
    bytes[patchLocation] = 0xC6;
    DBG("Applied _xcpm_bootstrap patch\n");

See it's patching _xcpm_bootstrap.

 

EDIT: It also patches _cpuid_set_info_rdmsr and MSR 0xE2 _xcpm_idle instant reboot.

EDIT2: Would be best to just get some tests and see if it works or not, but it looks like it will work.

Link to comment
Share on other sites

Nah, you are misreading what's happening:

            if (bytes[i+0] == 0x83 && bytes[i+1] == 0xC3 && bytes[i+2] == 0xC4 &&
                bytes[i+3] == 0x83 && bytes[i+4] == 0xFB && bytes[i+5] == 0x22) {
                // syscl - we found _xcpm_bootstrap
                DBG("Found _xcpm_bootstrap\n");
                patchLocation = i + 2;
                break;
            }

Then later:

    // now substitule it to fix _xcpm_bootstrap
    bytes[patchLocation] = 0xC6;
    DBG("Applied _xcpm_bootstrap patch\n");

See it's patching _xcpm_bootstrap.

This will be applied to a system which >= 10.8.5 && <= 10.12.5, right?

I mean, 83 c3 c4 83 fb 22 is only there on 10.12.0 - 10.12.5, so earlier versions of OS X like 10.11 will still stay in the lack of XCPM. (Cuz not patched)

Entry->KernelAndKextPatches->FakeCPUID = (UINT32)(0x0306A0);    // correct FakeCPUID
KernelCPUIDPatch((UINT8*)KernelData, Entry);

More catastrophically. This will trigger AICPUPM loading (due to this Ivy Bridge CPU ID), and Haswell+ Celeron/Pentium is not supported by AICPUPM, which will lead to AICPUPM KP.

 

So... On <= 10.11 systems there will be a KP with this code I guess.

Link to comment
Share on other sites

 

This looks good, has there been a lot of testing of this? I can commit the changes for you (that may take a minute as I am just now getting set back up) but I could also make you a developer on the project and you can commit the changes yourself, if you'd like. Let me know but if you do want to be added, just please don't go crazy lol.

 

EDIT: I went ahead and committed the changes to revision 4134 but still let me know if you want added, in case you want to make additional changes or add other nice features.

 

 

That's what this is doing:

    if (os_version < AsciiOSVersionToUint64("10.8.5")) {
        DBG("Haswell+ CPU requires macOS version at least 10.8.5, aborted\n");
        DBG("KernelHSWLowEndPatch() <===FALSE\n");
        return FALSE;
    }
    /**
     * _xcpm_bootstrap - IvyBridge (c) Pike R.Alpha
     */
    DBG("Searching _xcpm_bootstrap...\n");
    if (os_version <= AsciiOSVersionToUint64("10.12.5")) {
    else if (os_version >= AsciiOSVersionToUint64("10.12.6") && os_version < AsciiOSVersionToUint64("10.13")) {
    else if (os_version >= AsciiOSVersionToUint64("10.13") && os_version < AsciiOSVersionToUint64("10.14")){

OK! Yes I want to add more changes. I will commit more change and add xcpm for 10.10.x and 10.11.x as well.

 

I need some test once I finish.

 

Anyway, your idea is good, and I will try to give it more improvement!

 

Have a nice day,

syscl

Hi,

I think for 10.11 or earlier versions of OS X, -xcpm boot-args should also be added to enable XCPM. (Or patch _xcpm_bootstrap() as well)

And unsupported MSRs might be problematic... (Instant reboot or so)

Yes, I was thinking of adding -xcpm for 10.10.x-10.11.x, and at the first, we need to commit the first change.

 

Then we can do the following change(e.g. -xcpm enforce for Haswell+ Celeron/Pentium...)

 

Thank you,

syscl

  • Like 1
Link to comment
Share on other sites

Yes, I was thinking of adding -xcpm for 10.10.x-10.11.x, and at the first, we need to commit the first change.

 

Then we can do the following change(e.g. -xcpm enforce for Haswell+ Celeron/Pentium...)

 

Thank you,

syscl

With your code I guess there will be a KP on 10.8.5 - 10.11.x due to AICPUPM unsupported and XCPM not enabled/patched.

So for now should we change something like: (See attachment below)

 

kernel_patcher.c.zip

Link to comment
Share on other sites

×
×
  • Create New...