Jump to content
30960 posts in this topic

Recommended Posts

I spent the afternoon today trying to figure out why my ATI connector patch had stopped working with an upgrade of Clover (to version 4097). When I switched on debug logging I saw that the controller kext was not being patched at all and the output showed the following:

ATIConnectorsPatch: driverAddr ...
Controller = 800

when ATIConnectorsController was actually set to "8000" in my configuration.

 

I think a bug was introduced in r3987, truncating the value of ATIConnectorsController by 1 character. This is due to the DestMax (third) argument of AsciiStrToUnicodeStrS needing to include space for the NULL terminator character:

  @param  DestMax       The maximum number of Destination Unicode
                        char, including terminating null char.

but it is called with the length of the the ATIConnectorsController value/string:

AsciiStrToUnicodeStrS (Prop->string, Patches->KPATIConnectorsController, AsciiStrnLenS(Prop->string, 255));

I think a simple fix is to include the space for the NULL-terminator:

Index: rEFIt_UEFI/Platform/Settings.c
===================================================================
--- rEFIt_UEFI/Platform/Settings.c	(revision 4111)
+++ rEFIt_UEFI/Platform/Settings.c	(working copy)
@@ -865,7 +865,7 @@

     // ATIConnectors patch
     Patches->KPATIConnectorsController = AllocateZeroPool (AsciiStrnLenS(Prop->string, 255) * sizeof(CHAR16) + 2);
-    AsciiStrToUnicodeStrS (Prop->string, Patches->KPATIConnectorsController, AsciiStrnLenS(Prop->string, 255));
+    AsciiStrToUnicodeStrS (Prop->string, Patches->KPATIConnectorsController, AsciiStrnLenS(Prop->string, 255) + 1);

     Patches->KPATIConnectorsData = GetDataSetting (DictPointer, "ATIConnectorsData", &len);
     Patches->KPATIConnectorsDataLen = len;

I've worked around this until it can be fixed by setting my ATIConnectorsController to "8000x" (the "x" gets dropped leaving the correct "8000").

  • Like 4

During XML parsing the "prop->string" should be already NULL-terminating.

The error is somewhere else.

PS. May be odd/even number of chars?

Of course it is NULL-terminated, if it wasn't, Ascii* wouldnt't work...

 

"@param DestMax The maximum number of Destination Unicode char, !!including terminating null char.!!"

  • Like 1

Of course it is NULL-terminated, if it wasn't, Ascii* wouldnt't work...

 

"@param DestMax The maximum number of Destination Unicode char, !!including terminating null char.!!"

OK, I understand, thanks.

if (Prop && IsPropertyTrue (Prop)) {
+        gSettings.HWP = TRUE;
+        AsmWriteMsr64 (MSR_IA32_PM_ENABLE, 1);
+      }

Here is the code for turning HWP on for Clover. But it became ineffective when computer waked up from sleep. Is there a way we can manually call this method so that HWP remains effective after sleep?

 

I confirm the problem

Loading AnVMSR.kext.
AnVMSR.kext successfully loaded (or already loaded).
bash-3.2# ./anvmsr read 0x770
RDMSR 770 returns value 0x1
bash-3.2# ./anvmsr read 0x770
RDMSR 770 returns value 0x0
bash-3.2# exit

First read before sleep and second read after wake.

RehabMan proposed to change SMBIOS to resolve the problem.

But for me it appears to be better DISABLE HWP at Clover config.

And now I have normal speedstep. Good working speedstep

Снимок экрана 2017-07-10 в 21.06.24.png

The test is LuzMark 0.3.1 which is able to load only GPU (centre) or GPU + CPU (right end of graphic).

if (Prop && IsPropertyTrue (Prop)) {
+        gSettings.HWP = TRUE;
+        AsmWriteMsr64 (MSR_IA32_PM_ENABLE, 1);
+      }

Here is the code for turning HWP on for Clover. But it became ineffective when computer waked up from sleep. Is there a way we can manually call this method so that HWP remains effective after sleep?

 

Even though the other bits are 'reserved', better read, set the bit and write back instead of wiping whatever is currently there.

  • Like 1

 

He means this:

if (Prop && IsPropertyTrue (Prop)) {
  gSettings.HWP = TRUE;
  AsmWriteMsr64 (MSR_IA32_PM_ENABLE, AsmReadMsr64(MSR_IA32_PM_ENABLE) | 1);
}

Other bits are not deserved to bother about.

Anyway I tell about the problem that Clover can't set this bit after wake. There must be another technology. And so setting this bit in Clover has no sense at all.

  • Like 1

