274992 Commits

Author SHA1 Message Date
ad
5972ba1600 Make page waits (WANTED vs BUSY) interlocked by pg->interlock. Gets RW
locks out of the equation for sleep/wakeup, and allows observing+waiting
for busy pages when holding only a read lock.  Proposed on tech-kern.
2020-03-14 20:23:51 +00:00
ad
4f50476a10 rump - page/object dirtyness tracking corrections. 2020-03-14 19:54:06 +00:00
nia
dd302e79dd synaptics: Set up_down_emulation=3 by default.
It's a less surprising default for modern hardware.
2020-03-14 19:29:39 +00:00
ad
6ba8fa570a Unused variable. 2020-03-14 19:07:22 +00:00
ad
0faf5aacb0 PR kern/55071 (Panic shortly after running X11 due to kernel diagnostic assertion "mutex_owned(&pp->pp_lock)")
- Fix a locking bug in pmap_pp_clear_attrs() and in pmap_pp_remove() do the
  TLB shootdown while still holding the target pmap's lock.

Also:

- Finish PV list locking for x86 & update comments around same.

- Keep track of the min/max index of PTEs inserted into each PTP, and use
  that to clip ranges of VAs passed to pmap_remove_ptes().

- Based on the above, implement a pmap_remove_all() for x86 that clears out
  the pmap in a single pass.  Makes exit() / fork() much cheaper.
2020-03-14 18:24:10 +00:00
ad
16d4fad635 - Hide the details of SPCF_SHOULDYIELD and related behind a couple of small
functions: preempt_point() and preempt_needed().

- preempt(): if the LWP has exceeded its timeslice in kernel, strip it of
  any priority boost gained earlier from blocking.
2020-03-14 18:08:38 +00:00
ad
bc9936a48c uvm_map_lookup_entry(): save the hint even on failure, since code elsewhere
relies on it pointing to the previous entry.
2020-03-14 17:29:53 +00:00
ad
7683ad7912 Remove unused RW lock defs. 2020-03-14 16:55:17 +00:00
is
19c1568616 provide both miniroot.fs (for people wanting to install NetBSD without
more 3rdparty software than what's provided on our ISO) and .fs.tz (for
people downloading over slow links).
2020-03-14 16:27:19 +00:00
skrll
35563434c4 Trailing whitespace 2020-03-14 16:12:15 +00:00
ad
01f564d8c8 OR into bp->b_cflags; don't overwrite. 2020-03-14 15:31:29 +00:00
ad
3b6112efc8 - uvmspace_exec(), uvmspace_free(): if pmap_remove_all() returns true the
pmap is emptied.  Pass UVM_FLAG_VAONLY when clearing out the map and avoid
  needless extra work to tear down each mapping individually.

- uvm_map_lookup_entry(): remove the code to do a linear scan of map entries
  for small maps, in preference to using the RB tree.  It's questionable,
  and I think the code is almost never triggered because the average number
  of map entries has probably exceeded the hard-coded threshold for quite
  some time.

- vm_map_entry: get it aligned on a cacheline boundary, and cluster fields
  used during rbtree lookup at the beginning.
2020-03-14 14:15:43 +00:00
ad
be9c6147a4 pmap_remove_all(): Return a boolean value to indicate the behaviour. If
true, all mappings have been removed, the pmap is totally cleared out, and
UVM can then avoid doing the work to call pmap_remove() for each map entry.
If false, either nothing has been done, or some helpful arch-specific voodoo
has taken place.
2020-03-14 14:05:42 +00:00
ad
231cabb56a uvm_pdpolicy: Require a write lock on the object only for dequeue.
No sense in requiring that for enqueue/activate/deactivate.
2020-03-14 13:53:26 +00:00
ad
d6f0325227 Put ACPI idle under ACPICPU_ENABLE_C3 until the wrinkles are ironed out.
This seems well written and basically all good, but currently doesn't enter
a low power state, and imposes a big performance penalty.  Proposed on
port-i386 & port-amd64.
2020-03-14 13:50:46 +00:00
ad
d39cb654b8 tmpfs_inactive(): do like other file systems and truncate the file if it
has been deleted.  Otherwise VFS will try to write cached data "back to
disc", which in the case of a UAO means needless page deactivations and
the resulting TLB shootdowns.
2020-03-14 13:39:36 +00:00
ad
f1944288ff tmpfs_reg_resize(): do nothing if newsize == oldsize. 2020-03-14 13:37:49 +00:00
ad
0b594cfd32 sparc cpu_intr_p(): try to work around l_cpu not being set early on by
using curcpu().
2020-03-14 13:34:43 +00:00
nia
6fe7b60978 synaptics: Make up_down_emulation useful for single-button clickpads
On devices such as the Thinkpad X250, the clickpad can be pressed
to generate mouse button events 1 and 2. There are also additional
physical buttons which the pms(4) driver recognizes as "up/down" buttons
(mouse buttons 3 and 4). Allow these to be remapped to buttons 1 and 2
and used like normal touchpad buttons with the following sysctl:

# sysctl -w hw.synaptics.up_down_emulation=3

While here, adjust the existing "middle button emulation"
(hw.synaptics.up_down_emulation=1) so it works with single-button
clickpads.

XXX: 3 may be a more useful default than the current default,
depending on hardware availability of touchpads with "up/down buttons".

Update the documentation accordingly.
2020-03-14 13:08:18 +00:00
jdolecek
8c5f0b78a9 make the packet length check less strict, allow the physical packet longer
than IP payload

this fixes problem where checksum was not recomputed for short
packets coming from Windows DOMU on same physical host, seems Windows
does some padding; reported by sborrill@

XXX pullup-9
2020-03-14 11:52:12 +00:00
wiz
1ae1945310 Sort sections. Fix date. 2020-03-14 09:01:11 +00:00
mrg
b933b1f158 add an example of using midirecord(1) to learn about how device
specific MIDI messages are formed, allowing their use from MIDI
input files, not just the device controls.

using this method, i can now control the voice mode type on my
new synth.
2020-03-14 08:09:55 +00:00
skrll
73cad4db9c hopefully fix builds 2020-03-14 06:39:20 +00:00
maxv
4e27c3180c On amd64, mark the whole tree as NX. No real functional change, just to
prevent possible future surprises, and to make it a little harder to map
executable pages in ROP chains.
2020-03-14 05:19:50 +00:00
maxv
12fcc7d589 style 2020-03-14 04:55:14 +00:00
maxv
02e2c6443c fix memory leaks 2020-03-14 04:49:33 +00:00
maxv
1d76b5b8cf wrong size passed to copyout 2020-03-14 04:39:15 +00:00
christos
13fbb093a4 fix more broken kernhist formats (now I got them all). 2020-03-14 03:01:36 +00:00
christos
aa3d6ec155 revert the 0x% -> %# change for fixed width formats pointed out by uwe. 2020-03-14 02:35:33 +00:00
christos
9fcd6132aa more changes from sc.dying in PR/55068 2020-03-14 02:22:16 +00:00
rillig
cf957f51cb t_glob.c: clean up test code
In struct vfs_file, using an int as a boolean is an anachronism and has
been replaced with a single-character file type, like in ls(1).

Some other redundant test code has been removed as well since it was
either unreachable or existed only for performance reasons.
2020-03-13 23:27:54 +00:00
rillig
afe826aa59 t_glob.c: add test cases for hidden directory and file
The existing test code was geared towards every little bit of
performance. It even duplicated the file definitions in vfs_stat in order
to avoid a few strcmp calls. This made the test code fragile. Therefore,
vfs_stat has been rewritten completely to not duplicate any information
from the vfs.

In vfs_stat, the returned st_mode is now more realistic. It had been 0
before. The file mode is only logged when it makes sense. In the ENOENT
case it is not logged anymore.

The debug logging for opendir/closedir now logs the same pointer, so that
the corresponding calls can be matched easily. Failed vfs_opendir calls
are logged as well, to get a more complete picture of which callbacks are
called.
2020-03-13 22:58:31 +00:00
rillig
518b6dae2f t_glob.c: use distinct names for test structures
Before, the structures and functions defined by the test used the same
prefix as the code to be tested. This made it difficult to draw a line
between these parts.
2020-03-13 21:44:25 +00:00
rillig
7bf961318e t_glob.c: move expected globbing result directly into the test cases
This makes the tests more self-contained. The example directory tree that
is common to all the tests is still defined elsewhere, but in the same
file. Setting up the example directory structure in each test would make
the tests even more independent and read.
2020-03-13 20:48:33 +00:00
martin
4c92faedaf Fix printf format 2020-03-13 19:17:27 +00:00
msaitoh
79d9ef08e7 Fix a bug that atphy(4) doesn't work with Attansic L2 rev. 1.
Reported by Rocky Hotas.

