Commit Graph

63674 Commits

Author SHA1 Message Date
msaitoh
a6c7aa60cf Supress verbose message "This pci host supports neither MSI nor MSI-X."
on VMware and KVM. OK'd by k-nakahara.
2017-02-09 03:38:01 +00:00
rin
b765dc9992 Shrink the ramdisk of INSTALL kernel for zaurus in order to fit within 5MB.
Now free spaces of the main kernel and ramdisk are about 62KB and 215KB for
INSTALL, respectively.

OK christos
2017-02-08 20:11:18 +00:00
kre
0dcb58b5ac Analagous fix to that just committed to the equiv amd64 sources.
Note: this one has yet to be compile tested, so anything is possible...
2017-02-08 18:53:01 +00:00
kre
4f1bfb58c6 All bow down before the Great Code Compiler.
Specifically, it has been commanded that unused-functions is a warning,
and, as all should know, all warnings be errors.

Hence, since XEN kernels do not call set_sys_gdt(), that function
may not be included (and the XEN kernel  saves a few tens of bytes.)

An alternate fix would be to just remove "static" - but that would be
the equivalent to just giving the compiler the finger ...   hmm, maybe
that would have been a better fix...
2017-02-08 18:50:51 +00:00
christos
d9093907a5 __empty -> __nothing 2017-02-08 18:01:12 +00:00
christos
e3abb3c383 don't define __empty. 2017-02-08 16:14:08 +00:00
maxv
6d5f205475 Remove gdt_reload_cpu. GDTR takes a VA as base, and in our x86
implementation this VA is per-cpu and does not change; there is therefore
no need to remotely reload GDTR.
2017-02-08 10:08:26 +00:00
maxv
e6ed7762a4 Localify, add a comment and merge some others. 2017-02-08 09:39:32 +00:00
maxv
44542be787 In cpu_mcontext32_validate, allow the registers to have different locations
if the LDT is user-set.

I am intentionally not allowing this in check_sigcontext32, because I don't
think Wine uses it.
2017-02-06 16:34:37 +00:00
maxv
54f03c77cf Add the USER_LDT sysarch options in netbsd32. We don't translate 'desc',
since if we ever implement USER_LDT we will only allow 8-byte-sized
entries, which have the same layout on amd64 and i386.
2017-02-06 16:02:17 +00:00
nonaka
3595ccfb7d Remove unnecessary flag. 2017-02-06 10:32:35 +00:00
palle
9634b3fd38 sun4v: update TODO list to reflect the current state - TRAP_SETUP() was adapted to handle both sun4u and sun4v systems in version 1.404 of locore.s 2017-02-05 20:08:35 +00:00
maxv
6c9d31ed8a Rename ldt->ldtstore and gdt->gdtstore on i386. It reduces the diff with
amd64, and makes it easier to track down these variables on nxr - 'ldt'
and 'gdt' being common keywords.
2017-02-05 10:42:21 +00:00
joerg
3a551b58b2 Be a bit nicer to outdated compilers and use __unreachable(). 2017-02-05 10:13:43 +00:00
joerg
1ca42661a2 Unbreak clang again. 2017-02-05 10:13:18 +00:00
maxv
173e2026e3 Remove misleading comment; these macros should not be used if a user LDT
is active.
2017-02-05 08:58:39 +00:00
maxv
549eebb1a2 Remove #if 0 on USER_LDT. 2017-02-05 08:52:11 +00:00
maxv
c4d9b79654 Now that valid_user_selector only checks for LDT selectors, remove it. A
user may legitimately want to have one register in the GDT, and another in
the LDT.

Pass 2/2.
2017-02-05 08:36:08 +00:00
maxv
33f2d3769e In cpu_mcontext_validate, treat %cs differently depending on whether a user
LDT is set; just check the permission without checking the location (which
may change).

In valid_user_selector, don't check the length of the LDT. This is racy
because pm_ldt_len could be updated by another thread, and useless since
the length is already referenced in ldtr (ldt_alloc), which means that any
overflow will fault in userland.

Also, don't check the permission of the segment pointed to; this too is
racy, and we don't care either since the permissions are checked earlier
in x86_set_ldt1.

Pass 1/2.
2017-02-05 08:19:05 +00:00
maya
dfbac43682 Remove duplicate check. uvm_physseg_valid_p(upm) == false is also
our for loop exit condition, and will never happen. NFC
2017-02-05 06:26:06 +00:00
maya
482c927acf Fix off by one.
Fixes PR port-amd64/51944: sparse core dumps do not work
2017-02-05 06:13:53 +00:00
maya
2675f23497 Match the iterator in sys/uvm/uvm_page.c:1866. NFC.
No matching KASSERT - this case is covered by the above
if (uvm_physseg_valid_p(upm) == false) break;
2017-02-05 06:12:33 +00:00
christos
f06f692133 Fix operand width 2017-02-04 16:14:27 +00:00
christos
9afef664aa Don't error out for set but unused variables for now. 2017-02-04 16:14:04 +00:00
roy
84cacd2b7f Mark reboot() and _rtt() as __dead.
Use __builtin_unreachable() to ensure Panic really is marked dead.

