From 157edace4ad3f3703e858e4fdea3d77a0b1832e0 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 24 May 2024 13:28:20 -0400 Subject: kernel/amd64: pmap: Fix check for listed CPUs Only perform a TLB shootdown if the number of cores listed is greater than one. Signed-off-by: Ian Moffett --- sys/arch/amd64/amd64/pmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c index 468cca4..6eca948 100644 --- a/sys/arch/amd64/amd64/pmap.c +++ b/sys/arch/amd64/amd64/pmap.c @@ -206,12 +206,12 @@ pmap_modify_tbl(struct vm_ctx *ctx, struct vas vas, vaddr_t va, size_t val) tbl[pmap_get_level_index(1, va)] = val; /* - * Do TLB shootdown if CPUs are listed. + * Do TLB shootdown if multiple CPUs are listed. * * XXX: Some might not be listed during early * startup. */ - if (cpu_get(0) != NULL) { + if (cpu_count() > 1) { tlb_shootdown(va); } -- cgit v1.2.3