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

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
@OG Nerd @zxc2689963

I found your DSDT at post #250. I made an EFI for you based on my own one. Here is a list of the most massive changes from your EFI at post #241:
# 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!
Ok, I will try it tomorrow and report back, thank you.
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Is anyone able to test the EFI I sent a few messages before?
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Hello! I tested. One minor error on ExecutablePath with the Intel Bluetooth Injector kext definition in config.plist. Finally boot adding cpus=1.
Which model laptop do you have?
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
I think for those of you with the cpus=1 issue should check out this thread on Acidanthera.

Specifically the post by anonymous-writer.

It looks like if you change the IOCPUNumber to 0 on TSCAdjustReset.kext the system should boot without cpus=1.
 

Middleman

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

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Hello! I tested. One minor error on ExecutablePath with the Intel Bluetooth Injector kext definition in config.plist. Finally boot adding cpus=1.
Is it still not booting without cpus=1? send a screenshot of the panic.

- ExtremeXT
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
Hello! I tested. One minor error on ExecutablePath with the Intel Bluetooth Injector kext definition in config.plist. Finally boot adding cpus=1.
I had the same bluetooth problem. But I got stuck with last minute inconveniences to test. I will resume soon
 

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
@Jo-Toku @styde
Try this EFI (of course, when you have time).

Changes:
  • Fixed IntelBluetoothInjector typo
  • Fixed PCI stall

- ExtremeXT
 

Attachments

  • EFI.zip
    27.3 MB · Views: 4

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843

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

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
TSCAdjustReset shouldn't work on AMD, AmdTscSync is the correct one.
 
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.