I confirm the problem

Loading AnVMSR.kext.
AnVMSR.kext successfully loaded (or already loaded).
bash-3.2# ./anvmsr read 0x770
RDMSR 770 returns value 0x1
bash-3.2# ./anvmsr read 0x770
RDMSR 770 returns value 0x0
bash-3.2# exit

First read before sleep and second read after wake.

RehabMan proposed to change SMBIOS to resolve the problem.

But for me it appears to be better DISABLE HWP at Clover config.

And now I have normal speedstep. Good working speedstep

attachicon.gifСнимок экрана 2017-07-10 в 21.06.24.png

The test is LuzMark 0.3.1 which is able to load only GPU (centre) or GPU + CPU (right end of graphic).

Is this normal?

post-1083558-0-10976900-1499753051_thumb.png

I confirm the problem

Loading AnVMSR.kext.
AnVMSR.kext successfully loaded (or already loaded).
bash-3.2# ./anvmsr read 0x770
RDMSR 770 returns value 0x1
bash-3.2# ./anvmsr read 0x770
RDMSR 770 returns value 0x0
bash-3.2# exit

First read before sleep and second read after wake.

RehabMan proposed to change SMBIOS to resolve the problem.

But for me it appears to be better DISABLE HWP at Clover config.

And now I have normal speedstep. Good working speedstep

attachicon.gifСнимок экрана 2017-07-10 в 21.06.24.png

The test is LuzMark 0.3.1 which is able to load only GPU (centre) or GPU + CPU (right end of graphic).

 

my case.

skylake u

smbios mbp13,3

pike idle patch

 

check HWPEnable

Sherlocksui-MBP:downloads sherlocks$ sudo kextload AnVMSR.kext      <------- boot
Sherlocksui-MBP:downloads sherlocks$ ./anvmsr read 0x770
RDMSR 770 returns value 0x1
Sherlocksui-MBP:downloads sherlocks$ sudo kextunload AnVMSR.kext    
Sherlocksui-MBP:downloads sherlocks$ sudo kextload AnVMSR.kext      <------- wakeup
Sherlocksui-MBP:downloads sherlocks$ ./anvmsr read 0x770
RDMSR 770 returns value 0x1
Sherlocksui-MBP:downloads sherlocks$ 

uncheck HWPEnable

Sherlocksui-MBP:downloads sherlocks$ sudo kextload AnVMSR.kext      <------- boot
Sherlocksui-MBP:downloads sherlocks$ ./anvmsr read 0x770
RDMSR 770 returns value 0x1
Sherlocksui-MBP:downloads sherlocks$ sudo kextunload AnVMSR.kext    
Sherlocksui-MBP:downloads sherlocks$ sudo kextload AnVMSR.kext      <------- wakeup
Sherlocksui-MBP:downloads sherlocks$ ./anvmsr read 0x770
RDMSR 770 returns value 0x1
Sherlocksui-MBP:downloads sherlocks$ 

i didn't see difference. 

my case.

skylake u

smbios mbp13,3

pike idle patch

 

check HWPEnable

Sherlocksui-MBP:downloads sherlocks$ sudo kextload AnVMSR.kext      <------- boot
Sherlocksui-MBP:downloads sherlocks$ ./anvmsr read 0x770
RDMSR 770 returns value 0x1
Sherlocksui-MBP:downloads sherlocks$ sudo kextunload AnVMSR.kext    
Sherlocksui-MBP:downloads sherlocks$ sudo kextload AnVMSR.kext      <------- wakeup
Sherlocksui-MBP:downloads sherlocks$ ./anvmsr read 0x770
RDMSR 770 returns value 0x1
Sherlocksui-MBP:downloads sherlocks$ 

uncheck HWPEnable

Sherlocksui-MBP:downloads sherlocks$ sudo kextload AnVMSR.kext      <------- boot
Sherlocksui-MBP:downloads sherlocks$ ./anvmsr read 0x770
RDMSR 770 returns value 0x1
Sherlocksui-MBP:downloads sherlocks$ sudo kextunload AnVMSR.kext    
Sherlocksui-MBP:downloads sherlocks$ sudo kextload AnVMSR.kext      <------- wakeup
Sherlocksui-MBP:downloads sherlocks$ ./anvmsr read 0x770
RDMSR 770 returns value 0x1
Sherlocksui-MBP:downloads sherlocks$ 

i didn't see difference. 

Well, checking HWPEnable just writes MSR 0x770 according to the source code:             #13688            

