From owner-svn-src-all@freebsd.org Tue Jan 7 15:59:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0BF51EB979; Tue, 7 Jan 2020 15:59:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47scWm67lMz4H7P; Tue, 7 Jan 2020 15:59:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDEC01481; Tue, 7 Jan 2020 15:59:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 007FxW80049827; Tue, 7 Jan 2020 15:59:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 007FxWse049824; Tue, 7 Jan 2020 15:59:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001071559.007FxWse049824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Jan 2020 15:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356443 - in head/sys/i386: i386 include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/i386: i386 include X-SVN-Commit-Revision: 356443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 15:59:33 -0000 Author: markj Date: Tue Jan 7 15:59:31 2020 New Revision: 356443 URL: https://svnweb.freebsd.org/changeset/base/356443 Log: Define a unified pmap structure for i386. The overloading of struct pmap for PAE and non-PAE pmaps results in three distinct layouts for the structure, which is embedded in struct vmspace. This causes a large number of duplicate structure definitions in the i386 kernel's CTF type graph. Since most pmap fields are the same in the two pmaps, simply provide side-by-side variants of the fields that are distinct, using fixed-size types. PR: 242689 Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22896 Modified: head/sys/i386/i386/pmap.c head/sys/i386/i386/pmap_nopae.c head/sys/i386/i386/pmap_pae.c head/sys/i386/include/pmap.h Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Jan 7 15:59:02 2020 (r356442) +++ head/sys/i386/i386/pmap.c Tue Jan 7 15:59:31 2020 (r356443) @@ -216,9 +216,6 @@ __FBSDID("$FreeBSD$"); atomic_clear_int((u_int *)(pte), PG_W)) #define pmap_pte_set_prot(pte, v) ((*(int *)pte &= ~PG_PROT), (*(int *)pte |= (v))) -_Static_assert(sizeof(struct pmap) <= sizeof(struct pmap_KBI), - "pmap_KBI"); - static int pgeflag = 0; /* PG_G or-in */ static int pseflag = 0; /* PG_PS or-in */ Modified: head/sys/i386/i386/pmap_nopae.c ============================================================================== --- head/sys/i386/i386/pmap_nopae.c Tue Jan 7 15:59:02 2020 (r356442) +++ head/sys/i386/i386/pmap_nopae.c Tue Jan 7 15:59:31 2020 (r356443) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #define PMTYPE pmap_nopae_ +#define pm_pdir pm_pdir_nopae #include #include -_Static_assert(sizeof(struct pmap_KBI) >= sizeof(struct pmap), "pmap KBI"); #include "pmap.c" Modified: head/sys/i386/i386/pmap_pae.c ============================================================================== --- head/sys/i386/i386/pmap_pae.c Tue Jan 7 15:59:02 2020 (r356442) +++ head/sys/i386/i386/pmap_pae.c Tue Jan 7 15:59:31 2020 (r356443) @@ -43,7 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #define PMTYPE pmap_pae_ +#define pm_pdir pm_pdir_pae +#define pm_pdpt pm_pdpt_pae #include #include -_Static_assert(sizeof(struct pmap_KBI) >= sizeof(struct pmap), "pmap KBI"); #include "pmap.c" Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Tue Jan 7 15:59:02 2020 (r356442) +++ head/sys/i386/include/pmap.h Tue Jan 7 15:59:31 2020 (r356443) @@ -166,30 +166,18 @@ struct md_page { int pat_mode; }; -#define PMAP_EXTERN_FIELDS \ - cpuset_t pm_active; /* active on cpus */ \ - struct mtx pm_mtx; \ - struct pmap_statistics pm_stats; /* pmap statistics */ - -struct pmap_KBI { - PMAP_EXTERN_FIELDS - int32_t pm_fill[32]; -}; - -#ifdef PMTYPE struct pmap { - PMAP_EXTERN_FIELDS - pd_entry_t *pm_pdir; /* KVA of page directory */ + cpuset_t pm_active; /* active on cpus */ + struct mtx pm_mtx; + struct pmap_statistics pm_stats; /* pmap statistics */ + uint32_t *pm_pdir_nopae; /* KVA of page directory */ + uint64_t *pm_pdir_pae; TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ - pdpt_entry_t *pm_pdpt; /* KVA of page directory pointer - table */ + uint64_t *pm_pdpt_pae; struct vm_radix pm_root; /* spare page table pages */ - vm_page_t pm_ptdpg[NPGPTD]; + vm_page_t pm_ptdpg[4]; /* PAE NPGPTD */ }; -#else -#define pmap pmap_KBI -#endif typedef struct pmap *pmap_t;