Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2019 13:38:35 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r354811 - stable/12/sys/amd64/amd64
Message-ID:  <201911181338.xAIDcZ5M068841@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911181338.xAIDcZ5M068841>