Commit Graph

246809 Commits

Author SHA1 Message Date
christos
b707f068cf back to passing device_t 2016-12-13 20:18:06 +00:00
roy
87cdadbd3f ping is not a reliable means of testing if connectivity to download sets
actually works, so remove it.
Hopefully fixes PR kern/51531.
2016-12-13 19:03:49 +00:00
kamil
b8092d5dfa Add regs1 in arch/i386/t_ptrace_wait*
regs1:
    Call PT_GETREGS and iterate over General Purpose registers

Sponsored by <The NetBSD Foundation>
2016-12-13 18:00:10 +00:00
christos
9dcd653786 Add rescan for audio children. 2016-12-13 17:12:51 +00:00
kamil
9feae32a7c Remove dbregs* in arch/amd64/t_ptrace_wait*
CPU Debug Registers won't be exposed as is to userland.

Hardware Watchpoints will be exported to userland dedicated interface
through the ptrace(2) interface.

Sponsored by <The NetBSD Foundation>
2016-12-13 13:09:00 +00:00
kamil
5f84086eb7 Add regs1 in arch/amd64/t_ptrace_wait*
regs1:
    Call PT_GETREGS and iterate over General Purpose registers

Sponsored by <The NetBSD Foundation>
2016-12-13 13:04:18 +00:00
kamil
f9bea37eb4 Define in CPPFLAGS symbol _KERNTYPES in order to get PRIxREGISTER
This type will be used in t_ptrace_wait* for the printf(3) function.

Sponsored by <The NetBSD Foundation>
2016-12-13 12:59:46 +00:00
kamil
2826f37556 Remove dbregs[12] from t_ptrace_wait{,3,4,6,id,pid}
CPU Debug Registers won't be exposed as is to userland.

Hardware Watchpoints will be exported to userland dedicated interface
through the ptrace(2) interface.

Sponsored by <The NetBSD Foundation>
2016-12-13 12:25:05 +00:00
kamil
1377ca283a options(4): Remove KSTACK_CHECK_DR0. 2016-12-13 11:01:10 +00:00
wiz
c63070ac1f Bump date for previous. 2016-12-13 11:00:20 +00:00
kamil
35e94f32ac KSTACK_CHECK_DR0 is no longer available
It used to detect stackoverflow on the i386 port.

Sponsored by <The NetBSD Foundation>
2016-12-13 10:55:40 +00:00
kamil
192986ec23 Torn down KSTACK_CHECK_DR0, i386-only feature to detect stack overflow
This feature was intended to detect stack overflow with CPU Debug Registers
(x86). It was never ported to other ports, neither amd64 and should be
adapted for SMP...

Currently there might be better ways to detect stack overflows like page
mapping protection. Since the number of Debug Registers is restricted
(4 on x86), torn it down completely.

This interface introduced helper functions for Debug Registers, they will
be replaced with the new <x86/dbregs.h> interface.

KSTACK_CHECK_DR0 was disabled by default and won't affect ordinary users.

Sponsored by <The NetBSD Foundation>
2016-12-13 10:54:27 +00:00
kamil
9b94e002e8 Switch x86 CPU Debug Register types from vaddr_t to register_t
This is more opaque and appropriate type, as vaddr_t is meant to be used
for vitual address value. Not all DR on x86 are used to represent virtual
address (DR6 and DR7 are definitely not).

No functional change intended.

Change suggested by <christos>

Sponsored by <The NetBSD Foundation>
2016-12-13 10:21:33 +00:00
msaitoh
32c8242f0c - Change to use 2500Base-KX correctly on C2000(I354). It worked, but the
output of ifconfig and if_baudrate was not good. Tested by nils@:
  - The STATUS_TBIMODE bit in the STATUS register is deleted since 82575,
    so check for 82575 and newer first and then check for old devices.
  - Check the 2P5_SKU and 2P5_SKU_OVER bit for KX.
  - Set IFM_2500_SX instead of IFM_1000_SX for 2.5G.
- Check SERDES's speed directly from the PCS layer (PCS_LSTS register) for old
  devices.
