From owner-svn-src-head@freebsd.org Tue Feb 5 20:09:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE79314CF39A; Tue, 5 Feb 2019 20:09:32 +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 7EABD8F67A; Tue, 5 Feb 2019 20:09:32 +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 6C42322C6A; Tue, 5 Feb 2019 20:09:32 +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 x15K9Wga011077; Tue, 5 Feb 2019 20:09:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x15K9W5f011076; Tue, 5 Feb 2019 20:09:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902052009.x15K9W5f011076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 Feb 2019 20:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343809 - 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: 343809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EABD8F67A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2019 20:09:33 -0000 Author: kib Date: Tue Feb 5 20:09:31 2019 New Revision: 343809 URL: https://svnweb.freebsd.org/changeset/base/343809 Log: Make it possible to override PAE mode on boot. Initialize the static kenv in pmap_cold() and fetch user opinion on vm.pmap.pae_mode tunable if hardware is capable. Note that the static environment is reinitilized in init386() later when paging is enabled. Reviewed by: bde Discussed with: kevans Sponsored by: The FreeBSD Foundation MFC after: 2 months Modified: head/sys/i386/i386/pmap_base.c Modified: head/sys/i386/i386/pmap_base.c ============================================================================== --- head/sys/i386/i386/pmap_base.c Tue Feb 5 20:02:16 2019 (r343808) +++ head/sys/i386/i386/pmap_base.c Tue Feb 5 20:09:31 2019 (r343809) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -935,16 +936,19 @@ pmap_kremove(vm_offset_t va) extern struct pmap_methods pmap_pae_methods, pmap_nopae_methods; int pae_mode; -SYSCTL_INT(_vm_pmap, OID_AUTO, pae_mode, CTLFLAG_RD, - &pae_mode, 1, +SYSCTL_INT(_vm_pmap, OID_AUTO, pae_mode, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &pae_mode, 0, "PAE"); void pmap_cold(void) { - if ((cpu_feature & CPUID_PAE) != 0) { - pae_mode = 1; + init_static_kenv((char *)bootinfo.bi_envp, 0); + pae_mode = (cpu_feature & CPUID_PAE) != 0; + if (pae_mode) + TUNABLE_INT_FETCH("vm.pmap.pae_mode", &pae_mode); + if (pae_mode) { pmap_methods_ptr = &pmap_pae_methods; pmap_pae_cold(); } else {