And you've done that manually via AnvMSR.kext and `anvmsr`, so there won't be any difference I guess.

Well, checking HWPEnable just writes MSR 0x770 according to the source code:             #13688            

And you've done that manually via AnvMSR.kext and `anvmsr`, so there won't be any difference I guess.

He only read the value.

You have no ordinary speedstep which depends on MacModel and SSDT tables.

  • Like 2

You need to remove the volume from GUI/Hide and add the Hidden=true key to the custom entry:

1:628  0:000  Custom entry 4 Title:"Recovery" FullTitle:"macOS High Sierra Recovery" Path:"\F9BF98CF-EB1D-42CF-AD05-11BFFD31250F\boot.efi" Type:10 Flags:0x6 matching Volume:"CF98BFF91DEBCF42AD0511BFFD31250F"
...
1:628  0:000      Checking volume "Recovery" (PciRoot(0x0)\Pci(0x17,0x0)\Sata(0x1,0xFFFF,0x0)\HD(2,GPT,1EA38F75-7907-4C2A-98A5-418D5602C373,0x64028,0xDE47A30)\VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,CF98BFF91DEBCF42AD0511BFFD31250F)) ... skipped because volume is hidden

EDIT: Also you don't need title and full title. FullTitle will replace the whole name of the entry, title only replaces the name of the volume, so it will say boot whatever from renamed.

You need to remove the volume from GUI/Hide and add the Hidden=true key to the custom entry:

1:628  0:000  Custom entry 4 Title:"Recovery" FullTitle:"macOS High Sierra Recovery" Path:"\F9BF98CF-EB1D-42CF-AD05-11BFFD31250F\boot.efi" Type:10 Flags:0x6 matching Volume:"CF98BFF91DEBCF42AD0511BFFD31250F"
...
1:628  0:000      Checking volume "Recovery" (PciRoot(0x0)\Pci(0x17,0x0)\Sata(0x1,0xFFFF,0x0)\HD(2,GPT,1EA38F75-7907-4C2A-98A5-418D5602C373,0x64028,0xDE47A30)\VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,CF98BFF91DEBCF42AD0511BFFD31250F)) ... skipped because volume is hidden

EDIT: Also you don't need title and full title. FullTitle will replace the whole name of the entry, title only replaces the name of the volume, so it will say boot whatever from renamed.
The entry I'm hiding is the preboot volume.

 

Sent from my SM-G930F using Tapatalk

Can you help again please, having trouble renaming macOS High Sierra recovery partition.

 

The entry I'm hiding is the preboot volume.

 

What? It clearly shows that you are hiding both volumes through GUI/Hide:

1:548  0:000      Checking volume "Preboot" (PciRoot(0x0)\Pci(0x17,0x0)\Sata(0x1,0xFFFF,0x0)\HD(2,GPT,1EA38F75-7907-4C2A-98A5-418D5602C373,0x64028,0xDE47A30)\VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,C7FE1592F829BA4BAFBF6C39E05C8616)) ... skipped because volume is hidden
...
1:548  0:000      Checking volume "Recovery" (PciRoot(0x0)\Pci(0x17,0x0)\Sata(0x1,0xFFFF,0x0)\HD(2,GPT,1EA38F75-7907-4C2A-98A5-418D5602C373,0x64028,0xDE47A30)\VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,CF98BFF91DEBCF42AD0511BFFD31250F)) ... skipped because volume is hidden

So unsure what you mean.

What? It clearly shows that you are hiding both volumes through GUI/Hide:

1:548  0:000      Checking volume "Preboot" (PciRoot(0x0)\Pci(0x17,0x0)\Sata(0x1,0xFFFF,0x0)\HD(2,GPT,1EA38F75-7907-4C2A-98A5-418D5602C373,0x64028,0xDE47A30)\VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,C7FE1592F829BA4BAFBF6C39E05C8616)) ... skipped because volume is hidden
...
1:548  0:000      Checking volume "Recovery" (PciRoot(0x0)\Pci(0x17,0x0)\Sata(0x1,0xFFFF,0x0)\HD(2,GPT,1EA38F75-7907-4C2A-98A5-418D5602C373,0x64028,0xDE47A30)\VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,CF98BFF91DEBCF42AD0511BFFD31250F)) ... skipped because volume is hidden

So unsure what you mean.

I'd like to rename High Sierra Recovery and hide PreBoot, That is the goal.

config.plist.zip

bootlog.log.txt

bdmesg.zip

diskutil list.zip

×
×
  • Create New...