From owner-svn-src-all@freebsd.org Sun Sep 22 19:59:10 2019 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 E8A4612AD22; Sun, 22 Sep 2019 19:59:10 +0000 (UTC) (envelope-from kib@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 46byvf5gWWz49V0; Sun, 22 Sep 2019 19:59:10 +0000 (UTC) (envelope-from kib@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 A1A7039F7; Sun, 22 Sep 2019 19:59:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8MJxAQ8066900; Sun, 22 Sep 2019 19:59:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MJxAEn066899; Sun, 22 Sep 2019 19:59:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909221959.x8MJxAEn066899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 Sep 2019 19:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352609 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 352609 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: Sun, 22 Sep 2019 19:59:11 -0000 Author: kib Date: Sun Sep 22 19:59:10 2019 New Revision: 352609 URL: https://svnweb.freebsd.org/changeset/base/352609 Log: i386: reduce differences in source between PAE and non-PAE pmaps ... by defining pg_nx as zero for non-PAE and correspondingly simplifying some expressions. Suggested and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21757 Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Sep 22 19:53:29 2019 (r352608) +++ head/sys/i386/i386/pmap.c Sun Sep 22 19:59:10 2019 (r352609) @@ -227,6 +227,8 @@ static int nkpt = NKPT; #ifdef PMAP_PAE_COMP pt_entry_t pg_nx; static uma_zone_t pdptzone; +#else +#define pg_nx 0 #endif _Static_assert(VM_MAXUSER_ADDRESS == VADDR(TRPTDI, 0), "VM_MAXUSER_ADDRESS"); @@ -1871,11 +1873,7 @@ __CONCAT(PMTYPE, qenter)(vm_offset_t sva, vm_page_t *m m->md.pat_mode, 0); if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { oldpte |= *pte; -#ifdef PMAP_PAE_COMP pte_store(pte, pa | pg_nx | PG_RW | PG_V); -#else - pte_store(pte, pa | PG_RW | PG_V); -#endif } pte++; } @@ -6168,11 +6166,7 @@ sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_ sbuf_printf(sb, "0x%08x-0x%08x r%c%c%c%c %s %d %d %d\n", range->sva, eva, (range->attrs & PG_RW) != 0 ? 'w' : '-', -#ifdef PMAP_PAE_COMP (range->attrs & pg_nx) != 0 ? '-' : 'x', -#else - '-', -#endif (range->attrs & PG_U) != 0 ? 'u' : 's', (range->attrs & PG_G) != 0 ? 'g' : '-', mode, range->pdpes, range->pdes, range->ptes); @@ -6191,10 +6185,7 @@ sysctl_kmaps_match(struct pmap_kernel_map_range *range { pt_entry_t diff, mask; - mask = PG_G | PG_RW | PG_U | PG_PDE_CACHE; -#ifdef PMAP_PAE_COMP - mask |= pg_nx; -#endif + mask = pg_nx | PG_G | PG_RW | PG_U | PG_PDE_CACHE; diff = (range->attrs ^ attrs) & mask; if (diff == 0) return (true); @@ -6224,21 +6215,15 @@ static void sysctl_kmaps_check(struct sbuf *sb, struct pmap_kernel_map_range *range, vm_offset_t va, pd_entry_t pde, pt_entry_t pte) { - pt_entry_t attrs, mask; + pt_entry_t attrs; - attrs = pde & (PG_RW | PG_U); -#ifdef PMAP_PAE_COMP - attrs |= pde & pg_nx; -#endif + attrs = pde & (PG_RW | PG_U | pg_nx); if ((pde & PG_PS) != 0) { attrs |= pde & (PG_G | PG_PDE_CACHE); } else if (pte != 0) { - mask = pte & (PG_RW | PG_U); -#ifdef PMAP_PAE_COMP - mask |= pg_nx; -#endif - attrs &= mask; + attrs |= pte & pg_nx; + attrs &= pg_nx | (pte & (PG_RW | PG_U)); attrs |= pte & (PG_G | PG_PTE_CACHE); /* Canonicalize by always using the PDE PAT bit. */