- Style fix.
2016-12-13 10:01:44 +00:00
rjs
c324046c36 Add a bit for Mobile IPv6. 2016-12-13 09:51:34 +00:00
kamil
6c52405165 Add initial TODO list for the ptrace(2) (and procfs) interface.
Sponsored by <The NetBSD Foundation>
2016-12-13 09:44:35 +00:00
ozaki-r
44375ea93d Remove unnecessary inclusions of nd6.h 2016-12-13 08:29:03 +00:00
ozaki-r
81f2534aaa Constify ifp of if_is_deactivated 2016-12-13 02:05:48 +00:00
knakahara
22bec9c1a0 MP-safe pppoe(4).
Nearly all parts is implemented by Shoichi YAMAGUCHI<s-yamaguchi@IIJ>, thanks.
2016-12-13 00:35:11 +00:00
maya
fc870ff150 Bump for drm2 da_fb_linebytes
Welcome to 7.99.47
2016-12-12 21:56:00 +00:00
riastradh
efda97f48b wtf tfw
Courtesy of i3enedek.
2016-12-12 20:41:49 +00:00
christos
6721aabc1e Handle functions that use the offset from either kinfo_proc2/kinfo_lwp properly. 2016-12-12 20:35:36 +00:00
maya
8538f99c2c add da_fb_linebytes to drmfb_attach_args and use it to pass linebytes
from nouveau code to drmfb. keep the same linebytes logic for i915.

nvidia hardware needs 256 byte alignment, so aligning to just 64 was
not enough.

fixes broken console with a width of 1440px (PR kern/51181)
ok riastradh
2016-12-12 19:45:56 +00:00
mrg
899aca2e24 mknative, binutils 2.27, and ia64. 2016-12-12 19:15:15 +00:00
flxd
41d99bfb78 Clean-up (remove redundant declarations, concentrate checks). 2016-12-12 17:03:40 +00:00
bouyer
a07ee70f52 Followling an advice in a linux forum, don't update LCR1/LCR2.
With this change this CH340 usb/serial based device:
https://www.olimex.com/Products/Breadboarding/BB-CH340T/open-source-hardware
(the chip is written H340T)
works as expected. As I'm not sure if this is needed for older device,
make this change for sc_version 0x30 or newer only.
While there, match USB_PRODUCT_WINCHIPHEAD2_CH341_2 too.
2016-12-12 16:47:06 +00:00
bouyer
ed2d984226 Regen for USB_PRODUCT_WINCHIPHEAD2_CH341_2 2016-12-12 16:43:14 +00:00
bouyer
9ae5fc1a0b Rename "CH341 serial/parallel" to "CH341 USB-Serial Bridge", and
add a second device id for this chip.
From FreeBSD.
2016-12-12 16:41:08 +00:00
christos
8a4f73aacb simple path fixes 2016-12-12 16:30:03 +00:00
maya
21cc7f1b6b acknowleg -> acknowledg, proceedure -> procedure.
only comments were changed.

from miod
2016-12-12 15:58:44 +00:00
nat
b2644509c2 Fix path to files.audio. 2016-12-12 13:31:13 +00:00
kamil
2cfd9597d2 Add missing files in distribution file lists to fix evbarm64-aarch64 build
Add ./usr/libdata/ldscripts/aarch64elf{,b}.xd{,c,w}

