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

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,342
The IOReg's are identical regarding the CPU processors etc.
The rename patches didn't change anything in system, not that I can see.
They may have helped with the boot process, but that is unclear.
As the full 8-cores/16-threads were working already in Big Sur, this test tells us very little.

As we know the revised EFI works, can you try booting Monterey and see if it changes anything when booting the newer OS.
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,342
I have added another rename patch to the config.plist attached below. This patch is to rename the second M.2 drive from pci1cc1,5236 to DEV1.

Screenshot 2022-07-22 at 19.49.18.png

Can you try booting with this config.plist and see if this changes how the second M.2 drive is defined in the IOReg.
 

Attachments

  • config.plist.zip
    6.2 KB · Views: 6

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I have added another rename patch to the config.plist attached below. This patch is to rename the second M.2 drive from pci1cc1,5236 to DEV1.

View attachment 6674

Can you try booting with this config.plist and see if this changes how the second M.2 drive is defined in the IOReg.
Do this before or after trying to run the monterey installer?
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,342
Both?
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
so far the monterey installer is a bust, it reboots when trying to run it from usb and same thing when downloading and upgrading from Big Sur. cannot get any screen info, reboot is too fast. I am going to try with the nvme rename because it seems to tank on the first reboot when it makes a partition for the upgrade.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I have added another rename patch to the config.plist attached below. This patch is to rename the second M.2 drive from pci1cc1,5236 to DEV1.

View attachment 6674

Can you try booting with this config.plist and see if this changes how the second M.2 drive is defined in the IOReg.
Trying to boot the new config plist results in an error OC: ACPI Patch 16 is borked, halting on critical error

Borked lol.
 

styde

New member
AMD OS X Member
Joined
Sep 29, 2020
Messages
7
Hi ! OpenCore 0.8.3 just coming out. Nothing about a TSC_ADJUST quirk. Im just wondering how USB ports could be operational on Lenovo Legion 5, waiting next OpenCore version.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Hi ! OpenCore 0.8.3 just coming out. Nothing about a TSC_ADJUST quirk. Im just wondering how USB ports could be operational on Lenovo Legion 5, waiting next OpenCore version.
I made a discovery recently regarding the latest chipsets. I suspect there is USB4 support in macOS, but it can only be activated under Intel chipsets.

As for enabling the USB functionality on the Legion 5, a DSDT dump is probably the best way to do it, but may need comparing with existing Ryzen SSDT builds.
Ryzen builds like ones used on a B550 board typically need XHC/XHC0 renaming or PTXH to XHC2.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Hi ! OpenCore 0.8.3 just coming out. Nothing about a TSC_ADJUST quirk. Im just wondering how USB ports could be operational on Lenovo Legion 5, waiting next OpenCore version.
I don’t think the tsc adjust is the issue as shaneee pointed out earlier. I myself have not had a chance to test 8.3 yet.
 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
I saw this guy say this way can skip MSR_IA32_TSC_ADJUST. May be different hardware TscSyncTimeout data is not the same, found the whole network did not find the specific setting value, but this can skip AppleACPIPlatform caused by kernel panic, this computer can not install may be really caused by TSC synchronization

Reference:




 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I saw this guy say this way can skip MSR_IA32_TSC_ADJUST. May be different hardware TscSyncTimeout data is not the same, found the whole network did not find the specific setting value, but this can skip AppleACPIPlatform caused by kernel panic, this computer can not install may be really caused by TSC synchronization

Reference:




Have you tried this with the latest opencore build? I am still stuck with no progress myself.
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Hi. I want to install Monterey on an AMD laptop (Legion 5 6th Gen with Ryzen 7 5800H and Radeon 6600M GPU). But the installation failed. There is a kernel panic during startup. I don't know what to do. Please help me find out what the problem is. thank you

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

This is to install monterey12.3.1

For my laptop, the same AppleACPIPlatform panic was caused by incorrect processor definitions in my ACPI tables. If you can send me your DSDT, I can send an SSDT to try. SSDT-CPUR from Dortania doesn't work.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
For my laptop, the same AppleACPIPlatform panic was caused by incorrect processor definitions in my ACPI tables. If you can send me your DSDT, I can send an SSDT to try. SSDT-CPUR from Dortania doesn't work.
What model do you have?
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
For my laptop, the same AppleACPIPlatform panic was caused by incorrect processor definitions in my ACPI tables. If you can send me your DSDT, I can send an SSDT to try. SSDT-CPUR from Dortania doesn't work.
Okay if your laptop is the same Lenovo Legion 5, I would suggest you try this. Use @Edhawk's EFI from his build here which has a new modified SSDT > https://forum.amd-osx.com/threads/a...monterey-kernel-panic.2725/page-26#post-20706

and add AppleMCEReporterDisabler.kext to the Kernel in config.plist and place the kext into EFI/OC/kexts.
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
@OG Nerd My laptop is an HP 15s-eq2027nq.

