Commit Graph

267226 Commits

Author SHA1 Message Date
Ed Maste
e1e9e084a7 Revert "Cirrus-CI: Temporarily skip package build + test"
This reverts commit 2bfba2a04b.

As of commit 4e224e4be7 Makefile.inc1 works with old and new pkg.

PR:		257422
Sponsored by:	The FreeBSD Foundation
2021-07-27 16:28:47 -04:00
Ed Maste
4e224e4be7 pkgbase: accommodate pkg < 1.17
6cafdee71d adapted the pkgbase build for 1.17, but broke Cirrus-CI's
use of PKG_FORMAT=tar (the quarterly package set still has pkg 1.16).
Because of this I disabled the pkgbase build and test in 2bfba2a04b.

Now, check `pkg --version` and use the old logic for < 1.17.

To be reverted once we no longer encounter pkg 1.16 in Cirrus-CI (i.e.,
via GCP cloud images) to avoid keeping this extra complexity around.

PR:		257422
Reviewed by:	manu
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31324
2021-07-27 14:50:06 -04:00
Alan Somers
674400eb20 ftpd: delete dead code
Delete code killed by SVN r13139 in 1996.  Little chance that it would
still compile today.

PR:		257317
Reported by:	Alan Shearer <sakison@gmail.com>
MFC after:	2 weeks
Sponsored by:	Axcient
2021-07-27 12:18:08 -06:00
Konstantin Belousov
d6717f8778 amd64: rework AP startup
Stop using temporal page table with 1:1 mapping of low 1G populated over
the whole VA.  Use 1:1 mapping of low 4G temporarily installed in the
normal kernel page table.

The features are:
- now there is one less step for startup asm to perform
- the startup code still needs to be at lower 1G because CPU starts in
  real mode. But everything else can be located anywhere in low 4G
  because it is accessed by non-paged 32bit protected mode.  Note that
  kernel page table root page is at low 4G, as well as the kernel itself.
- the page table pages can be allocated by normal allocator, there is
  no need to carve them from the phys_avail segments at very early time.
  The allocation of the page for startup code still requires some magic.
  Pages are freed after APs are ignited.
- la57 startup for APs is less tricky, we directly load the final page
  table and do not need to tweak the paging mode.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31121
2021-07-27 20:11:15 +03:00
Konstantin Belousov
d96f55bc71 linuxkpi: remove global atomic counter of the task allocations
Use thread_reap_barrier() to ensure that no threads are kept in the
zombies list which could have the linuxkpi task allocated.

Also fix order of initialization and teardown for current task
allocation hooks and resources. Register current task allocator after
zones are initialized. Deregister allocator before cycling over threads
and zeroing task pointer.

Reviewed by:	hselasky, markj
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D30468
2021-07-27 20:01:19 +03:00
Konstantin Belousov
4eaf9609fe nullfs: provide custom null_rename bypass
fdvp and fvp vnodes are not locked, and race with reclaim cannot be handled
by the generic bypass routine.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31310
2021-07-27 19:58:48 +03:00
Konstantin Belousov
26e72728ce null_rename: some style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31310
2021-07-27 19:58:47 +03:00
Konstantin Belousov
10db189649 fifofs: fifo vnode might be relocked before VOP_OPEN() is called
Handle it in fifo_close by checking for v_fifoinfo == NULL

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31310
2021-07-27 19:58:47 +03:00
Konstantin Belousov
4f21442e10 null_lookup: restore dvp lock always, not only on success
Caller of VOP_LOOKUP() passes dvp locked and expect it locked on return.
Relock of lower vnode in any case could leave upper vnode reclaimed and
unlocked.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31310
2021-07-27 19:58:47 +03:00
Konstantin Belousov
d5b078163e null_bypass(): prevent loosing the only reference to the lower vnode
The upper vnode reference to the lower vnode is the only reference that
keeps our pointer to the lower vnode alive. If lower vnode is relocked
during the VOP call, upper vnode might become unlocked and reclaimed,
which invalidates our reference.

Add a transient vhold around VOP call.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31310
2021-07-27 19:58:47 +03:00
Konstantin Belousov
161e9a9736 nullfs: provide custom null_advlock bypass
The advlock VOP takes the vnode unlocked, which makes the normal bypass
function racy.  Same as null_pgcache_read(), nullfs implementation needs
to take interlock and reference lower vnode under it.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31310
2021-07-27 19:58:47 +03:00
Konstantin Belousov
7b7227c4a6 null_bypass(): some style
Reivewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31310
2021-07-27 19:58:47 +03:00
Baptiste Daroussin
dcd882f302 pci_vendors: update to 2021-07-25 2021-07-27 18:56:39 +02:00
Baptiste Daroussin
fe787aa3b2 calendars: fix tabs vs space indentation 2021-07-27 18:55:31 +02:00
Bryan Drewery
a573243370 netdump: Fix leaking debugnet state on errors.
Reviewed by:	cem, markj
Sponsored by:	Dell EMC
Differential Revision: https://reviews.freebsd.org/D31319
2021-07-27 09:06:23 -07:00
Kristof Provost
4e860bd5da pf tests: make killstate:match more robust
Only lists the states relevant to the connection we're killing.
Sometimes there are IPv6 related states (due to the usual IPv6
background traffic of router solicitations, DAD, ...) that causes us to
think we failed to kill the state, which in turn caused the test to fail
intermittently.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-27 15:32:48 +02:00
Bjoern A. Zeeb
ea4dea8394 LinuxKPI: add sign_extend32()
Add sign_extend32() replicating the 64 version.  This is needed by
the rtw88 driver.

