Commit Graph

253977 Commits

Author SHA1 Message Date
kre 48bbd83f93 Create directory for new bwfm firmware to be installed into. 2017-10-21 05:30:48 +00:00
jmcneill a9b78e1ec4 Add seeprom(4) 2017-10-21 03:17:36 +00:00
jmcneill db9ad7f83e match atmel,24c16 2017-10-21 03:17:09 +00:00
jmcneill 675a4d5b70 Fix sun4i platform delay to sleep the requested number of microseconds
instead of the requested number of clock ticks.
2017-10-21 02:21:30 +00:00
jmcneill 9f03ea3d87 Add bwfm firmware Makefile 2017-10-21 02:06:34 +00:00
jmcneill f7187bf1f4 Install bwfm(4) firmware. 2017-10-21 02:05:38 +00:00
jmcneill 20035bfbf7 Import bwfm firmware from linux-firmware on 2017-10-20 2017-10-21 01:58:59 +00:00
jmcneill 3cec904f41 Set maximum supported bwfm_bss_info length 2017-10-20 23:38:56 +00:00
jmcneill f3782174ea Fix an alignment problem with scan results within an escan event 2017-10-20 23:38:21 +00:00
jmcneill 711074bb89 add sun4iemac 2017-10-20 22:29:33 +00:00
jmcneill fdb05dd9b6 Add driver for sun4i/sun7i 10/100 Fast Ethernet controller (EMAC). 2017-10-20 22:29:15 +00:00
jdolecek e86198ff27 actually 0680 uses different chip map func, which doesn't call the function
handing non-independant channels, so don't set IDE_SHARED_CHANNELS for it
2017-10-20 21:51:29 +00:00
riastradh f7b8b20d17 Initialize the in/out parameter vmin.
vmin is only an optional hint since we're not passing UVM_FLAG_FIXED,
but that doesn't mean we should use uninitialized stack garbage as
the hint.

