HomeFreeBSD

amd64: Fix TLB invalidation routines in !SMP kernels

Description

amd64: Fix TLB invalidation routines in !SMP kernels

amd64 is special in that its implementation of zpcpu_offset_cpu() is not
the identity transformation, even in !SMP kernels. Because the pm_pcidp
array of amd64's struct pmap is allocated from a pcpu UMA zone, this
means that accessing pm_pcidp directly, as is done in !SMP
implementations of pmap_invalidate_*, does not work. Specifically, I
see occasional unexplicable crashes in userspace when PCIDs are enabled.

Apply a minimal patch to fix the problem. While it would also make
sense to provide separate implementations of zpcpu_* for !SMP kernels,
fixing it this way makes the SMP and !SMP implementations of
pmap_invalidate_* more similar.

Reviewed by: alc, kib
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D41230

Details

Provenance
markjAuthored on Jul 30 2023, 3:12 PM
Reviewer
alc
Differential Revision
D41230: amd64: Fix TLB invalidation routines in !SMP kernels
Parents
rG38f5cb1bfbe1: radix_tree: redefine the clev field
Branches
Unknown
Tags
Unknown