MFC after:	10 days
Reviewed by:	imp, emaste, hselasky
Differential Revision: https://reviews.freebsd.org/D30979
2021-07-27 15:03:38 +00:00
Bjoern A. Zeeb
b9d984e2c5 LinuxKPI: add nexthdr definitions for IPv6
Add the nexthdr definitions for IPv6 which are used by wireless
drivers and were previously placed in an 80211 header file by
accident.

Obtained from:	bz_iwlwifi
Sponsored by:	The FreeBSD Foundation
Reviewed by:	hselasky
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D31321
2021-07-27 15:00:21 +00:00
Bjoern A. Zeeb
366d68f283 LinuxKPI: add module_pci_driver() and pci_alloc_irq_vectors()
Add the two new functions needed by rtw88 to register the driver and
handle the module bits as well as a version of pci_alloc_irq_vectors()
for what is needed.

Reviewed by:	hselasky
MFC after:	10 days
Differential Revision: https://reviews.freebsd.org/D30981
2021-07-27 14:57:23 +00:00
Edward Tomasz Napierala
30c6d98219 linux: implement sigaltstack(2) on arm64
... by making it machine-independent.

Reviewed By:	dchagin
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D31286
2021-07-27 13:34:49 +00:00
Konstantin Belousov
85ae35ef37 /dev/pci: clarify meaning of writeable file descriptor
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31317
2021-07-27 12:13:43 +03:00
Warner Losh
4783fb730f Revert "loader: support.4th resets the read buffer incorrectly"
This reverts commit 9c1c02093b. It seems
to have broken all old nextboot.conf files causing hangs on boot.

Sponsored by:		Netflix
2021-07-26 16:40:41 -06:00
Kristof Provost
3e87f800f0 net tests: basic test case for bpf(4)'s ability to set vlan pcp
Use dhclient with its 'vlan-pcp' option to set a VLAN PCP value and
verify that it actually gets set.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31276
2021-07-26 23:13:31 +02:00
Kristof Provost
9ef8cd0b79 vlan: deduplicate bpf_setpcp() and pf_ieee8021q_setpcp()
These two fuctions were identical, so move them into the common
vlan_set_pcp() function, exposed in the if_vlan_var.h header.

Reviewed by:	donner
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31275
2021-07-26 23:13:31 +02:00
Luiz Otavio O Souza
1e7fe2fbb9 bpf: Add an ioctl to set the VLAN Priority on packets sent by bpf
This allows the use of VLAN PCP in dhclient, which is required for
certain ISPs (such as Orange.fr).

Reviewed by:	bcr (man page)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31263
2021-07-26 23:13:31 +02:00
Kristof Provost
4b765ab4cd bridge tests: test linking bridges with a gif tunnel
Fairly basic test case for using gif(4)'s ability to tunnel Ethernet
traffic between bridges.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-26 23:13:31 +02:00
John Baldwin
be79f30d6c m_dup: Handle unmapped mbufs as an input mbuf.
Use m_copydata() instead of a direct bcopy() when copying data out of
a source mbuf into a newly-allocated mbuf.

PR:	      256610
Reported by:  Niels Bakker <niels=freebsd@bakker.net>
Reviewed by:  markj
MFC after:    2 weeks
2021-07-26 14:09:16 -07:00
Mark Johnston
d8787d4f78 crypto: Constify all transform descriptors
No functional change intended.

Reviewed by:	ae, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31196
2021-07-26 16:41:05 -04:00
Mark Johnston
45cd18ec73 libvmmapi: Fix warnings and stop overridding WARNS
- Avoid shadowing the global optarg.
- Sprinkle __unused.
- Cast nitems() to int.
- Fix sign in vm_copy_setup().

Reviewed by:	grehan
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31306
2021-07-26 16:40:16 -04:00
Mark Johnston
ba21825202 rip: Add missing minimum length validation in rip_output()
If the socket is configured such that the sender is expected to supply
the IP header, then we need to verify that it actually did so.

Reported by:	syzkaller+KMSAN
Reviewed by:	donner
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31302
2021-07-26 16:39:37 -04:00
Bryan Drewery
accff08c2f dumpon: Fix unconfiguring netdump with "off" and "/dev/null".
Netdump has its own configuration tracking such that
ioctl(/dev/null, DIOCSKERNELDUMP) does a dumper_remove() but does not
notify netdump about the removal. Simply sending the same ioctl to
/dev/netdump handles the situation.

