AMD Rayon R7 5800H Install Monterey kernel Panic

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
Hello everyone, the Monterey kernel panic problem has been solved for AMD R7 5800H notebook installation. It is a great thing that the CPU can now run on 8 cores. Thank you guys very much.Thank them for discovering the problem and providing kernel patches @ExtremeX@Visual

Brand: Lenovo
Model: Legion 5 6th Gen
CPU: AMD Ryzen 7 5800h
GPU: AMD Radeon RX 6600m 8GB ( Separate GPU mode)
HDD: Samsung SSD 970 EVO Plus 1TB (1000 GB, PCI-E 3.0 x4)
WDS500G3X0C-00SJG0 (500 GB, PCI-E 3.0 x4)
Network: RealTek Semiconductor RTL8168/8111 PCI-E Gigabit Ethernet NIC
Intel(R) Wi-Fi 6E AX210 160MHz
Ram: x2 8GB 3200mhz ddr4
Display: 15.6 1080p 165HZ

Updated October 5, 2023
Problems solved:
1. You do not need to disable XHCI
2. The microphone problem is rectified
3. Monitor brightness can be adjusted, only in Ventura

Unresolved issues:
Failure to wake from sleep

 

Attachments

  • EFI-2023-10-5.zip
    40 MB · Views: 148
Last edited:
Solution
Panic from Monterey 12.6
View attachment 7258
Thanks. I looked at the sched_prim.c file in the XNU Kernel source code (nice of Apple to let us know exactly where to search) and found that it's related to the TSC (Time Stamp Counter) Syncronization of the CPU cores. The section of the code which gives the panic is: https://github.com/apple-oss-distributions/xnu/blob/xnu-8020.140.41/osfmk/kern/sched_prim.c#L2836
Unfortunately Apple didn't update the XNU Source Code for macOS 12.6 yet, but I still managed to find the place where it calls the panic.
Image 1 is the code of XNU that panics if the time between cores does not match (not syncronized properly).

As seen when comparing the Big Sur and Monterey code (Image 2), Big Sur...

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Okay that's good to hear (because yours is the first known AMD CPU & IGPU I've encountered that works). If you've managed to install Big Sur on this and it's working that is extremely good news for the community.

Okay onto setting up the Monterey - have you created a custom USB map kext yet? It is vital that you do. You need to ideally create from within Big Sur.
Use the following USBMap script from here and once you've created it and reduced your USB port map down to less than 15 ports, disable your USBInjectAll and XHCIPortLimit setting to try to boot into Monterey.


If anything else try to also make sure agdpmod=pikera is enabled in the NVRAM boot-arg (to enable the RX6600M).
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
On a separate note, I had a quick look at your EFI, and find it totally odd you'd even managed to boot Big Sur! I noticed you hadn't even enabled SMCAMDProcessor.kext and a
whole load of other important kexts like AppleALC, Whatevergreen, SMCSuperIO, or AMDRyzenCPUPowerManagement. You also don't have the device properties set for the RX6600, which should be these:

Screen Shot 2022-04-11 at 1.39.59 PM.png
 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
Yes, my OC configuration KEXT is all selected. You can enter the Big Sur installation screen. But most cases stop at the following code. You can only force the restart to try more times. Also, the Big Sur installation screen is slow to respond. The mouse can only move slowly. The graphics card has no driver. Therefore, the installation fails.



 

Attachments

  • EFI.zip
    6.2 MB · Views: 49

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Yes, my OC configuration KEXT is all selected. You can enter the Big Sur installation screen. But most cases stop at the following code. You can only force the restart to try more times. Also, the Big Sur installation screen is slow to respond. The mouse can only move slowly. The graphics card has no driver. Therefore, the installation fails.



Okay I've looked at it and done some changes. One of the biggest was adding some missing ACPIs plus adding some USB kexts and SMCBatteryManager.

During install it is best to use USBInjectAll but switching on XHCIPortLimit to enabled (for Big Sur) - and then switch over to USBMap but turn off XHCIPortLimit once you manage to boot into the system to install Monterey as Monterey needs this.

Anyways give it a try.
 

Attachments

  • EFI.zip
    28.8 MB · Views: 82

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
Okay I've looked at it and done some changes. One of the biggest was adding some missing ACPIs plus adding some USB kexts and SMCBatteryManager.

During install it is best to use USBInjectAll but switching on XHCIPortLimit to enabled (for Big Sur) - and then switch over to USBMap but turn off XHCIPortLimit once you manage to boot into the system to install Monterey as Monterey needs this.

Anyways give it a try.
Thank you for your answer, I tried to stop at [EB LOG:EXITBS]

I want to solve the problem of installing Monterey. The test started the Big Sur installation, but failed to start Monterey.

kernel panic: AppleACPIPlatform





Installation mode: Hard disk Create 1 GB EFI partition. The com.apple.recovery.boot and OC files are placed on the hard drive EFI. Start the installation on a hard disk. Troubleshoot USB port faults. Of course I customized usbmap.kext.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Thank you for your answer, I tried to stop at [EB LOG:EXITBS]

I want to solve the problem of installing Monterey. The test started the Big Sur installation, but failed to start Monterey.

kernel panic: AppleACPIPlatform





Installation mode: Hard disk Create 1 GB EFI partition. The com.apple.recovery.boot and OC files are placed on the hard drive EFI. Start the installation on a hard disk. Troubleshoot USB port faults. Of course I customized usbmap.kext.
Did you try the latest EFI I uploaded in the last post? That has a special kernel patch for Monterey, which you must use in conjunction with the USBMap.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Did you try the latest EFI I uploaded in the last post? That has a special kernel patch for Monterey, which you must use in conjunction with the USBMap.
Oh in addition, you must also add AppleMCEReporterDisable.kext. That's for the latest 12.3 bug.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
I would also suggest if it gets stuck at [EB LOG:EXITBS] to try and deselect SetupVirtualMap. That's usually the culprit.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723

