Page 1 of 1

APIC and uncacheable mapping

Posted: Mon Dec 09, 2024 1:18 pm
by mrjbom
An article on the osdev wiki states in the code comments, “Section 11.4.1 of the Intel SDM Volume 3 recommends that the base address page be displayed as strongly uncacheable for correct APIC operation”.
However, I couldn't find section 11.4.1 and I didn't find it in the neighboring sections either.
I would like to know if I should disable caching only for base address mapping or for all other ACPI related addresses?

Re: ACPI and uncacheable mapping

Posted: Mon Dec 09, 2024 2:07 pm
by iansjack
The Intel manuals have varied over the years, so chapters and sections may vary. In the edition that I am looking at it’s section 10.4.1. It’s always possible that there’s a typo in that comment.

Re: ACPI and uncacheable mapping

Posted: Mon Dec 09, 2024 2:22 pm
by mrjbom
iansjack wrote: Mon Dec 09, 2024 2:07 pm The Intel manuals have varied over the years, so chapters and sections may vary. In the edition that I am looking at it’s section 10.4.1. It’s always possible that there’s a typo in that comment.
That's right, in my May 2020 version it's section 10.4.1. Thanks!

Re: ACPI and uncacheable mapping

Posted: Mon Dec 09, 2024 2:26 pm
by Octocontrabass
mrjbom wrote: Mon Dec 09, 2024 1:18 pmAPIC
ACPI
APIC and ACPI are two different things. Which one are you asking about?

Re: ACPI and uncacheable mapping

Posted: Mon Dec 09, 2024 2:29 pm
by mrjbom
Octocontrabass wrote: Mon Dec 09, 2024 2:26 pm
mrjbom wrote: Mon Dec 09, 2024 1:18 pmAPIC
ACPI
APIC and ACPI are two different things. Which one are you asking about?
Oops. I'm talking about APIC.

Re: ACPI and uncacheable mapping

Posted: Mon Dec 09, 2024 2:30 pm
by mrjbom
But I'm not quite sure how I'm must do that. I guess I have to set the PCD bit and clear PWT bit in PT for this page and that's it?

Re: ACPI and uncacheable mapping

Posted: Mon Dec 09, 2024 3:05 pm
by Octocontrabass
mrjbom wrote: Mon Dec 09, 2024 2:30 pmI guess I have to set the PCD bit and clear PWT bit in PT for this page and that's it?
If you want to set the page's memory type to UC, you need to set both PCD and PWT (assuming the PAT is unsupported or set to the default).

But usually you don't need to do that. The firmware should have initialized the MTRRs to make all MMIO uncacheable.

Re: ACPI and uncacheable mapping

Posted: Mon Dec 09, 2024 3:18 pm
by mrjbom
Octocontrabass wrote: Mon Dec 09, 2024 3:05 pm
mrjbom wrote: Mon Dec 09, 2024 2:30 pmI guess I have to set the PCD bit and clear PWT bit in PT for this page and that's it?
If you want to set the page's memory type to UC, you need to set both PCD and PWT (assuming the PAT is unsupported or set to the default).

But usually you don't need to do that. The firmware should have initialized the MTRRs to make all MMIO uncacheable.
I'll do it anyway, just in case. Thanks for the reply!