Page MenuHomeFreeBSD

amd64: enable EFER.TCE
ClosedPublic

Authored by alc on Jun 30 2025, 5:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 29, 2:38 AM
Unknown Object (File)
Wed, Sep 24, 2:58 AM
Unknown Object (File)
Wed, Sep 24, 1:56 AM
Unknown Object (File)
Thu, Sep 18, 10:15 AM
Unknown Object (File)
Thu, Sep 18, 3:09 AM
Unknown Object (File)
Wed, Sep 17, 8:58 AM
Unknown Object (File)
Sep 10 2025, 6:38 AM
Unknown Object (File)
Aug 21 2025, 8:42 PM
Subscribers

Details

Summary

This option tells AMD processors that targeted TLB invalidation instructions, such as invlpg, only have to invalidate page walk cache entries along the path to the targeted virtual address. Since we have long issued TLB invalidation operations before freeing any page table pages, this option should be safe for use with the amd64 pmap.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

alc requested review of this revision.Jun 30 2025, 5:12 PM
alc created this revision.

dougm@ has been running stress on a Ryzen processor for more than 24 hours, and seen no ill effects.

It would be useful to provide a reasoning why the setting is safe.

From my understanding, there are (at least) two situations where TCE would be unsafe:

  1. Recursive pt mapping. But when we modify the kernel page table in a way that modifies the paging structure above the lowest level, we also explicitly invalidate the recursive mapping, in pmap_remove_kernel_pde(), pmap_demote_pde(), pmap_demote_pdpe().
  2. Sharing page table pages, mostly relevant when sharing occurs not at the leafs of the page table radix tree. We do not do that at all.

Anything else I missing?

This revision is now accepted and ready to land.Jul 1 2025, 3:02 AM
In D51093#1166331, @kib wrote:

It would be useful to provide a reasoning why the setting is safe.

From my understanding, there are (at least) two situations where TCE would be unsafe:

  1. Recursive pt mapping. But when we modify the kernel page table in a way that modifies the paging structure above the lowest level, we also explicitly invalidate the recursive mapping, in pmap_remove_kernel_pde(), pmap_demote_pde(), pmap_demote_pdpe().
  2. Sharing page table pages, mostly relevant when sharing occurs not at the leafs of the page table radix tree. We do not do that at all.

Anything else I missing?

No, I don't think that you are missing anything.

This revision was automatically updated to reflect the committed changes.