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: 158
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...

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
Thanks for the tip, I remember reading about that somewhere within this thread. so my first four patches should be;

B8100000 0000
BA100000 0000
BA100000 0090
BA100000 00

instead of;

B8080000 0000
BA080000 0000
BA080000 0090
BA080000 00

And will Sonoma work, or should I install Monterey?. TIA
No, your kernel patch is 8 correct, your SSDT-CPUR is not right, there are too many cores do not know whether it has an impact, try the SSDT-CPUR I provide屏幕截图 2024-01-06 173935.png
 

Attachments

  • SSDT-CPUR.aml.zip
    907 bytes · Views: 5

craighazan

Donator
Donator
Joined
Nov 22, 2021
Messages
344
No, your kernel patch is 8 correct, your SSDT-CPUR is not right, there are too many cores do not know whether it has an impact, try the SSDT-CPUR I provided.

Thanks for your help, unfortunately I’m still getting this kp.

IMG_0157.jpeg
 

craighazan

Donator
Donator
Joined
Nov 22, 2021
Messages
344
Try using parameter CPUS=1
We're all good, I established that CPUR wasn't needed for the Ren5000, the chipset isn't a 500 series board. But thanks for the help.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
No boot with MacBookPro15,4
Okay try this one. This file has been heavily revised from OGNerd's build and I've included the new TSCAdjustReset file and a new SSDT-CPUR.
Give it a try.
 

Attachments

  • EFI.zip
    40.6 MB · Views: 16

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
So I noticed that I did a lot of typos in SSDT-CPUR, which would certainly explain the stall/panic near AppleACPICPU. Please try this revised EFI. If it's still getting stuck try removing npci=0x3000 from boot-args. The SysReport folder created on the root of your USB drive would also be useful, since I need to take a value from FACP for the SSDT.

- ExtremeXT
Yes, and that's why I created a new SSDT-CPUR-5800HX-rev2 for the new EFI I posted earlier today. Because the one used by @scyte was likely based on
@zxc2689963's build which I found was using a different CPU naming scheme compared to other Ryzen's I'd seen. This is why it isn't recognised by the OS. In the old SSDT-CPUR they were defined as processors. In the newer chips they are defined as devices.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
I tried your latest EFI and SSDT-CPUR.aml, and I was trying to load Monterey installer. But I still need cpus=1 or there will be kernel panic.

After I add cpus=1 in boot-args, I thought it still just stuck at somewhere after PCI configuration. Not sure what happened since there is no SysReport.zip generated in EFI folder in my USB installer.

I also tried to load Big Sur installer, it doesn't need cpus=1, but still stuck at somewhere after PCI configuration. Tried to remove/add npci=0x2000/0x3000 but nothing changed.

Any ideas for this strange phenomenon?
View attachment 7249
The above image shows it is stalling at something related to your USBToolBox.kext. Did you also enable UTBMap.kext as part of the package? UTBMap should load as secondary kext.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
I think there's nothing wrong with these two kexts in config.plist......
View attachment 7251

Actually I disabled part of kexts like RealtekRTL8111 and VoodooPS2Trackpad, itlwm, so it seems be to stuck at USBToolBox:....time out. Everytime it stuck shortly after PCI Configuration end.
Alright, I already see an issue. Your VirtualSMC is in the wrong place. VirtualSMC is a primary OC kext so must be loaded after Lilu and Whatevergreen and AppleALC.
Then underneath VirtualSMC we load AMDRyzenCPUPowerManagement and SMCAMDProcessor.kext in that order.

If it also helps, this kext list is from OGNerd's working Legion 5 build afaik. You'll notice he added GenericUSBXHCI.kext as well to the build. However he had put UTBMap up top which I don't agree with. It usually must come after VirtualSMC:

Screen Shot 2022-09-18 at 6.25.02 PM.png
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Thanks again for your help,Use USBToolBox will be stuck in USBToolBox: XHC0: waitForMatchingService failed or timed out

Use USBPorts.kext to customize the correct port will be stuck in AppleNVME Assert failed

Using GenericUSBXHCI.kext can enter the system normally even if it is restarted, but cannot be used to start the installation program. It will cause USB failure and can only be installed in a non-USB way, which is why many people cannot install it
Not sure if you know but USBToolbox.kext also requires the use of UTBMap.kext loaded afterwards to work. On top of that for AMD setups you may need a PTXH or XHC rename SSDT for the USB to work. Check out CaseySJ’s guides on Ryzen setups for this.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Still got kernel panic... I made this usb installer quite a long time ago, it should be 12.3 beta 1/2......
View attachment 7254
Check if it is missing AppleMCEReporterDisabler.kext. That is essential to booting Monterey 12.4+ on AMD setups.
 
Back
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.