Noted by chs@.
2017-10-20 19:06:46 +00:00
riastradh 4691bf4bd7 Carve out KVA for execargs on boot from an exec_map like we used to.
Candidate fix for PR kern/45718: `processes sometimes get stuck and
spin in vm_map', a problem that has been plaguing all our 32-bit
ports for years.

Since we currently use large (256k) buffers for execargs, and since
nobody has stepped up to tackle breaking them into bite-sized (or at
least page-sized) chunks, after KVA gets sufficiently fragmented we
can't allocate new execargs buffers from kernel_map.

Until 2008, we always carved out KVA for execargs on boot with a uvm
submap exec_map of kernel_map.  Then ad@ found that the uvm_km_free
call, to discard them when done, cost about 100us, which a pool
avoided:

https://mail-index.NetBSD.org/tech-kern/2008/06/25/msg001854.html
https://mail-index.NetBSD.org/tech-kern/2008/06/26/msg001859.html

ad@ _simultaneously_ introduced a pool _and_ eliminated the reserved
KVA in the exec_map submap.  This change preserves the pool, but
restores exec_map (with less code, by putting it in MI code instead
of copying it in every MD initialization routine).

Patch proposed on tech-kern:
https://mail-index.NetBSD.org/tech-kern/2017/10/19/msg022461.html

Patch tested by bouyer@:
https://mail-index.NetBSD.org/tech-kern/2017/10/20/msg022465.html

I previously discussed the issue on tech-kern before I knew of the
history around exec_map:
https://mail-index.NetBSD.org/tech-kern/2012/12/09/msg014695.html

The candidate workaround I proposed of using pool_setlowat to force
preallocation of KVA would also force preallocation of physical RAM,
which is a waste not incurred by using exec_map, and which is part of
why I never committed it.

There may remain a general problem that if thread A calls pool_get
and tries to service that request by a uvm_km_alloc call that hangs
because KVA is scarce, and thread B does pool_put, the pool_put in
thread B will not notify the pool_get in thread A that it doesn't
need to wait for KVA, and so thread A may continue to hang in
uvm_km_alloc.  However,

(a) That won't apply here, because there is exactly as much KVA
available in exec_map as exec_pool will ever try to use.

(b) It is possible that may not even matter in other cases as long as
the page daemon eventually tries to shrink the pool, which will cause
a uvm_km_free that can unhang the hung uvm_km_alloc.

XXX pullup-8
XXX pullup-7
XXX pullup-6
XXX pullup-5, perhaps...
2017-10-20 14:48:43 +00:00
martin f115d566a4 Make check_exec() errors print the name of the binary that fails to
execute.
2017-10-20 12:11:34 +00:00
christos c11e935624 regen 2017-10-20 12:03:15 +00:00
christos 96e561ac8e update entry for Marvel Yukon 8058, and fix URL for pci ids (Rocky Hotas) 2017-10-20 12:01:43 +00:00
msaitoh c1f515b7e7 On I219, drop TARC0 bit 28 for DMA hang workaround (from Linux). 2017-10-20 09:26:13 +00:00
msaitoh 428e217142 No functional change:
- Simplify ifmedia_removeall using with ifmedia_delete_instance(IFM_INST_ANY).
 - KNF.
2017-10-20 08:04:39 +00:00
jdolecek 62fb613155 move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
2017-10-20 07:06:05 +00:00
ozaki-r 690df934db Add test cases for one SP with multiple SAs
These are for a bug reported recently which modifies SPs accidentally.
2017-10-20 03:45:47 +00:00
ozaki-r d031869d08 Suppress name resolution 2017-10-20 03:45:02 +00:00
ozaki-r 101922ebfc Fix incomplete SP setups 2017-10-20 03:43:51 +00:00
ozaki-r 25af614d05 Show packet counters 2017-10-20 03:42:53 +00:00
jmcneill 0a57f73f44 add bwfm 2017-10-19 23:59:56 +00:00
jmcneill 362753ef69 Add bwfm 2017-10-19 23:59:30 +00:00
jmcneill 6d494689b1 Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.
2017-10-19 23:58:41 +00:00
jmcneill cc5188baf3 regen 2017-10-19 23:55:02 +00:00
jmcneill 6df2ee4644 Add USB IDs for Broadcom BCM43236, BCM43143, BCM43242, and BCM43569 USB
wireless devices.
2017-10-19 23:54:42 +00:00
jdolecek e5c1f84bb6 more detailed debug info; also sync DEBUG_* values in wd.c with ata.c 2017-10-19 20:45:07 +00:00
maxv 7e9dea780d Use cmpw. 2017-10-19 20:27:12 +00:00
jdolecek 573c5146a9 replace the chek for the shared channel of cmdide(4) a flag of the
product array, rather than switch inside attach routine

XXX judging from product name, Silicon Image 0680 might be newer than 0649
XXX and hence have actually independant channels, but I don't have the hw
XXX so keeping as-is

no functional change, just to improve visibility in course of fixing
PR kern/52606
2017-10-19 20:11:38 +00:00
maxv 8c8a19380d Improve our segregs model. Pass 2/3.
Treat %fs the same way we treat %ds and %es. For a new 32bit LWP %fs is
set to GUDATA32_SEL, and always updated in INTRFASTEXIT.

This solves an important issue we had until now: we couldn't handle the
faults generated by the "movw $val,%fs" instructions, because they were
deep into the kernel context. Now %fs can fault only in INTRFASTEXIT,
which is safe.

Note that it also fixes a bug I believe affected the kernel: on AMD CPUs,
setting %fs to zero does not flush the internal register state, and
therefore we could leak the %fs base address when context-switching. This
being said, I couldn't trigger the issue on the AMD cpu I have. Whatever,
it's fixed now, since we first set %fs to GUDATA32 - which does flush the
register state.
2017-10-19 19:05:53 +00:00
maxv 5aa55d4fc6 Improve our segregs model. Pass 1/3.
Right now, we are saving and restoring %ds/%es each time we enter/leave the
kernel. However, we let %fs/%gs live in the kernel space, and we rely on
the fact that when switching to an LWP, %fs/%gs are set right away (via
cpu_switchto or setregs).

It has two drawbacks: we are taking care of %ds/%es while they are
deprecated (useless) on 64bit LWPs, and we are restricting %fs/%gs while
they still have a meaning on 32bit LWPs.

Therefore, handle 32bit and 64bit LWPs differently:
 * 64bit LWPs use fixed segregs, which are not taken care of.
 * 32bit LWPs have dynamic segregs, always saved/restored.

For now, only %ds and %es are changed; %fs and %gs will be in the next
passes.

The trapframe is constructed as usual. In INTRFASTEXIT, we restore %ds/%es
depending on the %cs value. If %cs contains one of the two standard 64bit
selectors, don't do anything. Otherwise, restore everything.

When doing a context switch, just restore %ds/%es to their default values.
On a 32bit LWP they will be overwritten by INTRFASTEXIT; on a 64bit LWP
they won't be updated.

In the ACPI wakeup code, restore %ds/%es to the default 64bit user value.
2017-10-19 18:36:31 +00:00
skrll 9288b0c345 Don't call tegra_pcie_reset_port for now - it makes tk1 re @ pci not work 2017-10-19 16:01:58 +00:00
knakahara e810bcfb9c fix l2tp panic when l2tp session id is changed (same as if_vlan.c:r1.104)
E.g. the following operation causes this panic.
    ====================
    # ifconfig l2tp0 create
    # ifconfig l2tp0 session 140 140
    # ifconfig l2tp1 create
    # ifconfig l2tp1 session 200 200
    # ifconfig l2tp1 session 300 300
    panic: kernel diagnostic assertion "new->ple_next == NULL" failed: file "/disk4/home/k-nakahara/repos/netbsd-src/sys/sys/pslist.h", line 118
    ====================

Pointed out by s-yamaguchi@IIJ, thanks.

XXX need pullup-8
2017-10-19 11:28:30 +00:00
maxv 1fe402e2a1 Always mask the 16 bits of the segregs in the trapframe. We don't zero-
extend the uint64_t's when building it, so we're leaking 48 bits of kernel
stack to userland.

Having said that, it appears that I unintentionally fixed most of this
issue in locore.S::rev1.127 - by building the frame with interrupts
disabled, we are implicitly guaranteeing that the structure doesn't get
overwritten by the kernel. Which means, we are leaking to userland data
that comes from userland anyway.

(still other places with this issue, but I'll fix them differently)
2017-10-19 10:01:09 +00:00
maxv 20f14b034c Make sure we don't go farther with 32bit LWPs. There appears to be some
confusion in the code - in part introduced by myself -, and clearly this
place is not supposed to handle 32bit LWPs.

Right now we're returning EINVAL, but verily we would need to redirect
these calls to their netbsd32 counterparts.
2017-10-19 09:32:01 +00:00
knakahara d71c6de37e fix vlan panic when vlan is re-configured without destroy.
E.g. the following operation causes this panic.
    ====================
    # ifconfig vlan0 create
    # ifconfig vlan0 vlan 1 vlanif ixg3
    # ifconfig vlan1 create
    # ifconfig vlan1 vlan 1 vlanif ixg2
    # ifconfig vlan1 -vlanif
    # ifconfig vlan1 vlan 1 vlanif ixg2

    panic: kernel diagnostic assertion "new->ple_next == NULL" failed: file "/git/netbsd-src/sys/sys/pslist.h", line 118
    ====================

Pointed out and tested by msaitoh@n.o, fixed by s-yamaguchi@IIJ, thanks.

XXX need pullup-8
2017-10-19 07:02:00 +00:00
msaitoh 8427810e88 Add the following bits in AMD Fn8000000a %edx features (SVM features):
PFThreshold (PAUSE filter threshold)
	AVIC (AMD virtual interrupt controller)
	V_VMSAVE_VMLOAD (virtualized VMSAVE and VMLOAD)
	vGIF (virtualized GIF)
2017-10-19 06:29:16 +00:00
msaitoh 2cc66b4771 Fix a bug that the TPH ST table is decoded even if it's not in the TPH
Requester extended capability structure.
2017-10-19 05:52:57 +00:00
skrll 2307aa9b6a Fix RCSIds 2017-10-19 05:45:37 +00:00
skrll 2f93eddcf8 KASSERT -> KASSERTMSG and while I'm here update a comment 2017-10-19 05:39:22 +00:00
nonaka b593b49cd1 external/lgpl3/gmp build fail in configure phase with "ln -s J /etc/malloc.conf".
patch from pkgsrc/devel/gmp
  http://mail-index.netbsd.org/pkgsrc-changes/2017/06/15/msg158404.html
2017-10-19 03:26:28 +00:00
msaitoh 4a84e4a57f Update from Intel SDM:
0x55: Xeon Scalable (Skylake)
 0x57: Xeon Phi [357]200 (Knights Landing)
 0x66: Future Core (Cannon Lake)
 0x85: Future Xeon Phi (Knights Mill)
2017-10-19 03:09:55 +00:00
kre bffe519047 Re-factor the code that extracts status from exited jobs, avoiding
code duplication, and reducing the size of /bin/sh by a trivial amount.

NFCI.

This is being done now as there are two other changes forthcoming, both
of which benefit - one would result in even more code duplication without
this, the other might need to alter how this is done, and doing it after this
means there's just one place to change (if required).
2017-10-19 01:57:18 +00:00
ozaki-r 7107584815 Turn on D_MPSAFE flag of bpf_cdevsw that is already MP-safe
Pointed out by k-goda@IIJ
2017-10-19 01:57:15 +00:00
wiz 14b00a757c Remove unnecessary Tn. 2017-10-18 18:11:54 +00:00
maxv bf5a5b0bda If a branch is already there, use it and don't create a new one. This way
we can call mm_map_tree twice with neighboring regions.
2017-10-18 17:12:42 +00:00
maxv e1daa555fd Group the sections into segments, and align to KERNALIGN only between
segments. Prerequisite for other changes. Unfortunately the code is not
very compact, but whatever.
2017-10-18 16:29:56 +00:00