HomeFreeBSD

riscv: set kernel_pmap hart mask more precisely

Description

riscv: set kernel_pmap hart mask more precisely

In pmap_bootstrap(), we fill kernel_pmap->pm_active since it is
invariably active on all harts. However, this marks it as active even
for harts that don't exist in the system, which can cause issue when the
mask is passed to the SBI firmware via sbi_remote_sfence_vma().
Specifically, the SBI spec allows SBI_ERR_INVALID_PARAM to be returned
when an invalid hart is set in the mask.

The latest version of OpenSBI does not have this issue, but v0.6 does,
and this is triggering a recently added KASSERT in CI. Switch to only
setting bits in pm_active for harts that enter the system.

Reported by: Jenkins
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D27080

Details

Provenance
mhorneAuthored on
Reviewer
markj
Differential Revision
D27080: riscv: correctly set kernel_pmap hart mask
Parents
rS367355: Fix UMA alignment for COP2 context structure.
Branches
Unknown
Tags
Unknown