Commit Graph

243854 Commits

Author SHA1 Message Date
maxv
09c0f3ded7 Remove pmap_prealloc_lowmem_ptps on amd64. This function creates levels in
the page tree so that the first 2MB of virtual memory can be kentered in
L1.

Strictly speaking, the kernel should never kenter a virtual page below
VM_MIN_KERNEL_ADDRESS, because then it wouldn't be available in userland.
It used to need the first 2MB in order to map the CPU trampoline and the
initial VAs used by the bootstrap code. Now, the CPU trampoline VA is
allocated with uvm_km_alloc and the VAs used by the bootstrap code are
allocated with pmap_bootstrap_valloc, and in either case the resulting VA
is above VM_MIN_KERNEL_ADDRESS.

The low levels in the page tree are therefore unused. By removing this
function, we are making sure no one will be tempted to map an area below
VM_MIN_KERNEL_ADDRESS in kernel mode, and particularly, we are making sure
NULL cannot be kentered.

In short, there is no way to map NULL in kernel mode anymore.
2016-07-22 14:08:33 +00:00
maxv
5afbe75687 Simplify pmap_alloc_level. It is designed to work only with normal_pdes and
PTP_LEVELS, so don't pass them as argument. While here, explain what we are
doing.
2016-07-22 13:01:43 +00:00
jakllsch
e30127d7a8 Space before tab and trailing whitespace fixes. 2016-07-22 12:55:34 +00:00
maxv
dd93e2d12a Unused. 2016-07-22 12:36:03 +00:00
knakahara
ef38d1c0f4 Reduce KERNEL_LOCK thereby ifq_lock is used by default.
if_snd is always excluded by ifq_lock now. So, the KERNEL_LOCK in if_transmit()
which serializes packet output processing is not needed now.
2016-07-22 07:13:56 +00:00
knakahara
b14a26cee3 Toward NET_MPSAFE-on in future, if_snd uses if_snd->ifq_lock by default.
That can reduce confusing difference between NET_MPSAFE on and off.
2016-07-22 07:09:40 +00:00
jakllsch
91be397f74 Add ATA8-ACS Long Logical Sector Feature Set support to wd(4). 2016-07-22 04:08:10 +00:00
christos
8eaf47c146 Don't include <mips/locore.h> in <machine/intr.h>, introduces circular
dependencies; instead include it in the 4 driver files that need it,
and reorder it in machdep.c
2016-07-21 19:49:58 +00:00
jakllsch
4821310465 Call wd_params_to_properties() after softc is sufficently
initialized.
2016-07-21 19:05:03 +00:00
jakllsch
580ae47a86 Remove unused 'params' argument of local function wd_params_to_properties() 2016-07-21 18:54:13 +00:00
christos
62df808c02 add NOPIE 2016-07-21 18:50:21 +00:00
christos
0d5ace558d replace variable stack declaration with a large enough one and KASSERT. 2016-07-21 18:21:27 +00:00
christos
90668226c4 Don't do variable stack allocations for systems with non-const PAGE_SIZE;
instead assume that the smallest pagesize is 1024.
2016-07-21 18:10:47 +00:00
christos
687ac45a6a remove .MIPS.abiflags to avoid objcopy creating a 0x20000000 large boot file. 2016-07-21 17:45:00 +00:00
christos
67c90d24d8 make this compile 2016-07-21 17:02:47 +00:00
christos
a1d395d60e make this compile. 2016-07-21 17:02:15 +00:00
christos
d78413be59 more stack protector 2016-07-21 16:47:50 +00:00
njoly
d1b4525986 According to Opengroup online specifications[1], _POSIX_CPUTIME and
_POSIX_THREAD_CPUTIME options should be present in unistd.h not
limits.h. Move them with other options.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html
2016-07-21 16:01:58 +00:00
shm
febbddea26 Fix error checks in open(2) calls. 2016-07-21 12:29:37 +00:00
christos
330a03324f Add -lz to makefile to fix the build. 2016-07-21 12:24:54 +00:00
skrll
d6309e9a65 Fix typo in comment 2016-07-21 12:17:07 +00:00
kiyohara
4547563530 Attach atphy instead of ukphy. 2016-07-21 09:10:55 +00:00
msaitoh
3ee664bbf4 Update processor families from the latest Intel SDM:
- 06_4FH: Add Xeon E7 v4 and Core i7-69xx Extreme Edition
- 06_57H: Xeon Phi [357]200
2016-07-21 08:37:18 +00:00
dholland
ebd6c2ad3e + PTO parent-teacher organization
(also PTA)
2016-07-21 05:07:04 +00:00
ozaki-r
60f4a9a871 Make complex RTM_CHANGE code understandable
Tests for route change added recently would reduce the possibility of
regressions.