Tested with MKLLVM=yes and HAVE_LLVM=yes.
2016-12-12 13:13:11 +00:00
nat
4012ae34ea Update audio man page with regard to audio changes.
OK wiz@
2016-12-12 11:49:27 +00:00
joerg
9b3102e4b1 Mark bell_thread as static and dead. 2016-12-12 10:46:39 +00:00
joerg
5e6012ec99 sig_atomic_t does not include volatile. Prevent static analysis from
understanding that the test function is dead.
2016-12-12 10:34:55 +00:00
wiz
c985f95b45 Improve wording. Fix typo. Remove superfluous Pp. 2016-12-12 10:13:00 +00:00
wiz
9b02f8947b New sentence, new line.
Sort SEE ALSO.
2016-12-12 10:10:05 +00:00
wiz
36a13280ea Fix xref. 2016-12-12 10:09:52 +00:00
wiz
d8a6eb3c16 Whitespace. 2016-12-12 10:07:48 +00:00
knakahara
446d4c27f3 fix accidentally if_pppoe atf failure depends on cpu workload.
advised by s-yamaguchi@IIJ, thanks.
2016-12-12 09:56:58 +00:00
christos
2b4d6aa5a1 fix placement of lint comment 2016-12-12 04:20:31 +00:00
ozaki-r
55a0c560da Bump for MP-safe routing table
Welcome to 7.99.46
2016-12-12 03:59:24 +00:00
ozaki-r
6fb8880601 Make the routing table and rtcaches MP-safe
See the following descriptions for details.

Proposed on tech-kern and tech-net


Overview
--------

We protect the routing table with a rwock and protect
rtcaches with another rwlock. Each rtentry is protected
from being freed or updated via reference counting and psref.

Global rwlocks
--------------

There are two rwlocks; one for the routing table (rt_lock) and
the other for rtcaches (rtcache_lock). rtcache_lock covers
all existing rtcaches; there may have room for optimizations
(future work).

The locking order is rtcache_lock first and rt_lock is next.

rtentry references
------------------

References to an rtentry is managed with reference counting
and psref. Either of the two mechanisms is used depending on
where a rtentry is obtained. Reference counting is used when
we obtain a rtentry from the routing table directly via
rtalloc1 and rtrequest{,1} while psref is used when we obtain
a rtentry from a rtcache via rtcache_* APIs. In both cases,
a caller can sleep/block with holding an obtained rtentry.

The reasons why we use two different mechanisms are (i) only
using reference counting hurts the performance due to atomic
instructions (rtcache case) (ii) ease of implementation;
applying psref to APIs such rtaloc1 and rtrequest{,1} requires
additional works (adding a local variable and an argument).

We will finally migrate to use only psref but we can do it
when we have a lockless routing table alternative.

Reference counting for rtentry
------------------------------

rt_refcnt now doesn't count permanent references such as for
rt_timers and rtcaches, instead it is used only for temporal
references when obtaining a rtentry via rtalloc1 and rtrequest{,1}.
We can do so because destroying a rtentry always involves
removing references of rt_timers and rtcaches to the rtentry
and we don't need to track such references. This also makes
it easy to wait for readers to release references on deleting
or updating a rtentry, i.e., we can simply wait until the
reference counter is 0 or 1. (If there are permanent references
the counter can be arbitrary.)

