svn commit: r344053 - stable/11/sys/i386/include

Konstantin Belousov kib at FreeBSD.org
Tue Feb 12 16:56:11 UTC 2019


Author: kib
Date: Tue Feb 12 16:56:10 2019
New Revision: 344053
URL: https://svnweb.freebsd.org/changeset/base/344053

Log:
  Fix PAE modules build on i386.
  
  Reimplement PAE version of pte_load() by copying/pasting the
  atomic_load_acq_64_i586() into it definition. pmap_kextract() is defined
  as inline and uses pte_load() in its body, so the pte_load() should be
  available when pmap.h is included. On stable/11, the atomic inlines are
  not exposed to modules.
  
  This is a direct commit to stable/11.
  
  Reported by:	dim
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/11/sys/i386/include/pmap.h

Modified: stable/11/sys/i386/include/pmap.h
==============================================================================
--- stable/11/sys/i386/include/pmap.h	Tue Feb 12 14:03:39 2019	(r344052)
+++ stable/11/sys/i386/include/pmap.h	Tue Feb 12 16:56:10 2019	(r344053)
@@ -241,7 +241,20 @@ extern pt_entry_t *KPTmap;
 #define	pte_load_store(ptep, pte)	atomic_swap_64_i586(ptep, pte)
 #define	pte_load_clear(ptep)		atomic_swap_64_i586(ptep, 0)
 #define	pte_store(ptep, pte)		atomic_store_rel_64_i586(ptep, pte)
-#define	pte_load(ptep)			atomic_load_acq_64_i586(ptep)
+static __inline uint64_t
+pte_load(pt_entry_t *p)
+{
+	uint64_t res;
+
+	__asm __volatile(
+	"	movl	%%ebx,%%eax ;	"
+	"	movl	%%ecx,%%edx ;	"
+	"	lock; cmpxchg8b %1"
+	: "=&A" (res),			/* 0 */
+	  "+m" (*p)			/* 1 */
+	: : "memory", "cc");
+	return (res);
+}
 
 extern pt_entry_t pg_nx;
 


More information about the svn-src-all mailing list