ChefKissInc / NootedRed

The AMD Vega iGPU support patch kext. No commercial use.
https://chefkissinc.github.io/applehax/nootedred/
Other
1.71k stars 870 forks source link

DMCUB service patch leads to crash in macOS Catalina #331

Open Zormeister opened 3 days ago

Zormeister commented 3 days ago

macOS Version

Catalina

What is your CPU's model?

AMD Ryzen 5 5625U

Please describe the behaviour in detail.

Used the latest NRed CI, alongside the initial DMCUB patch build.

This resulted in a crash.

Sorry for not having reported this earlier, I didn't want to flood the GitHub issues too much, hopefully this'll be the last FB-breaking issue.

What should've happened instead?

It should've booted to LoginWindow

If applicable, attach the .gpuRestart, .panic, etc file related to this issue.

Kernel-2024-11-19-174451.txt

VisualEhrmanntraut commented 3 days ago

Sorry for not having reported this earlier, I didn't want to flood the GitHub issues too much, hopefully this'll be the last FB-breaking issue.

Unfortunately I don't have a Renoir-based device so I can't catch the issues myself. The QC testers don't seem to have Catalina installed. Maybe you're the only one actually using Catalina, at least on a Renoir-based device.

VisualEhrmanntraut commented 3 days ago

@Zormeister That log you've shared says "macOS 13.6.9 (22G830)", not macOS 10.15.

VisualEhrmanntraut commented 3 days ago

Oh, but the XNU version in the panic text is 19.6.0, which is Catalina. Confusing.

VisualEhrmanntraut commented 3 days ago

Anyways Error code: 0x2 CR2 = 0xc0800 -> write to not present address 0xc0800 and that log says __ZN14AmdDalServices10initializeEv + 0xc3 But none of those instructions are writes

image
Zormeister commented 2 days ago

@Zormeister That log you've shared says "macOS 13.6.9 (22G830)", not macOS 10.15.

I keep rebooting back into macOS Ventura to fetch these logs, hence the incident report build being 13.6.9 as opposed to 10.15.7, 19H2026 or 19H15

Zormeister commented 2 days ago

@VisualEhrmanntraut

Did some manual debugging, Patch 1 seems to be borked on Catalina for whatever reason.

I disabled Patch 1, which resulted in booting to LoginWindow and being able to use the OS. As a sanity check, I re-enabled Patch 1 and disabled Patch 2, leading to the same crash in the panic log.

VisualEhrmanntraut commented 2 days ago

No shit, but that patch is just replacing cmp dword ptr [rcx + 0x2c], 0x8f with cmp eax, eax followed by a bunch of NOPs.

VisualEhrmanntraut commented 2 days ago

@Zormeister Does this work?

NootedRed-1.0.0-RESEARCH_RELEASE.zip

VisualEhrmanntraut commented 2 days ago

Added additional patch, to disable DMCUB firmware loading from DAL. The default is off in Big Sur and newer, but on in Catalina, for some reason.

VisualEhrmanntraut commented 2 days ago

Re-uploaded, because I made a copy paste error.

Zormeister commented 2 days ago

aight, can test soon

Zormeister commented 2 days ago

Same kernel panic with that build.

VisualEhrmanntraut commented 2 days ago

Well, don't see anything else that could be wrong, it supports DCN 2.1. I suggest getting a dmesg log from before the kernel panic.

Zormeister commented 2 days ago

Alright, I'll get to that at some point.

Zormeister commented 1 day ago

dmesg-21-11-2024 08.15.54.txt dmesg-21-11-2024 08.47.55.txt

VisualEhrmanntraut commented 1 day ago

Don't see any log from the framebuffer before the crash, I would've expected some kind of error. If only we could attach a debugger.

Zormeister commented 1 day ago

Sucks because the only networking I/O available is the unsupported WLAN card, USB Ethernet would maybe do the trick if I went out of may way to get one that works with Catalina

Resolving the unlabelled address might point in the right direction, though I'm not entirely sure

VisualEhrmanntraut commented 1 day ago

Doesn't matter because the KDK kernel doesn't boot even though the AMD vanilla patches apply, at least last time I tried. I would guess that there are some additional checks failing.

Zormeister commented 1 day ago

Random tangent, but the unspecified address led me on a bit of a chase.

The address specified looks to be within the boundaries of the kernel itself, so I decided to disassemble the kernel and try and find the address.

Anyways, from a glance it looks like it's some memset call maybe?

Math:

image

VisualEhrmanntraut commented 1 day ago

I know it's a kernel address, it's at the same range where the IOKit functions in the trace also are. I didn't have the kernel on hand, so I didn't bother attempting to look which function it was. I also theorised that it was some trap handler, rather than something like memset. This is useful information however, thanks.

VisualEhrmanntraut commented 1 day ago
image

Maybe the a1879 one?

Zormeister commented 1 day ago

Maybe, I don't know for sure.

VisualEhrmanntraut commented 1 day ago

@Zormeister Can you try this?

NootedRed-1.0.0-RESEARCH_RELEASE.zip

Zormeister commented 1 day ago

Same general panic, however the CR2 value changed to 0x00000000000afc00

Kernel-2024-11-21-214429.txt

VisualEhrmanntraut commented 1 day ago

I guess that's technically progress.