Commit Graph

254614 Commits

Author SHA1 Message Date
Michael Tuexen
47384244f9 Fix an issue I introuced in r367530: tcp_twcheck() can be called
with to == NULL for SYN segments. So don't assume tp != NULL.
Thanks to jhb@ for reporting and suggesting a fix.

PR:			250499
MFC after:		1 week
XMFC-with:		r367530
Sponsored by:		Netflix, Inc.
2020-11-20 13:00:28 +00:00
Konstantin Belousov
1b3cb4dc04 msdosfs: Add trivial support for suspension.
Tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27269
2020-11-20 12:31:02 +00:00
Gordon Bergling
c17b2a79bd camcontrol(8): Fix some warnings spotted by mandoc
- skipping paragraph macro: Pp before Bl
2020-11-20 11:45:08 +00:00
Emmanuel Vadot
98ea5a7b9a if_dwc: Add checksum offloading support 2020-11-20 11:31:25 +00:00
Emmanuel Vadot
2b4a66ed17 if_dwc: Add flow control support 2020-11-20 11:31:04 +00:00
Emmanuel Vadot
354cb625ee if_awg: Add a awg_dma_start_tx function that trigger dma engine
No functional changes intended
2020-11-20 11:30:44 +00:00
Emmanuel Vadot
3bbd11ee51 if_dwc: Use if_ function where appropriate
No functional changes intended
2020-11-20 11:30:23 +00:00
Emmanuel Vadot
2a35d39179 if_dwc: Reorder functions and sort them by usage
No functional changes intended
2020-11-20 11:30:01 +00:00
Emmanuel Vadot
5fba90649a if_awg: Reorder functions and sort them by usage
No functional changes intended
2020-11-20 11:29:37 +00:00
Emmanuel Vadot
f88e0af64a if_dwc: dwc_get_hwaddr cannot fail, change return to void
No functional changes intended
2020-11-20 11:29:20 +00:00
Emmanuel Vadot
afd0c3c268 if_dwc: Add dwc_stop_dma and use it in dwc_stop_locked
No functional changes intended
2020-11-20 11:29:00 +00:00
Emmanuel Vadot
a19071cea2 if_awg: Add awg_stop_dma and use it in awg_stop
No functional changes intended
2020-11-20 11:28:23 +00:00
Emmanuel Vadot
86c7bc68ed if_dwc: Use dwc_enable_mac in dwc_stop_locked
No functional changes intended
2020-11-20 11:28:06 +00:00
Emmanuel Vadot
f368f4b109 if_dwc: Add a function to enable/disable the mac tx/rx
No functional changes intended
2020-11-20 11:27:43 +00:00
Emmanuel Vadot
16790d8f79 if_awg: Add a function to enable/disable the mac tx/rx
No functional changes intended
2020-11-20 11:27:26 +00:00
Emmanuel Vadot
b0cc649b95 if_dwc: Use if_setdrvflagbits to notify that we are running
No functional changes intended
2020-11-20 11:27:08 +00:00
Emmanuel Vadot
158ce7ba0e if_dwc: Split init code into sub function
Be clear of what we enable or init.

No functional changes intended
2020-11-20 11:26:46 +00:00
Emmanuel Vadot
612a1b8d69 if_awg: Split init code into sub function
Be clear of what we enable or init.

No functional changes intended
2020-11-20 11:26:20 +00:00
Emmanuel Vadot
e65794334b if_awg: Remove the taskqueue for miibus_statchg
I guess it was added so we can obtain the device lock but we already
have it when the function is called.

No functional changes intended
2020-11-20 11:25:54 +00:00
Kristof Provost
d8f541d9a3 pf tests: Basic source tracking test
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27255
2020-11-20 10:11:03 +00:00
Kristof Provost
71c9acef8c pf: Fix incorrect assertion
We never set PFRULE_RULESRCTRACK when calling pf_insert_src_node(). We do set
PFRULE_SRCTRACK, so update the assertion to match.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27254
2020-11-20 10:08:33 +00:00
Eugene Grosbein
1032f7b82b bzgrep: make flag --no-filename work
PR:		248813
MFC after:	1 week
2020-11-20 09:56:46 +00:00
Michal Meloun
d9de80d614 Also pass interrupt binding request to non-root interrupt controllers.
There are message based controllers that can bind interrupts even if they are
not implemented as root controllers (such as the ITS subblock of GIC).

MFC after:	3 weeks
2020-11-20 09:05:36 +00:00
Simon J. Gerraty
e2eeea75eb Merge bmake-20201117
o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o More code cleanup and refactoring.

o More unit tests

MFC after:	1 week
2020-11-20 06:02:31 +00:00
Alexander Motin
466d0a2572 Microoptimize cam_num_doneqs math in xpt_done().
MFC after:	1 week
2020-11-20 05:46:27 +00:00
Simon J. Gerraty
1b65f0bd2b Import bmake-20201117
o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o Fix building and unit-tests on non-BSD.

o More code cleanup and refactoring.