Thanks to joerg@
2017-02-04 13:36:07 +00:00
roy
03db8b97a4 Fix build with clang. 2017-02-03 17:24:43 +00:00
roy
49a353f899 rows is a uint ... it will always be greater than or equal to 0. 2017-02-03 16:42:26 +00:00
uwe
11495586f9 Pass kernend as the start parameter to uvm_page_physload(). This
fixes pmap_steal_memory() as it can now unplug from the start of the
segment.  This might be the right thing to do too as the pages before
kernend are accessed via directly mapped P1, but i need to ask someone
with a clue.  This is also what evbsh3 always did.

Anyway, this at least unbreaks landisk after uvm hotplug fallout.
2017-02-02 21:57:03 +00:00
rin
9e3d987a53 PR port-mac68k/51923
Bump default MAXTSIZ to 32MB for m68k ports, which allos us to use GCC 5.4 on
GENERIC kernels.
Ok jklos
2017-02-02 21:53:54 +00:00
rin
6eadace49f PR port-mac68k/51923
Remove unused SYSPTSIZE and USRPTSIZE from m68k ports.
Ok jklos
2017-02-02 21:50:22 +00:00
uwe
06bb7d7f96 pmap_steal_memory - a few more s/start/avail_start/ fixes for the
hotplug conversion.
2017-02-02 21:35:29 +00:00
uwe
4777ae6bba pmap_steal_memory - s/start/avail_start/ to fix mistake in the hotplug
conversion.  The kernel now panics (can't unplug memory from the
middle of a segment) instead of triggering a reset.
2017-02-02 21:17:40 +00:00
uwe
b9239b76ad It's completely bogus to pass physmem (i.e. the memory size) as the
"start" parameter to uvm_page_physload().  I guess it never exploded
only because it's the correct "avail_start" that is used.
2017-02-02 21:11:25 +00:00
maxv
7faa8beef7 Fix these comments, we probably won't want to keep them up to date. 2017-02-02 19:12:09 +00:00
maxv
2b26583164 Increase KERNTEXTOFF from 1MB to 2MB on amd64. [1MB; 2MB[ is now handled
by UVM, so there is no physical loss.

On amd64 we always remap the kernel text with 2MB pages, and because of the
1MB start address we were forced to map [0MB; 2MB[ inside the first large
page. The problem is, the lower half is used by UVM to allocate physical
pages, and it is possible that some of these could be used by userland. We
could end up with userland-controllable data mapped into the kernel text on
a privileged page, which is far from being a good idea from a security pov.

I am not fixing i386 yet, because the large page size depends on PAE, and
we probably don't want to have a text located at 4MB on low-memory systems.

(note: I didn't introduce this issue, it was already there when I came in)
2017-02-02 19:09:08 +00:00
maxv
7fbd00cfca The first va should depend on the text offset, not the kernel base. Use
rounddown. Note: this value is still wrong, it should be roundup. But
that's another issue that will be fixed in amd64 soon.
2017-02-02 17:37:49 +00:00
maxv
a4a4753729 Use __read_mostly on these variables, to reduce the probability of false
sharing.
2017-02-02 08:57:04 +00:00
martin
68068a92f5 PR port-sparc64/51925: cosmetic cleanup, no functional change 2017-02-02 08:12:08 +00:00
msaitoh
e3593d2a92 Modify comment. Use long form. 2017-02-02 05:43:48 +00:00
christos
c64104c2e3 PR/51935: David Binderman: bad call to printf
- fix debugging printfs in general.
- KNF
2017-02-01 18:24:22 +00:00
christos
3db65f612e PR/51933: David Binderman: Boolean confusion 2017-02-01 14:33:10 +00:00
maxv
0cca9a37f8 Update the URLs, and add the DC_refills_ flags (from the spec, not present
on my cpu).
2017-01-31 17:38:54 +00:00
martin
de6c3bc475 PR port-sparc64/51925: remove EM_SPARC32PLUS from the 64 bit ELF machine
ids we accept for our executables - that combination makes no sense
at all (probably copy&pasto).
2017-01-31 16:13:56 +00:00
palle
4504cefad5 sun4v: Hook up syscall handling to the trap table. Verified using qemu for both sun4u and sun4v. 2017-01-30 21:24:33 +00:00
nonaka
fb19fa4c9d reduce install kernel size. 2017-01-30 02:41:12 +00:00
jakllsch
0599f5991d Drop inadvertent redundant CPU_CONTROL_MMU_ENABLE ((1 < 22)) for PJ4Bv7.
This was intended to be CPU_CONTROL_UNAL_ENABLE, which is already handled.

Should fix PR kern/51921.
2017-01-28 13:21:11 +00:00
palle
5dcf0bb125 sun4v: implement missing handling of itsb traps 0x008 and 0x009. Based on code from OpenBSD. Tested using qemu. 2017-01-27 21:35:38 +00:00
christos
ee8d32bb92 remove __HAVE_COMPAT_NETBSD32 2017-01-27 17:21:51 +00:00
christos
e4cf317682 provide __HAVE_COMPAT_NETBSD32 and fix multiple include protection consistently. 2017-01-26 15:55:08 +00:00
nonaka
78d84e817e Fix compile failure on i386 with DEBUG_MEMLOAD. 2017-01-26 01:36:35 +00:00