Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add patchAPIC transition guide #48

Open
khronokernel opened this issue Aug 2, 2020 · 20 comments
Open

Add patchAPIC transition guide #48

khronokernel opened this issue Aug 2, 2020 · 20 comments
Labels
System Issues Not directly guide related but helpful for documentation

Comments

@khronokernel
Copy link
Member

As mentioned here: acidanthera/bugtracker#1070

OpenCore does not have an equivalent of patchAPIC, might be a good idea to explain the process of patching the table manually and reinjecting it. Seems to be mainly relevant for X58 and X79(and their server chipset counterpart) but may be helpful for other high core count systems.

@BrushXue Would it be possible to provide and ACPI dump? SysReport set to true will dump it(note you need DEBUG builds of OpenCorePkg)

@khronokernel khronokernel added the System Issues Not directly guide related but helpful for documentation label Aug 2, 2020
@BrushXue
Copy link

BrushXue commented Aug 2, 2020

Here you are.

opencore-2020-08-02-192854.txt

ACPI.zip

@khronokernel
Copy link
Member Author

@BrushXue Got around to working on the APIC guide, can you test this table?:

Should be modified correctly to match your ACPI tables, main issue is you have a dual socket system which complicates things on where the values are pulled from. And don't forget to add this table both to your EFI and your config.plist

You will also need this under ACPI -> Delete:

Key Type Value
All Boolean YES
Comment String Delete APIC Table
Enabled Boolean YES
TableLength Number 0
TableSignature Data 41504943

I have an initial draft here, though it's a bit unpolished so hasn't been merged yet:

@BrushXue
Copy link

BrushXue commented Aug 4, 2020

Thanks for your response. I have added the APIC you provided. Now the system can pass the previous point, but then freezes at
Darwin Image4 Validator Version...... without a kernel panic.
I've disabled my CPU PM and GPU spoof but same result.
Now my bootargs are npci=0x2000 -no_compat_check -xcpm -v keepsyms=1 -cpus=1
Here's the updated log:
opencore-2020-08-04-080553.txt

@khronokernel
Copy link
Member Author

Have a feeling I know where the stall is, pretty sure your first 2 threads of each CPU are getting an incorrect or missing Local APIC NMI table. Can you also provide an image? Just want to verify my suspicions.

