Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

Hi,
I am trying to make a patch for making _SB.PCI0.I2C0.TPD0 _CRS method returns only (ConcatenateResTemplate (SBFB, SBFG))

With the extra byte method :
_CRS seems well renamed to XCRS in DSDT
Patchmatic shows a SSDT-11.aml with the patched _CRS but also a patched XCRS in SSDT-15.aml
Was expected only see the patched _CRS
_CRS is also not found or evaluate in kernel log
I do not understand where my mistake is ? And why the kernel log message _CRS not found ?

Also tried with the TgtBridge method :
that seems better : only see the patch _CRS with no patched XCRS and have no more kernel log message,
but always got 2 SSDT (11 and 15)

Can someone explain where are my mistakes, and why différent behavior between the 2 methods ?
 

Attachments

  • debug_byte method.zip
    7 MB · Views: 111
  • debug_ TgtBridge method.zip
    6.7 MB · Views: 116
Hi,
i'm trying to create my first hotpatch. I started trying to disable Nvidia card. I already did that using a static patch (it's working right now) but i'm not able to do it using hotpatch. Similar to the first page example i have a REG call from _OFF so i've to move it. I thought i did everything ok but when i reboot i still have the nvidia card listed. Here is my debug file. Could please someone pointing in the right direction ?
Thanks

Mattia

EDIT : I updated a new zip version. The _OFF rename in Clover wasn't working. Now it works but i still have the same result (nvidia still enable) ....

EDIT 2 : I GOT IT WORKING !
I made 2 mistakes. The first one was that some external declaration were not pointing to the right scopes. And the second one and more difficult to find was that i was using EC0 because i had that on the original SSDT BUT i was renaming it to EC because of USB power property injection so i was patching the wrong scope. After changing it to EC the Nvidia card is disable !
 

Attachments

  • debug_18208.zip
    1.7 MB · Views: 101
Last edited:
Which means we can simply add an SSDT that has an _INI at the correct path, and that _INI simply calls _OFF.
Could anyone teach me why _INI would be called even if it was not in the SSDT originally?

By using this SSDT,
Code:
DefinitionBlock("", "SSDT", 2, "hack", "DGPU", 0)
{
    External(_SB.PCI0.PEG0.PEGP._OFF, MethodObj)
    Method(_SB.PCI0.PEG0.PEGP._INI) { _OFF() }
}
My MSI laptop disable eGPU successfully at startup, but after it sleep and wake, the eGPU is on again.
Is there a way to fix this?
 
Last edited:
Could anyone teach me why _INI would be called even if it was not in the SSDT originally?

By using this SSDT,
Code:
DefinitionBlock("", "SSDT", 2, "hack", "DGPU", 0)
{
    External(_SB.PCI0.PEG0.PEGP._OFF, MethodObj)
    Method(_SB.PCI0.PEG0.PEGP._INI) { _OFF() }
}
My MSI laptop disable eGPU successfully at startup, but after it sleep and wake, the eGPU is on again.
Is there a way to fix this?

I simply add _OFF in my SSDT's _WAK and rename the origin _WAK to XWAK, and it fixes the eGPU on after wake problem.
 
I simply add _OFF in my SSDT's _WAK and rename the origin _WAK to XWAK, and it fixes the eGPU on after wake problem.

Just like SSDT-PTSWAK.dsl...
 
Hello Rehabman, everybody,

I've patched with luck the battery status via hotpatch but I'm still experiencing this weird issue, probably connected with my custom SSDT code:

sometimes, on discharging phase, happend like one plug and immediatly unplug the charger cable while this is not phisically happening... I have the proper sound and also brightness changing of this procedure in that quick moment.

Checked the code many and many times but my knowledge on ACPI patching is limited to your (rehabman) posts.


attatched the requested file,
Thanks really for your work
 

Attachments

  • problem-report.zip
    2.7 MB · Views: 88
Hello Rehabman, everybody,

I've patched with luck the battery status via hotpatch but I'm still experiencing this weird issue, probably connected with my custom SSDT code:

sometimes, on discharging phase, happend like one plug and immediatly unplug the charger cable while this is not phisically happening... I have the proper sound and also brightness changing of this procedure in that quick moment.

Checked the code many and many times but my knowledge on ACPI patching is limited to your (rehabman) posts.


attatched the requested file,
Thanks really for your work
MacBookPro14,1 would be a better choice

FakeSMC.kext seems to be missing from /Library/Extensions for some reason?


How and where to install kexts:
 
Back
Top