mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
[PowerPC] Don't overwrite vm.pmap sysctl node
After r367417, both mmu_oea64 and mmu_radix were defining the vm.pmap sysctl node, resulting in the later definition hiding the properties of the previous one. Avoid this issue by defining vm.pmap in a common source file and declaring it where needed. This change also standardizes the tunable name used to enable superpages and change its default to disabled on radix MMU, because it still has some issues with superpages. Reviewed by: bdragon, jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D27156
This commit is contained in:
parent
303869edc7
commit
5b58b1aaf8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367758
@ -319,12 +319,7 @@ static void moea64_remove_locked(pmap_t, vm_offset_t,
|
||||
/* MD page flag indicating that the page is a superpage. */
|
||||
#define MDPG_ATTR_SP 0x40000000
|
||||
|
||||
static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0,
|
||||
"VM/pmap parameters");
|
||||
|
||||
static int superpages_enabled = 0;
|
||||
SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled, CTLFLAG_RDTUN,
|
||||
&superpages_enabled, 0, "Enable support for transparent superpages");
|
||||
SYSCTL_DECL(_vm_pmap);
|
||||
|
||||
static SYSCTL_NODE(_vm_pmap, OID_AUTO, sp, CTLFLAG_RD, 0,
|
||||
"SP page mapping counters");
|
||||
@ -1968,7 +1963,11 @@ moea64_init()
|
||||
|
||||
/*
|
||||
* Are large page mappings enabled?
|
||||
*
|
||||
* While HPT superpages are not better tested, leave it disabled by
|
||||
* default.
|
||||
*/
|
||||
superpages_enabled = 0;
|
||||
TUNABLE_INT_FETCH("vm.pmap.superpages_enabled", &superpages_enabled);
|
||||
if (superpages_enabled) {
|
||||
KASSERT(MAXPAGESIZES > 1 && pagesizes[1] == 0,
|
||||
|
@ -385,11 +385,8 @@ SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, &nkpt, 0,
|
||||
|
||||
vm_paddr_t dmaplimit;
|
||||
|
||||
SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters");
|
||||
SYSCTL_DECL(_vm_pmap);
|
||||
|
||||
static int pg_ps_enabled = 1;
|
||||
SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
|
||||
&pg_ps_enabled, 0, "Are large page mappings enabled?");
|
||||
#ifdef INVARIANTS
|
||||
#define VERBOSE_PMAP 0
|
||||
#define VERBOSE_PROTECT 0
|
||||
@ -904,7 +901,7 @@ mmu_radix_kenter(vm_offset_t va, vm_paddr_t pa)
|
||||
bool
|
||||
mmu_radix_ps_enabled(pmap_t pmap)
|
||||
{
|
||||
return (pg_ps_enabled && (pmap->pm_flags & PMAP_PDE_SUPERPAGE) != 0);
|
||||
return (superpages_enabled && (pmap->pm_flags & PMAP_PDE_SUPERPAGE) != 0);
|
||||
}
|
||||
|
||||
static pt_entry_t *
|
||||
@ -3609,8 +3606,8 @@ mmu_radix_init()
|
||||
/*
|
||||
* Are large page mappings enabled?
|
||||
*/
|
||||
TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled);
|
||||
if (pg_ps_enabled) {
|
||||
TUNABLE_INT_FETCH("vm.pmap.superpages_enabled", &superpages_enabled);
|
||||
if (superpages_enabled) {
|
||||
KASSERT(MAXPAGESIZES > 1 && pagesizes[1] == 0,
|
||||
("pmap_init: can't assign to pagesizes[1]"));
|
||||
pagesizes[1] = L3_PAGE_SIZE;
|
||||
|
@ -336,6 +336,7 @@ extern vm_offset_t msgbuf_phys;
|
||||
|
||||
extern int pmap_bootstrapped;
|
||||
extern int radix_mmu;
|
||||
extern int superpages_enabled;
|
||||
|
||||
vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t size);
|
||||
void pmap_early_io_unmap(vm_offset_t va, vm_size_t size);
|
||||
|
@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/kerneldump.h>
|
||||
#include <sys/ktr.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
@ -80,6 +81,12 @@ int pmap_bootstrapped;
|
||||
/* Default level 0 reservations consist of 512 pages (2MB superpage). */
|
||||
int vm_level_0_order = 9;
|
||||
|
||||
SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters");
|
||||
|
||||
int superpages_enabled = 0;
|
||||
SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled, CTLFLAG_RDTUN,
|
||||
&superpages_enabled, 0, "Enable support for transparent superpages");
|
||||
|
||||
#ifdef AIM
|
||||
int
|
||||
pvo_vaddr_compare(struct pvo_entry *a, struct pvo_entry *b)
|
||||
|
Loading…
Reference in New Issue
Block a user