Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_mmap.c
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | |||||
#ifdef HWPMC_HOOKS | #ifdef HWPMC_HOOKS | ||||
#include <sys/pmckern.h> | #include <sys/pmckern.h> | ||||
#endif | #endif | ||||
int old_mlock = 0; | int old_mlock = 0; | ||||
SYSCTL_INT(_vm, OID_AUTO, old_mlock, CTLFLAG_RWTUN, &old_mlock, 0, | SYSCTL_INT(_vm, OID_AUTO, old_mlock, CTLFLAG_RWTUN, &old_mlock, 0, | ||||
"Do not apply RLIMIT_MEMLOCK on mlockall"); | "Do not apply RLIMIT_MEMLOCK on mlockall"); | ||||
static int mincore_mapped = 1; | |||||
SYSCTL_INT(_vm, OID_AUTO, mincore_mapped, CTLFLAG_RWTUN, &mincore_mapped, 0, | |||||
"mincore reports mappings, not residency"); | |||||
lattera-gmail.com: Given that there is a security context for this change, would it make sense to make use of… | |||||
#ifdef MAP_32BIT | #ifdef MAP_32BIT | ||||
#define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) | #define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) | ||||
#endif | #endif | ||||
#ifndef _SYS_SYSPROTO_H_ | #ifndef _SYS_SYSPROTO_H_ | ||||
struct sbrk_args { | struct sbrk_args { | ||||
int incr; | int incr; | ||||
▲ Show 20 Lines • Show All 695 Lines • ▼ Show 20 Lines | while (addr < cend) { | ||||
* it can provide info as to whether we are the | * it can provide info as to whether we are the | ||||
* one referencing or modifying the page. | * one referencing or modifying the page. | ||||
*/ | */ | ||||
object = NULL; | object = NULL; | ||||
locked_pa = 0; | locked_pa = 0; | ||||
retry: | retry: | ||||
m = NULL; | m = NULL; | ||||
mincoreinfo = pmap_mincore(pmap, addr, &locked_pa); | mincoreinfo = pmap_mincore(pmap, addr, &locked_pa); | ||||
if (mincore_mapped) { | |||||
/* | |||||
* We only care about this pmap's | |||||
* mapping of the page, if any. | |||||
*/ | |||||
if (locked_pa != 0) { | if (locked_pa != 0) { | ||||
vm_page_unlock(PHYS_TO_VM_PAGE( | |||||
locked_pa)); | |||||
} | |||||
} else if (locked_pa != 0) { | |||||
Not Done Inline ActionsMaybe something like: /* * We only care about this pmap's mapping of the page, if any. */ to match the other comments? markj: Maybe something like:
```
/*
* We only care about this pmap's mapping of the page, if any. | |||||
/* | /* | ||||
* The page is mapped by this process but not | * The page is mapped by this process but not | ||||
* both accessed and modified. It is also | * both accessed and modified. It is also | ||||
* managed. Acquire the object lock so that | * managed. Acquire the object lock so that | ||||
* other mappings might be examined. | * other mappings might be examined. | ||||
*/ | */ | ||||
m = PHYS_TO_VM_PAGE(locked_pa); | m = PHYS_TO_VM_PAGE(locked_pa); | ||||
if (m->object != object) { | if (m->object != object) { | ||||
▲ Show 20 Lines • Show All 758 Lines • Show Last 20 Lines |
Given that there is a security context for this change, would it make sense to make use of CTLFLAG_SECURE for this sysctl node?