zxc2689963,

So I looked back at your DSDT dump. One thing I did notice is that in your DSDT shows up each of your cores as 'Processor Devices' instead of as 'Processor' as with typical Intel naming. This is quite an unusual development because this new method of CPU renaming has only so far been seen on Intel's Alder Lake chipset and not AMD. Not even the Ryzen 5900X that I have seemed to have used this table. That's probably why your installation is stalling at AppleACPIPlatform - it is looking for the parameters to connect to the CPU.

Screen Shot 2022-04-15 at 6.43.58 AM.png


Compare this to the DSDT from a traditional' HP Whiskey Lake laptop:

Screen Shot 2022-04-15 at 6.43.22 AM.png

 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135

zxc2689963,​

So I looked back at your DSDT dump. One thing I did notice is that in your DSDT shows up each of your cores as 'Processor Devices' instead of as 'Processor' as with typical Intel naming. This is quite an unusual development because this new method of CPU renaming has only so far been seen on Intel's Alder Lake chipset and not AMD. Not even the Ryzen 5900X that I have seemed to have used this table. That's probably why your installation is stalling at AppleACPIPlatform - it is looking for the parameters to connect to the CPU.​

View attachment 5685

Compare this to the DSDT from a traditional' HP Whiskey Lake laptop:​

View attachment 5686

Yes, so I added SSDT-CPUR, I set it up as B550 motherboard, may need another way to define CPU
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Yes, so I added SSDT-CPUR, I set it up as B550 motherboard, may need another way to define CPU
Yes that's right! But the SSDT-CPUR needs to be renamed (internally). You need to somehow wrap them.
We already have them renamed for Alder Lake, but they need to be renamed for the Ryzen 5800H.

Also have you tried to use Clover's firmware dumper to get your DSDT? As It seems we're missing some of the FACP data.
 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
Yes that's right! But the SSDT-CPUR needs to be renamed (internally). You need to somehow wrap them.
We already have them renamed for Alder Lake, but they need to be renamed for the Ryzen 5800H.

Also have you tried to use Clover's firmware dumper to get your DSDT? As It seems we're missing some of the FACP data.
Strange. Cpus can be identified in Big Sur. Monterey is not.

I've tried your EFI. It's stuck [EB LOG:EXITBS].

I uploaded Clover's extracted DSDT. Hope someone can help me.

Kernel Panic: AppleACPIPlatform is stuck

 

Attachments

  • clover-dsdt.zip
    101.5 KB · Views: 16

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Strange. Cpus can be identified in Big Sur. Monterey is not.

I've tried your EFI. It's stuck [EB LOG:EXITBS].

I uploaded Clover's extracted DSDT. Hope someone can help me.

Kernel Panic: AppleACPIPlatform is stuck

Thanks for that. I have one more thing for you to do.

If you can run Big Sur, see if you can run a copy of MacIASL, and from the menu select New from ACPI > FACP (Fixed ACPI Description Table).
This is required to build your SSDT-CPUR.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Alright, I've gone a bit ahead of you. I've tried to build 2 different types of SSDT-CPUR for your setup. The first one named SSDT-CPUR-5800H.aml is taken from an existing B550 build, but reduced the number of lines to match up with the threads. The second one named SSDT-CPUR-LEGION5.aml is one that should allow for CPU device-wrapping as it is based on a similar structure for one of my Z690 Alder Lake chipset board. Use one or the other when trying to boot the system. The last one is using the block address of 0x0000810 which is the same as B550 CPUR value.
 

Attachments

  • SSDT-CPUR.zip
    1.8 KB · Views: 26

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
thank you.I use SSDT-Legion Stuck in ACPI Error [PLTF]. It shouldn't work.I use SSDT-5800HX Stuck in Old place is Kernel Panic.
But I see AppleACPICPU: ProcessorId=15. Whether it indicates that the CPU has identified successfully.Maybe it's something else.
Maybe there's a TSC problem with CPU core synchronization.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
thank you.I use SSDT-Legion Stuck in ACPI Error [PLTF]. It shouldn't work.I use SSDT-5800HX Stuck in Old place is Kernel Panic.
But I see AppleACPICPU: ProcessorId=15. Whether it indicates that the CPU has identified successfully.Maybe it's something else.
Maybe there's a TSC problem with CPU core synchronization.
Have you set the processor type as 3842 under the PlatformInfo?
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
thank you.I use SSDT-Legion Stuck in ACPI Error [PLTF]. It shouldn't work.I use SSDT-5800HX Stuck in Old place is Kernel Panic.
But I see AppleACPICPU: ProcessorId=15. Whether it indicates that the CPU has identified successfully.Maybe it's something else.
Maybe there's a TSC problem with CPU core synchronization.
Btw are you able to run Big Sur? Do you get the RX6600M graphics acceleration? Can you do an IOReg dump from it? As for the ProcessorID=15 I think that is an APIC issue.
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,259
RX6600 is not supported in Big Sur. The drivers for the RX 6600 series of cards were only added to Monterey 12.2, if I recall correctly.
 
Top Bottom
  AdBlock Detected
Sure, ad-blocking software does a great job at blocking ads, but it also blocks some useful and important features of our website. For the best possible site experience please take a moment to disable your AdBlocker.