I also looked through your log, and saw some interesting things:

  • -xcpm was removed in Sierra
  • -cpus=1 is incorrect, it should be cpus=1. General rule with arg is it will either have a - or = but never both
  • -no_compat_check What SMBIOS are you using? MacPro6,1 should work from Mavericks through Big Sur, not sure why you'd be using this arg
  • NullCPUPowerManagement.kext why? Ivy Bridge-E has native CPU power management, and then this clashes with your initial -xcpm boot-arg(which doesn't work anyways) but I don't really understand the logic of the pairing

@BrushXue
Copy link

BrushXue commented Aug 4, 2020

Actually I'm not surprising because I couldn't find new tutorials for x79. These are from very outdated x79 tutorials and I finally found this combination that works with Clover.
As for the Nullcpupm, I'm adding it just for debugging purpose.
Another question is the EC. I don't have a dummy EC in my clover setup but it still works. Should I add one?
So I've changed my bootargs to npci=0x2000 -v keepsyms=1 but got the same result.
IMG_1063

@BrushXue
Copy link

BrushXue commented Aug 4, 2020

I just tested my Clover setup. Removing xcpm and no_compat_check is OK. But I still need to inject CPU freq. from ssdtPrGen. So it'll be the same in OpenCore. Am I right?

@khronokernel
Copy link
Member Author

khronokernel commented Aug 4, 2020

Shouldn't need ssdt-PRgen, your hardware supports XCPM. SSDT-PLUG's all you should need
Oh if you have a clover setup booting, you could simply dump the patched APIC file with F5 in the picker. If you could send me this patched file I'd appreciate it

@BrushXue
Copy link

BrushXue commented Aug 4, 2020

I'm sending the whole ACPI folder you can find my own SSDTs as well.
ACPI.zip

@amadeusex
Copy link

I'm sending the whole ACPI folder you can find my own SSDTs as well.
ACPI.zip

Hi there.

I'm trying to get Catalina installed on my dual E5-2687w v2 HP z820.
Opencore stops with a kernel panic and the x86_validate topology() 32 threads but 33 registered .... message.

Did you manage to overcome the issues ?

@128keaton
Copy link

I am currently running into the same issue as well @amadeusex looks like we have to manually patch things, wish the guide was updated tho

@Allubz
Copy link

Allubz commented Nov 16, 2020

I can chime in, got a X299 Extreme4 here with i9-10900X that does the same (20threads but 21 registered). Clover with APIC Patch is doable, but I'm having trouble installing Big Sur (stuck on phase 2, "DiscX is write protected", regardless of fresh install or 10.15 -> 10.16 update); probably unrelated.

It's related to what is discussed here, including a guide on how to patch APIC. That, with the above table provided by khronokernel should fix it. Honestly, I didn't finish trying yet, so I'll report back.

I remember fixing a 9820X (10-core, but cut/lasered down by Intel, hence the weird APIC, was the thought), 9900X, the thread speaks of 9920X as well, and now this 10900X does the same.

UPDATE:
What worked for me is
1/ Make an ACPI dump with Clover (F4 on boot menu)
2/ Open APIC.aml and basically only edit the first core its processor id (my default was 10, rather than 00), as such:

[02Ch 0044   1]                Subtable Type : 00 [Processor Local APIC]
[02Dh 0045   1]                       Length : 08
[02Eh 0046   1]                 Processor ID : 00
[02Fh 0047   1]                Local Apic ID : 10
[030h 0048   4]        Flags (decoded below) : 00000001
                           Processor Enabled : 1

I suppose you need to make sure no other core is seen as "00", but I didn't need to change any other entries (as suggested in the Tony guide)
3/ Add to EFI/OC/ACPI and config.plist
4/ dropping APIC in ACPI/Delete in OC. Using OCC (I know, I know) setting the TableSignature to APIC (equivalent to 41504943)

@128keaton
Copy link

@Allubz awesome thank you for this information. Where is this guide you mention? I tried looking when I originally commented on this issue but came up empty handed. Unfortunately, for some reason my APIC table has three processor IDs with 00. Not sure why. Following the guide on the branch in the PR for this issue (which is a semi-complete patching guide), I could not follow it to completion since I have a few extra entries that need IDs that I do not have in the extracted DSDT.

@Allubz
Copy link

Allubz commented Nov 23, 2020

@128keaton Welcome! Did you read the "discussed here" link in my post? It's to Tony's. Specifically page 5 post # 42 there.

I think just changed the first ID to 00, and changing any other 00's to available numbers should fix it.

@gbabook
Copy link

gbabook commented Dec 15, 2020

Open APIC.aml and basically only edit the first core its processor id

I did one more thing, removed the "Unknown ... TYPE" code like:
START WITH:
[228h 0552 1] Subtable Type : 7F [Unknown Subtable Type]
[229h 0553 1] Length : 0C

**** Unknown MADT subtable type 0x7F

[36Ch 0876 1] Subtable Type : 7F [Unknown Subtable Type]
[36Dh 0877 1] Length : 0C

more and more....

**** Unknown MADT subtable type 0x7F
END

just only remove these codes, keep the others which are looked like normal.

compile until no error, in my case, OC / Clover boot successful.

@BrushXue
Copy link

BrushXue commented Feb 8, 2021

@BrushXue Got around to working on the APIC guide, can you test this table?:

Should be modified correctly to match your ACPI tables, main issue is you have a dual socket system which complicates things on where the values are pulled from. And don't forget to add this table both to your EFI and your config.plist

You will also need this under ACPI -> Delete:

Key Type Value
All Boolean YES
Comment String Delete APIC Table
Enabled Boolean YES
TableLength Number 0
TableSignature Data 41504943
I have an initial draft here, though it's a bit unpolished so hasn't been merged yet:

After 6 months I look into this problem again.
Seem like there's an error in APIC.aml, line 173
[0BEh 0190 1] Processor ID : 05
There's another 05 above. Changing it to
[0BEh 0190 1] Processor ID : 10
and now I can boot into Catalina successfully with OC 0.6.6. Still need to work on CPU PM and GPU spoofing but this specific problem is resolved.

@macattackjack
Copy link

macattackjack commented Mar 3, 2022

Here's a weird one.

Asus Prime X299-A, 16 GB Ram, EVGA GT 710 gpu

Bought and installed a Intel 9800X.

With Clover 5108 trying to boot into 10.15.5, the boot hangs.
Putting another 9800X in the same Motherboard, the boot works.
After much testing, returned the newly bought 9800x and got another one.
It still hangs.

Turning on PatchAPIC solves the problem with the newly bought 9800X

With OC 0.6.0 trying to boot into 11.63, the boot hangs again with newly bought 9800x, does not hang with old 9800X.

First, I don't know why two different CPUs, with the exact same model number, etc, would perform differently unless it's a different stepping, etc.

But, in Clover, the Patch APIC solves the problem.

  1. Can I assume this will also solve the same problem in OC? It seems to hang in the same place that other people have described, both with 10.15.5 and with 11.6.3

  2. Is this an issue that was fixed in a later version, or the latest version of OC?

  3. If it's not fixed or addressed in the versions after 0.6.0, what is the next step?

Again, this is weird. I have multiple X79 boards with various cpus, and I've never seen this issue where two identical CPUs can perform differently.

I will add a screen shot of where it's freezing, as I'm on the other Asus Prime X299-A posting this.

Thanks in Advance.

IMG_2382

@Allubz
Copy link

Allubz commented Mar 3, 2022

There are no, to me, known OC updates which fix this niche problem. It only relates to some 9800X's, as they seem cut-down sillicon from higher SKU's.

Run a newer OC version anyway, 0.6 is old as stone.

Use above method to produce a fix.

@macattackjack
Copy link

macattackjack commented Mar 4, 2022

Thanks

Hi

In 10.15.5 and clover 5108 I used Allubz's method, with MasiASL and removed unneeded entries as gbabook outlined.

In Clover, I placed the APIC.aml in the patched folder, and deleted all of the files from the origin folder.

Still not working. I took a video of the verbose boot and it still sees the first processor as ID 10

I want to get this to work in clover before I try to update OC and then get it to work with the new 9800X with 11.6.3

As far as being a niche problem, I understand the 299 platform is not as popular as some of the others, but in my research, it's the only one I found that has more than 16 PCI lanes, which is an issue for audio applications. The 9800X has something like 40 or 44 PCI lanes

Perhaps an offering of some kind to the gods of OpenCore might induce them to address this issue and offer a similar APIC patch in OC?

"It only relates to some 9800X's, as they seem cut-down sillicon from higher SKU's."

In other words, some 9800X's actually have only 8 cores, while others may in fact have more than 8 cores, but the extra cores are disabled so that the motherboard only sees 8?

I've attached my APIC aml. In clover it seems like it sees it, but it may not be working

Thoughts?

APIC.aml.zip
?

@Allubz
Copy link

Allubz commented Mar 6, 2022

I recommend finding an X299 OpenCore EFI that resembles your system. Can't help with Clover.

The X299 is quite the niche, and only a few CPU's have this problem. OC developers probably have better things to do. 'Cut down' is what I think the 9800X is, from a higher core count (10+) die, hence the trouble. I initially mistook your 9800X 8-core for a 9900/9920X 10-core, which I had similar trouble with.

I don't have time to check your APIC.aml at the moment. I suggest you carefully read through above suggestions, and the link to the Tony page. Also, make sure Patch APIC is disabled when testing your modified APIC.aml, otherwise there may be conflict.

@macattackjack
Copy link

"I recommend finding an X299 OpenCore EFI that resembles your system. Can't help with Clover."

I think that's how I got it to work in the first place, in combo with help from Olarila.

"Also, make sure Patch APIC is disabled when testing your modified APIC.aml, otherwise there may be conflict."

Done.

"I initially mistook your 9800X 8-core for a 9900/9920X 10-core, which I had similar trouble with."

If you still have that EFI, and are willing to share, please do here or in a private message.

I also have a i9-9960X on a Asus Prime X299-A that works without the Patch APIC on for clover with 10.14.6 and 10.15.5, and works with the 11.6.3 OC Build as well, and that I can swap between the two systems with my original, non cut down cpu's no problem. I also wonder if this has something to do with the motherboards as well. I'm currently on BIOS version 2002. When I tried updating it to the current bios, booting would freeze in a similar way it freezes without the PatchAPIC on if I am remembering correctly. I may try experimenting with that.

Anyway, thanks for your help, and please share the EFI for the 9900/9920X if you have it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
System Issues Not directly guide related but helpful for documentation
Projects
None yet
Development

No branches or pull requests

7 participants