o More unit tests
2020-11-20 03:54:37 +00:00
Alexander Motin
dae0ba753c Fix r367857 build without ISP_TARGET_MODE. 2020-11-20 02:03:58 +00:00
Alexander Motin
1b760be482 Remove parallel SCSI and 1/2Gb FC support from isp(4).
This removes 288KB (36%) of the driver code and zillions of hacks and
workarounds, making single driver uniformly support several different
generations of hardware interfaces, not counting minor card variations.
After years of the hopeless fight, I don't think it worth to continue
support for hardware obsolete for 15-20 years.  Instead much cleaner
now code should allow to move forward toward better locking, multiple
queues and other cool features.

All the remaining Qlogic cards starting from 4Gb 24xx to 32Gb 27xx use
the same hardware/firmware interface with minor incremental improvements,
so it seems to be a good new starting point.  Except one PCI-X model all
all of them are PCIe and so still usable in modern systems.

Discussed with:	ken, scottl, jpaetzel, imp
Relnotes:	yes
2020-11-20 01:15:48 +00:00
Vladimir Kondratyev
b33ba83470 psm(4): Disable AUX multiplexer probing on all Lenovo laptops.
Rudimentary AUX multiplexing support was added to kernel to make possible
touchpad initialization on some HP EliteBook laptops with trackpoint.

Disable multiplexer probing on all Lenovo laptops now as they use touchpad
pass-through port rather than AUX multiplexer to connect trackpoint and
at least two model (X120e and X121e) is known for getting PS/2 AUX port
dysfunctional after switching back to hidden multiplexing mode.

AUX MUX probing can be reenabled with setting of hw.psm.mux_disabled loader
tunable to 0.

PR:		249987
Reported by:	jwb
MFC after:	2 weeks
2020-11-20 00:13:30 +00:00
Ed Maste
65c207758a addr2line: swap if conditions for diff reduction in upcoming change
No functional change intended.
2020-11-19 21:10:36 +00:00
Mateusz Guzik
f9fe7b28bc pipe: thundering herd problem in pipelock
All reads and writes are serialized with a hand-rolled lock, but unlocking it
always wakes up all waiters. Existing flag fields get resized to make room for
introduction of waiter counter without growing the struct.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D27273
2020-11-19 19:25:47 +00:00
Fernando Apesteguía
7e9e52e7a7 fstat(1): Add EXAMPLES section
* Add examples covering -f, -m and -p flags.

While here, extend the initial description paragraph to note that fstat(1)
will report on all opened files, belonging to processes the user has access to.
The current paragraph may lead to understand that you can get information on
opened files from processes belonging to other users.

