svn commit: r354811 - stable/12/sys/amd64/amd64
Konstantin Belousov
kib at FreeBSD.org
Mon Nov 18 13:38:37 UTC 2019
Author: kib
Date: Mon Nov 18 13:38:35 2019
New Revision: 354811
URL: https://svnweb.freebsd.org/changeset/base/354811
Log:
MFC r354630:
amd64: Issue MFENCE on context switch on AMD CPUs when reusing address space.
Modified:
stable/12/sys/amd64/amd64/pmap.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/12/sys/amd64/amd64/pmap.c Mon Nov 18 13:37:13 2019 (r354810)
+++ stable/12/sys/amd64/amd64/pmap.c Mon Nov 18 13:38:35 2019 (r354811)
@@ -8592,8 +8592,11 @@ pmap_activate_sw(struct thread *td)
oldpmap = PCPU_GET(curpmap);
pmap = vmspace_pmap(td->td_proc->p_vmspace);
- if (oldpmap == pmap)
+ if (oldpmap == pmap) {
+ if (cpu_vendor_id != CPU_VENDOR_INTEL)
+ mfence();
return;
+ }
cpuid = PCPU_GET(cpuid);
#ifdef SMP
CPU_SET_ATOMIC(cpuid, &pmap->pm_active);
More information about the svn-src-stable-12
mailing list