- On ASUS M2N-MX SE Plus (NVIDIA MCP61 with Attansic L2 rev. 1), changing
  debug port 0x29's value makes the next PHY read fail with error.  Read any
  register to ignore this problem if the PHY is Attansic L2 revision 1.
  I don't know if this problem is from L2 rev. 1 itself or from the
  combination because I have only one machine which has L2 rev. "1".
  At least, ASUS eee pc 900 (Attansic L2 rev. "2") has no this problem.
- Add comment. AR8021 document has no description about the power saving
  control register(debug port 0x29).
- Add comment. AR8031 document says the lower 14 bits are reserved and the
  default value is 0x36d0. Shouldn't we clear those bits?
- I have no document neither L1(F1) nor L2(F2), so I don't know whether the
  debug port access is correct or not.

Tested with the following machines:
- ASUS P5B SE,         L1 rev. 5,            age(4)
- ASUS K50IJ,          L1 rev. 9,            ale(4)
- ASUS eee pc 900,     L2 rev. 2,            lii(4)
- ASUS M2N-MX SE Plus, L2 rev. 1,            nfe(4)
- Intel DP55WB,        82578(AR8021 rev. 2), wm(4)
- Dell inspiron 14z,   AR0835 rev. 9,        alc(4)
2020-03-13 18:57:49 +00:00
christos
d3dde16c1a PR/55068: sc.dying: Fix printf formats:
- no %s/%p for kernel log
- 0x% -> %#
- always %j for kernel log
2020-03-13 18:17:40 +00:00
christos
94703ef0ad Re-enable the routing perm check now that the kernel has been fixed to return
valid information.
2020-03-13 16:38:45 +00:00
christos
8aaa9ad4fd Use the socket credentials that are established during the socket creation
instead of the current process credentials (which can change via
set{e,}{u,g}id(2)) and by passing the fd to a different process. This makes
the routing socket behave like other file descriptors. Proposed in tech-kern.
2020-03-13 16:37:12 +00:00
skrll
1031e0e133 Enhance the DIAGNOSTICs around pmap_grow_map 2020-03-13 16:25:19 +00:00
skrll
8789293567 Re-indent a function call. NFCI. 2020-03-13 16:16:29 +00:00
skrll
4adc09176c Oops... remove a stray <space> 2020-03-13 16:14:18 +00:00
skrll
5a3b242ac9 Fixup some comments 2020-03-13 16:12:06 +00:00
roy
733ddd3272 Note terminfo change 2020-03-13 15:21:32 +00:00
roy
aadfdb111b terminfo: promote numeric parameters from short to int
POSIX mandates implementations must support upto a short but may exceed it.
When NetBSD terminfo was implemented, no terminfo description used over
a short, but because ncurses has supported ints for some time, some now do.

Infact, such a terminfo description was imported where colour pairs for
screen-256color went up to 65536 which exposed a bug in the existing
implementation where it set to zero. Because the number might mean
something more than a range, we need to be able to store it accurately.

This requires a version bump because whilst the API hasn't changed thanks
to C int promotion, the ABI has. Also the underlying database structure
has changed as well - we now store the numeric paramter inside a uint32_t
field rather than a uint16_t one.
Whilst this change can still read the old style database, the old one
cannot read the new one and thus we now maintain the database as
terminfo2.cdb, leaving the old library and database alone so old programs
still work fine.

libcurses, libfrom, libmenu and libpanel have also been bumped to
accomoate this change.
2020-03-13 15:19:24 +00:00
is
ca70afd1bf Provide the (small) miniroot uncompressed, so that it can be used from
an AmigaOS without additional software to install NetBSD.
Closes PR port-amiga/45443
2020-03-13 10:01:07 +00:00
nisimura
d1ec24aa2f regen. 2020-03-13 07:43:14 +00:00
nisimura
e867896763 add ASMedia Technology 2020-03-13 07:42:26 +00:00
knakahara
ddd7ead0f8 Fix kern/55066. Pointed out and fixed by Chuck Zmudzinski, thanks.
ok'ed by ozaki-r@n.o
2020-03-13 06:55:35 +00:00
yamaguchi
075ba4b6a0 Use I40E_PFINT_ITRN registers to enable ITR for MSI-X interrupts 2020-03-13 05:49:52 +00:00