Reviewed by:	markj, cem
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D31300
2021-07-26 13:08:59 -07:00
Bryan Drewery
372557d8c3 dumpon: Fix -v causing error when configuring an encrypted dump
If -v is specified when adding a new device then a full listing of
configured devices is displayed.  This requires sysctl access which
genkey()'s use of capability mode was blocking permission to access.
This leads to both confusing console spam but also incorrectly returning
an error status even if no other had been encountered.

	dumpon: Sysctl get 'kern.shutdown.dumpdevname': Operation not permitted

Fix this by generating the key in a child process.

Reviewed by:	markj
Sponsored by:	Dell EMC
Differential Revision: https://reviews.freebsd.org/D31266
2021-07-26 13:08:59 -07:00
Dmitry Chagin
b0fa09a0a7 linux(4): Fix amd64 gcc build.
Do not specify memory model and mregparm for amd64, it's only
available on IA-32 architecture.

Reported by:		jhb, jrtc27
MFC after:		2 weeks
2021-07-26 22:28:21 +03:00
Dmitry Chagin
de273c83a1 linux(4): Fix i386 gcc build.
Do not specify memory model for i386. Seems that clang silencly
ignores -mcmodel unlike gcc.

Reported by:		jhb
MFC after:		2 weeks
2021-07-26 21:28:16 +03:00
Ed Maste
a077a4e3b4 Cirrus-CI: report pkg version
PR:		257422
2021-07-26 14:17:59 -04:00
Leandro Lupori
0f47f91681 hwpmc: fix powerpc/powerpcspe builds
Fix 32-bit PowerPC build errors introduced by b48a2770d4.
2021-07-26 13:29:42 -03:00
Ed Maste
2bfba2a04b Cirrus-CI: Temporarily skip package build + test
The PKG_FORMAT=tar used by Cirrus CI's pkgbase build is failing after
6cafdee71d ("pkgbase: Track pkg 1.17").  Skip package build and test
in Cirrus-CI until new pkg is available.

PR:		257422
Sponsored by:	The FreeBSD Foundation
2021-07-26 10:36:39 -04:00
Leandro Lupori
b48a2770d4 powerpc64: add Power8 and Power9 PMCs
Add support to allocate Power8 and 9 PMCs.

Submitted by:		Leonardo Bianconi <leonardo.bianconi@eldorado.org.br>
Reviewed by:		mhorne
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D31109
2021-07-26 10:27:23 -03:00
Kristof Provost
d2dc4548eb pf: remove duplicate ERROUT_FUNCTION definition
Sponsored by:	Modirum MDPay
2021-07-26 12:31:10 +02:00
Edward Tomasz Napierala
b54838003c linux: fix sigaltstack on amd64
To determine whether to use alternate signal stack or not,
we need to use the native signal number, not the one translated
with bsd_to_linux_signal().

In practical terms, this fixes golang.

Reviewed By:	dchagin
Fixes:		135dd0cab5
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D31298
2021-07-26 11:57:52 +01:00
Edward Tomasz Napierala
ccc510b463 linux: implement signal delivery on arm64
Note that this still uses FreeBSD-style sigframe;
this will be addressed later.

Reviewed By:	dchagin
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D31258
2021-07-25 06:22:57 +00:00
Jilles Tjoelker
0c47338023 libc/tests: Correctly compare si_status from wait6()
Fix erroneous = that was meant to be ==.

Revision 1.10 from NetBSD t_wait.c

Obtained from:	NetBSD
2021-07-25 22:19:18 +02:00
Gleb Popov
feac06569a lib/csu: Get rid of unused fptr typedef on amd64.
Make i386 and riscv parts not use it.

Approved by: kib

Differential Revision: https://reviews.freebsd.org/D31281
2021-07-25 13:51:09 +03:00
Peter Grehan
bbe80bff7c arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries.
This fixes build/run of golang under COMPAT32 emulation.

PR:	256897
Reviewed by:	andrew, mmel, manu, jhb, cognet, Robert Clausecker
Tested by:	brd, andrew, Robert Clausecker
MFC after:	3 weeks
Relnotes:	yes
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31175
2021-07-25 19:39:32 +10:00
Mateusz Guzik
87c010e6e3 pf: batch critical section for several counters
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:17 +02:00
Mateusz Guzik
02cf67ccf6 pf: switch rule counters to pf_counter_u64
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:17 +02:00
Mateusz Guzik
d40d4b3ed7 pf: switch kif counters to pf_counter_u64
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:17 +02:00
Mateusz Guzik
fc4c42ce0b pf: switch pf_status.fcounters to pf_counter_u64
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:16 +02:00
Mateusz Guzik
defdcdd564 pf: add hybrid 32- an 64- bit counters
Numerous counters got migrated from straight uint64_t to the counter(9)
API. Unfortunately the implementation comes with a significiant
performance hit on some platforms and cannot be easily fixed.

Work around the problem by implementing a pf-specific variant.

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:16 +02:00
Mateusz Guzik
6f1fb65612 pf: drop redundant 'else' in pf_normalize_*
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-25 10:22:16 +02:00