@Middleman I already got Monterey (12.6) and Ventura (13.0 Beta 7) working fine on my laptop, I was offering a patched SSDT-CPUR if anyone is stuck at the panic...
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
@OG Nerd My laptop is an HP 15s-eq2027nq.

@Middleman I already got Monterey (12.6) and Ventura (13.0 Beta 7) working fine on my laptop, I was offering a patched SSDT-CPUR if anyone is stuck at the panic...
Yeah, we cannot get past the panic on the legion 5, would you mind posting your working efi so we coukd try the ssdt of yours?
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Yeah, we cannot get past the panic on the legion 5, would you mind posting your working efi so we coukd try the ssdt of yours?
Send me your DSDT and I'll make the SSDT, dump it with SSDTTime.

If you can, send your EFI too.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Send me your DSDT and I'll make the SSDT, dump it with SSDTTime.

If you can, send your EFI too.
Ok I will post it tomorrow when I get back. Thanks
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
@OG Nerd @zxc2689963 @styde

I found your DSDT (OG Nerd) at post #250, so I made an EFI with some stuff from your EFI at post #243. The main differences are:

# Added more SSDTs to fix ACPI problems:
- SSDT-CPUR - Fixes CPU Thread definitions - Credits to Amega
- SSDT-EC - Adds a fake EC (Embedded Controller) device for macOS to use
- SSDT-HPET - Disables Legacy IRQ devices which can cause problems in macOS - SSDT-HPET is created by SSDTTime but modifed by me to set the HPEN variable to True, credits to Amega
- SSDT-SBUS-MCHC - Fixes SMBus support
- SSDT-SPRT - Disables the unexistent Serial Ports defined in ACPI - Credits to Amega
- SSDT-USBX - Fixes USB Power Properties
- SSDT-XOSI - Enables ACPI features locked to Windows OSes by default


# Added more Kexts:
- AirportItlwm - Adds Intel Wi-Fi support - The Monterey versions is included - Only enabled on Monterey by default
- AMDRyzenCPUPowerManagement - Fixes Power Management for AMD systems
- AmdTscSync - Fixes TSC issues on AMD systems, especially on laptops - Has to be configured manually by modifying IOCPUNumber in AmdTscSync.kext\Contents\Info.plist to your number of threads - 1 (Already configured by me, set to 15)
- AppleALC - Patches AppleHDA to fix audio - Has to be configured manually for your codec, I set the layout to 11 as it was like that in your EFI
- AppleMCEReporterDisabler - Disables the AppleIntelMCEReporter kext which causes panics on Monterey and above - Only enabled on Monterey and above by default
- BlueToolFixup - Allows third party Bluetooth cards on Monterey and above - Only enabled on Monterey and above by default
- ECEnabler - Fixes EC readings over 8 bytes
- IntelBluetoothFirmware.kext - Injects the firmware for the Bluetooth card
- IntelBluetoothInjector - Alternative to BlueToolFixup for macOS Big Sur and under - Only enabled on macOS Big Sur and under by default
- IntelBTPatcher - Patches parts of the Bluetooth stack
- Lilu - The core kext that enables most of the other kexts
- NVMeFix - Fixes NVMe Power Management along with other things on non-Apple NVMe drives
- RadeonSensor - Provides temperatures for the dGPU
- RealtekRTL8111 - Adds support for Realtek LAN
- RestrictEvents - Blocks unwanted processes causing compatibility issues on different hardware
- SMCAMDProcessor - Companion to AMDRyzenCPUPowerManagement
- SMCBatteryManager - Enables battery readings
- SMCRadeonGPU - Companion to RadeonSensor
- USBToolBox - Companion to UTBMap
- UTBMap - USB map - This kext was gotten from your EFI folder
- VirtualSMC - Emulates a fake SMC for macOS to use
- VoodooPS2Controller - Adds support for PS/2 devices like the internal keyboard
- WhateverGreen - Various Graphics patches

# Updated to OpenCore 0.8.4 with the latest Kexts and AMD Kernel Patches

# Cleaned the EFI:

- Remove useless Sample.plist values
- Remove bogus OpenCore Configurator (OCC) values
- Remove useless Kexts

# Disabled XhciPortLimit which breaks USB on 11.3+ along with other USB fixes

# Enabled Apple Secure Boot and added more debug/panic stuff

# Removed the cpus=1 boot argument

# Changed SMBIOS to MacBookPro15,4 for better compatibility

Notes:

- Please, do NOT edit this EFI with OpenCore Configurator (OCC), OpenCore Auxiliary Tools (OCAT) or any other tool like this. Use ProperTree. The configurators add bogus values and can sometimes corrupt the plist.
- This EFI should be able to boot Big Sur, Monterey and Ventura.
- Before using this EFI, make sure you're on the latest BIOS version.
- I would also recommend an NVRAM Reset before using this EFI.
- Do not connect to your Apple ID, it's not set-up for that and it might get you banned.

Anyone with this laptop model can try it.

Good luck!
 

Attachments

  • EFI.zip
    27.3 MB · Views: 24
Last edited:
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.