rt_ref increments a reference counter of a rtentry and rt_unref
decrements it. rt_ref is called inside APIs (rtalloc1 and
rtrequest{,1} so users don't need to care about it while
users must call rt_unref to an obtained rtentry after using it.

rtfree is removed and we use rt_unref and rt_free instead.
rt_unref now just decrements the counter of a given rtentry
and rt_free just tries to destroy a given rtentry.

See the next section for destructions of rtentries by rt_free.

Destructions of rtentries
-------------------------

We destroy a rtentry only when we call rtrequst{,1}(RTM_DELETE);
the original implementation can destroy in any rtfree where it's
the last reference. If we use reference counting or psref, it's
easy to understand if the place that a rtentry is destroyed is
fixed.

rt_free waits for references to a given rtentry to be released
before actually destroying the rtentry. rt_free uses a condition
variable (cv_wait) (and psref_target_destroy for psref) to wait.

Unfortunately rtrequst{,1}(RTM_DELETE) can be called in softint
that we cannot use cv_wait. In that case, we have to defer the
destruction to a workqueue.

rtentry#rt_cv, rtentry#rt_psref and global variables
(see rt_free_global) are added to conduct the procedure.

Updates of rtentries
--------------------

One difficulty to use refcnt/psref instead of rwlock for rtentry
is updates of rtentries. We need an additional mechanism to
prevent readers from seeing inconsistency of a rtentry being
updated.

We introduce RTF_UPDATING flag to rtentries that are updating.
While the flag is set to a rtentry, users cannot acquire the
rtentry. By doing so, we avoid users to see inconsistent
rtentries.

There are two options when a user tries to acquire a rtentry
with the RTF_UPDATING flag; if a user runs in softint context
the user fails to acquire a rtentry (NULL is returned).
Otherwise a user waits until the update completes by waiting
on cv.

The procedure of a updater is simpler to destruction of
a rtentry. Wait on cv (and psref) and after all readers left,
proceed with the update.

Global variables (see rt_update_global) are added to conduct
the procedure.

Currently we apply the mechanism to only RTM_CHANGE in
rtsock.c. We would have to apply other codes. See
"Known issues" section.

psref for rtentry
-----------------

When we obtain a rtentry from a rtcache via rtcache_* APIs,
psref is used to reference to the rtentry.

rtcache_ref acquires a reference to a rtentry with psref
and rtcache_unref releases the reference after using it.
rtcache_ref is called inside rtcache_* APIs and users don't
need to take care of it while users must call rtcache_unref
to release the reference.

struct psref and int bound that is needed for psref is
embedded into struct route. By doing so we don't need to
add local variables and additional argument to APIs.

However this adds another constraint to psref other than
reference counting one's; holding a reference of an rtentry
via a rtcache is allowed by just one caller at the same time.
So we must not acquire a rtentry via a rtcache twice and
avoid a recursive use of a rtcache. And also a rtcache must
be arranged to be used by a LWP/softint at the same time
somehow. For IP forwarding case, we have per-CPU rtcaches
used in softint so the constraint is guaranteed. For a h
rtcache of a PCB case, the constraint is guaranteed by the
solock of each PCB. Any other cases (pf, ipf, stf and ipsec)
are currently guaranteed by only the existence of the global
locks (softnet_lock and/or KERNEL_LOCK). If we've found the
cases that we cannot guarantee the constraint, we would need
to introduce other rtcache APIs that use simple reference
counting.

psref of rtcache is created with IPL_SOFTNET and so rtcache
shouldn't used at an IPL higher than IPL_SOFTNET.

Note that rtcache_free is used to invalidate a given rtcache.
We don't need another care by my change; just keep them as
they are.

Performance impact
------------------

When NET_MPSAFE is disabled the performance drop is 3% while
when it's enabled the drop is increased to 11%. The difference
comes from that currently we don't take any global locks and
don't use psref if NET_MPSAFE is disabled.

We can optimize the performance of the case of NET_MPSAFE
on by reducing lookups of rtcache that uses psref;
currently we do two lookups but we should be able to trim
one of two. This is a future work.

Known issues
------------

There are two known issues to be solved; one is that
a caller of rtrequest(RTM_ADD) may change rtentry (see rtinit).
We need to prevent new references during the update. Or
we may be able to remove the code (perhaps, need more
investigations).

The other is rtredirect that updates a rtentry. We need
to apply our update mechanism, however it's not easy because
rtredirect is called in softint and we cannot apply our
mechanism simply. One solution is to defer rtredirect to
a workqueue but it requires some code restructuring.
2016-12-12 03:55:57 +00:00
ozaki-r
f2613b7f35 Introduce macros for the prefix list
No functional change.
2016-12-12 03:14:01 +00:00
ozaki-r
f5a82c952d Introduce macros for the default router list
No functional change.
2016-12-12 03:13:14 +00:00
pgoyette
e0bed1f988 Make kernels w/o ACPICA compile. (Same "fix" as Martin made to i386...)
cvs: ----------------------------------------------------------------------
2016-12-12 02:51:24 +00:00
martin
e4d8985f7f Make kernels w/o ACPICA compile. 2016-12-11 22:38:50 +00:00
blymn
4114d2610d Improve debug information. 2016-12-11 21:25:22 +00:00
mrg
48524f008b there was a bug fix in july. call this 20160720. 2016-12-11 20:40:41 +00:00
christos
2437894b76 catch up with sd changes. 2016-12-11 16:25:54 +00:00