aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2022-01-25 10:34:08 +0000
committerAndriy Gapon <avg@FreeBSD.org>2022-01-25 10:34:08 +0000
commite0cc1ce7c0866d6a5c42ef09cfca9582c4a8343c (patch)
tree2e94e4b25b941a8980447bb80f68aadfb501c1bf
parent9f8b984392f2ed055703013fd46089bd516c620c (diff)
downloadsrc-e0cc1ce7c0866d6a5c42ef09cfca9582c4a8343c.tar.gz
src-e0cc1ce7c0866d6a5c42ef09cfca9582c4a8343c.zip
smp_targeted_tlb_shootdown has to pin the CPU on i386
This should fix a regression in 1820ca215461 which happened because pmap -> shootdown contracts on amd64 and i386 diverged. On amd64 the pmap code always pins the CPU before calling the shootdown code and expects it to unpin on return. On i386 the pmap code either has pins and unpins around the shootdown calls or does not pin at all. This change should account for that difference. In main and stable/13 the contracts are also different, but the shootdown code is split into the i386 and amd64 variants and each variant is tailored towards the platform's pmap. PR: 261338 Reported by: Dmitry K. <thedix@yandex.ru> Debugged by: Dmitry K. <thedix@yandex.ru> Tested by: Dmitry K. <thedix@yandex.ru> Fixes: 1820ca215461 MFC r368649 / 3fd989da by kib: amd64 pmap: fix PCID mode invalidations Reviewed by: kib X-Pointyhat to: avg Differential Revision: https://reviews.freebsd.org/D33980
-rw-r--r--sys/x86/x86/mp_x86.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c
index 2108d448bb9a..57cea8c7a07a 100644
--- a/sys/x86/x86/mp_x86.c
+++ b/sys/x86/x86/mp_x86.c
@@ -1678,6 +1678,10 @@ smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap,
uint32_t generation;
int cpu;
+#ifdef __i386__
+ sched_pin();
+#endif
+
/*
* It is not necessary to signal other CPUs while booting or
* when in the debugger.