Reviewed by ryo@
2016-07-21 03:45:56 +00:00
ozaki-r
3db8106383 Add some tests for route change 2016-07-21 02:02:30 +00:00
ozaki-r
852524ba75 Remove extra grep 2016-07-21 01:56:54 +00:00
ozaki-r
261b1cf92f Make the test name self-descriptive 2016-07-21 01:56:27 +00:00
christos
466a5d87d2 don't die printing a name we don't have 2016-07-21 00:10:57 +00:00
christos
eae41fc0ae put ctf lint library back. need to investigate more. 2016-07-20 23:36:23 +00:00
christos
434e55df7c PR/51353: Patrick Mackey: mld6query "-r" option is not recognised
XXX: pullup 7
2016-07-20 23:19:18 +00:00
macallan
6f0091eead use bus_space_map() instead of fudging our own bus_space_handle_t 2016-07-20 22:16:37 +00:00
christos
285a8995e1 unnamed unions need special treatment since they need braced initializers
for old style initializations.
2016-07-20 21:02:04 +00:00
shm
ef0b7ea3b6 CID 976523: add FALLTHROUGH 2016-07-20 20:18:21 +00:00
christos
353946982c cplusplus does not like complex named initializers... 2016-07-20 20:06:04 +00:00
christos
b826eda4de use named initializers 2016-07-20 19:26:52 +00:00
christos
c351e21641 accept attributes in param decls 2016-07-20 18:14:12 +00:00
macallan
d2759bb333 fix tpyo, now n32 kernels have a chance to work again 2016-07-20 17:57:00 +00:00
christos
29a071ed18 handle "extern __attribute__((__gnu_inline__)) __inline" 2016-07-20 17:42:14 +00:00
christos
986517611c add uvm_km_protect() 2016-07-20 17:03:50 +00:00
maxv
b3ef9106d5 This comment is wrong. In fact, we are in low physical memory, but in high
virtual memory, and only the latter matters. I'm not exactly sure why, but
it appears that the kernel modules must be placed above the kernel image.
Just make this comment more ambiguous, in case the next passer-by gets
inspired.
2016-07-20 13:49:17 +00:00
maxv
ece8cd54ab Split the data+bss+rodata segment in two data+bss and rodata segments. The
latter is made read-only.
2016-07-20 13:36:19 +00:00
maxv
d2c6c6c84f Change the protection of the kernel modules segments once we are done
relocating them. The text is allocated as RWX, and then mprotected to RW.

There is a bug that prevents us from doing RW->RX on amd64 and perhaps
sparc64. On x86, the pmap waits for the page to fault before granting it
the X permission. But in the trap handler, such a page is considered as
belonging to kernel_map, while it actually belongs to module_map. The
kernel then finds out the page is not present in kernel_map, and panics.
In all cases, module_map is non pageable, so even if the trap were handled
properly, it still wouldn't work.

Therefore, there is a small window in which the segment is RWX. But that's
fine enough, for now.
2016-07-20 13:11:58 +00:00
maxv
154c680895 Introduce uvm_km_protect. 2016-07-20 12:38:43 +00:00
maxv
b7e4d22b17 There is a huge bug in the way a uvm_map_protect is processed on x86.
When mprotecting a page, the kernel updates the uvm protection associated
with the page, and then gives control to the x86 pmap which splits the
procedure in two: if we are restricting the permissions it updates the page
tree right away, and if we are increasing the permissions it just waits for
the page to fault.

In the first case, it forgets to take care of the X permission. Which means
that if we allocate an executable page, it is impossible to remove the X
permission on it, this being true regardless of whether the mprotect call
comes from the kernel or from userland. It is not possible to make sure the
page is non executable either, since the only holder of the permission
information is uvm, and no track is kept at the pmap level of the actual
permissions enforced. In short, the kernel believes the page is non
executable, while the cpu knows it is.

Fix this by properly taking care of the !VM_PROT_EXECUTE case. Since the
bit manipulation is a little tricky we use two vars: bit_rem (remove) and
bit_put.
2016-07-20 12:33:59 +00:00
christos
1ffae14399 mark tag_signal as noreturn. 2016-07-20 12:04:18 +00:00
ozaki-r
1f39eeaeb9 Get rid of extra ifafree
It was wrongly imported from FreeBSD.
2016-07-20 07:56:10 +00:00
ozaki-r
4f21a42704 Apply pserialize to some iterations of IP address lists 2016-07-20 07:37:51 +00:00
ozaki-r
eef1e5e6e7 Reduce scopes of variables 2016-07-20 03:38:09 +00:00
ozaki-r
133f516a49 Get rid of unnecessary satosin 2016-07-20 03:36:51 +00:00