Reviewed by:	bjk@, danfe@, gbe@
Approved by:	manpages (gbe@)
Differential Revision:		https://reviews.freebsd.org/D26949
2020-11-19 19:05:16 +00:00
Fernando Apesteguía
5be3f744b4 grep(1): Add more EXAMPLES
* Add more EXAMPLES covering flags: -A, -B, -c, -f, -i, -H, -l, -q, -R, -w
* While here, change existing wording to use the imperative (remove "To
  find")
* Reword first example to be consistent with how grep(1) understand
  words (-w)

Approved by:	manpages (bcr@)
Differential Revision:		https://reviews.freebsd.org/D27264
2020-11-19 18:58:15 +00:00
Mark Johnston
a33fef5e25 callout(9): Fix a race between CPU migration and callout_drain()
Suppose a running callout re-arms itself, and before the callout
finishes running another CPU calls callout_drain() and goes to sleep.
softclock_call_cc() will wake up the draining thread, which may not run
immediately if there is a lot of CPU load.  Furthermore, the callout is
still in the callout wheel so it can continue to run and re-arm itself.
Then, suppose that the callout migrates to another CPU before the
draining thread gets a chance to run.  The draining thread is in this
loop in _callout_stop_safe():

	while (cc_exec_curr(cc) == c) {
		CC_UNLOCK(cc);
		sleep();
		CC_LOCK(cc);
	}

but after the migration, cc points to the wrong CPU's callout state.
Then the draining thread goes off and removes the callout from the
wheel, but does so using the wrong lock and per-CPU callout state.

Fix the problem by doing a re-lookup of the callout CPU after sleeping.

Reported by:	syzbot+79569cd4d76636b2cc1c@syzkaller.appspotmail.com
Reported by:	syzbot+1b27e0237aa22d8adffa@syzkaller.appspotmail.com
Reported by:	syzbot+e21aa5b85a9aff90ef3e@syzkaller.appspotmail.com
Reviewed by:	emaste, hselasky
Tested by:	pho
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27266
2020-11-19 18:37:28 +00:00
Mitchell Horne
c8a96cdcd9 Add an option for entering KDB on recursive panics
There are many cases where one would choose avoid entering the debugger
on a normal panic, opting instead to reboot and possibly save a kernel
dump. However, recursive kernel panics are an unusual case that might
warrant attention from a human, so provide a secondary tunable,
debug.debugger_on_recursive_panic, to allow entering the debugger only
when this occurs.

For for simplicity in maintaining existing behaviour, the tunable
defaults to zero.

Reviewed by:	cem, markj
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D27271
2020-11-19 18:03:40 +00:00
Warner Losh
24d79e9b63 Document disk ioctl
First stab at documenting the different disk ioctl commands defined in
sys/disk.h.

Reviewed by: phk (prior version)
Differential Revision: https://reviews.freebsd.org/D26994
2020-11-19 17:54:41 +00:00
Daniel Ebdrup Jensen
c78a221821 intro.7: Add missing manual page
Section 7 of the manual pages contain lots of very useful information, but
finding the pages is not always obvious - to assist people in finding the
information, add missing cross-references.

Reviewed by:	0mp (mentor), mhorne, yuripv
Approved by:	0mp (mentor
Differential Revision:	https://reviews.freebsd.org/D27284
2020-11-19 16:57:45 +00:00
Mark Johnston
1fea4b25c9 Wrap a long line in vm_pqbatch_process_page() 2020-11-19 15:41:42 +00:00
Mark Johnston
9e3e737608 Micro-optimize vm_page_pqbatch_submit()
Avoid calling vm_page_domain() twice.

Discussed with:	alc (in D27207)
2020-11-19 15:40:58 +00:00
Emmanuel Vadot
44bef6729b release: Switch the Allwinner board to GPT
Allwinner bootrom have an alternate location for u-boot at 128k.
Work was made recently in u-boot to relocate correctly if loaded from
there.
The advantage of this offset is that we can now use a GPT scheme.
2020-11-19 14:27:01 +00:00
Mateusz Guzik
d116b9f1ad thread: numa-aware zombie reaping
The current global list is a significant problem, in particular induces a lot
of cross-domain thread frees. When running poudriere on a 2 domain box about
half of all frees were of that nature.

Patch below introduces per-domain thread data containing zombie lists and
domain-aware reaping. By default it only reaps from the current domain, only
reaping from others if there is free TID shortage.

A dedicated callout is introduced to reap lingering threads if there happens
to be no activity.

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D27185
2020-11-19 10:00:48 +00:00
Andrew Turner
02a6de7789 Fall back to use the GICR address from the generic interrupt struct
When there is no ACPI redistributor sub-table in the MADT we need to
fall back to use the GICR base address from the GIC CPU interface
structure.

Handle this fallback when adding memory to the device and when counting
the number of redistributors.

PR:		251171
Reported by:	Andrey Fesenko <f0andrey_gmail.com>
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D27247
2020-11-19 09:26:51 +00:00
Mateusz Guzik
b8cb628534 pipe: tidy up pipelock 2020-11-19 08:16:45 +00:00
Peter Grehan
887d46ef5b Advance RIP after userspace instruction decode
Add update to RIP after a userspace instruction decode (as is done for
the in-kernel counterpart of this case).

Submitted by:	adam_fenn.io
Reviewed by:	cem, markj
Approved by:	grehan (bhyve)
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D27243
2020-11-19 07:23:39 +00:00
Mateusz Guzik
89744405e6 pipe: allow for lockless pipe_stat
pipes get stated all thet time and this avoidably contributed to contention.
The pipe lock is only held to accomodate MAC and to check the type.

Since normally there is no probe for pipe stat depessimize this by having the
flag.

The pipe_state field gets modified with locks held all the time and it's not
feasible to convert them to use atomic store. Move the type flag away to a
separate variable as a simple cleanup and to provide stable field to read.
Use short for both fields to avoid growing the struct.

While here short-circuit MAC for pipe_poll as well.
2020-11-19 06:30:25 +00:00
Dag-Erling Smørgrav
a90c7d9aa8 Merge upstream r948: fix race condition in openpam_ttyconv(3). 2020-11-19 05:46:59 +00:00
Dag-Erling Smørgrav
5d48efff83 Merge upstream r948: fix race condition in openpam_ttyconv(3). 2020-11-19 05:44:41 +00:00
Mateusz Guzik
2f5b0b48ac cred: fix minor nits in r367695
Noted by:	jhb
2020-11-19 04:28:39 +00:00
Mateusz Guzik
c48f897bbe smp: fix smp_rendezvous_cpus_retry usage before smp starts
Since none of the other CPUs are running there is nobody to clear their
entries and the routine spins indefinitely.
2020-11-19 04:27:51 +00:00
Mark Johnston
431fb8abd7 vm_phys: Try to clean up NUMA KPIs
It can useful for code outside the VM system to look up the NUMA domain
of a page backing a virtual or physical address, specifically when
creating NUMA-aware data structures.  We have _vm_phys_domain() for
this, but the leading underscore implies that it's an internal function,
and vm_phys.h has dependencies on a number of other headers.

Rename vm_phys_domain() to vm_page_domain(), and _vm_phys_domain() to
vm_phys_domain().  Make the latter an inline function.

Add _vm_phys.h and define struct vm_phys_seg there so that it's easier
to use in other headers.  Include it from vm_page.h so that
vm_page_domain() can be defined there.

Include machine/vmparam.h from _vm_phys.h since it depends directly on
some constants defined there.

Reviewed by:	alc
Reviewed by:	dougm, kib (earlier versions)
Differential Revision:	https://reviews.freebsd.org/D27207
2020-11-19 03:59:21 +00:00