Commit Graph

251933 Commits

Author SHA1 Message Date
Andrey V. Elsukov
2403d47744 Fix SIGSEGV in ipfw(8) when NAT64 prefix length is omitted.
Submitted by:	Evgeniy Khramtsov <evgeniy at khramtsov org>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25734
2020-08-05 11:26:49 +00:00
Mateusz Piotrowski
b9615c3c00 Do not describe portsnap(8) as a way to manage /usr/ports 2020-08-05 11:26:14 +00:00
Andrey V. Elsukov
ce8875b6c4 Fix typo.
Submitted by:	Evgeniy Khramtsov <evgeniy at khramtsov org>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25932
2020-08-05 10:27:11 +00:00
Mateusz Guzik
e1b1971c05 cache: don't ignore size passed to nchinittbl 2020-08-05 09:38:02 +00:00
Mateusz Guzik
c36edafbd4 Bump __FreeBSD_version after vaccess() change 2020-08-05 09:27:53 +00:00
Mateusz Guzik
d292b1940c vfs: remove the obsolete privused argument from vaccess
This brings argument count down to 6, which is passable without the
stack on amd64.
2020-08-05 09:27:03 +00:00
Mateusz Guzik
2b86f9d6d0 cache: convert the hash from LIST to SLIST
This reduces struct namecache by sizeof(void *).

Negative side is that we have to find the previous element (if any) when
removing an entry, but since we normally don't expect collisions it should be
fine.

Note this adds cache_get_hash calls which can be eliminated.
2020-08-05 09:25:59 +00:00
Mateusz Guzik
cf8ac0de81 cache: reduce zone alignment to 8 bytes
It used to be sizeof of the given struct to accomodate for 32 bit mips
doing 64 bit loads, but the same can be achieved with requireing just
64 bit alignment.

While here reorder struct namecache so that most commonly used fields
are closer.
2020-08-05 09:24:38 +00:00
Mateusz Guzik
d61ce7ef50 cache: convert ncnegnash into a macro
It is a read-only var with value known at compilation time.
2020-08-05 09:24:00 +00:00
Eugene Grosbein
dca51295b2 bsnmptools: make it print protocol errors to stderr instead of stdout
Reviewed by:		syrinx, bz
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D25911
2020-08-05 09:19:41 +00:00
Andrey V. Elsukov
aaef76e1fd Handle delayed checksums if needed in NAT64.
Upper level protocols defer checksums calculation in hope we have
checksums offloading in a network card. CSUM_DELAY_DATA flag is used
to determine that checksum calculation was deferred. And IP output
routine checks for this flag before pass mbuf to lower layer. Forwarded
packets have not this flag.

NAT64 uses checksums adjustment when it translates IP headers.
In most cases NAT64 is used for forwarded packets, but in case when it
handles locally originated packets we need to finish checksum calculation
that was deferred to correctly adjust it.

Add check for presence of CSUM_DELAY_DATA flag and finish checksum
calculation before adjustment.

Reported and tested by:	Evgeniy Khramtsov <evgeniy at khramtsov org>
MFC after:	1 week
2020-08-05 09:16:35 +00:00
Emmanuel Vadot
738fc84a7a allwinner: clk: Fix nm clock calculation
Use the right factor when finding the best frequency and compare the
absolute value of the result.

Submitted by:	kibab
MFC after:	3 days
2020-08-05 08:31:26 +00:00
Mateusz Guzik
18f67bc413 vfs: add a cheaper entry for mac_vnode_check_access 2020-08-05 07:34:45 +00:00
Mateusz Guzik
158ab70c24 vfs: tidy up namei entry point
- predict for string copy errors
- reshuffle inititalistion of vars which are not needed
2020-08-05 07:33:39 +00:00
Mateusz Guzik
2840f07d4f cache: cleanup lockless entry point
- remove spurious bzero
- assert ni_lcf, it has to be set by namei by this point
2020-08-05 07:32:26 +00:00
Mateusz Guzik
8ccf01e0e2 cache: stop messing with cn_lkflags
See r363882.
2020-08-05 07:30:57 +00:00
Mateusz Guzik
27c4618df5 cache: stop messing with cn_flags
This removes flag setting/unsetting carried over from regular lookup.
Flags still get for compatibility when falling back.

Note .. and . handling can get partially folded together.
2020-08-05 07:30:17 +00:00
Mateusz Guzik
9c9f7b7c95 vfs: prefill nameidata with garbage on debug kernels 2020-08-05 07:28:51 +00:00
Li-Wen Hsu
096761378c Appease gcc's -Wparentheses (and -Werror)
Sponsored by:	The FreeBSD Foundation
2020-08-05 05:58:25 +00:00
Mateusz Guzik
e5e10c82ec ufs: only pass LK_ADAPTIVE if LK_NODDLKTREAT is set
This restores the pre-adaptive spinning state for SU which livelocks
otherwise. Note this is a bug in SU.

Reported by:	pho
2020-08-04 23:09:15 +00:00
Mateusz Guzik
db99ec5656 vfs: support lockless dotdot lookup
Tested by:	pho
2020-08-04 23:07:42 +00:00
Mateusz Guzik
b403aa126e cache: add NCF_WIP flag
This allows making half-constructed entries visible to the lockless lookup,
which now can check for either "not yet fully constructed" and "no longer valid"
state.

This will be used for .. lookup.
2020-08-04 23:07:00 +00:00
Mateusz Guzik
6e10434c02 cache: add cache_purge_vgone
cache_purge locklessly checks whether the vnode at hand has any namecache
entries. This can race with a concurrent purge which managed to remove
the last entry, but may not be done touching the vnode.

Make sure we observe the relevant vnode lock as not taken before proceeding
with vgone.

Paired with the fact that doomed vnodes cannnot receive entries this restores
the invariant that there are no namecache-related writing users past cache_purge
in vgone.

Reported by:	pho
2020-08-04 23:04:29 +00:00
Mateusz Guzik
bd66a0750f mtx: add mtx_wait_unlocked 2020-08-04 23:00:00 +00:00
Ilya Bakulin
9ea7265066 Minor cleanups in mmc_xpt.c
* Downgrade some CAM debug messages from _INFO to _DEBUG level;
 * Add KASSERT for the case when we suspect incorrect CAM SIM initialization (using cam_sim_alloc() instead of cam_sim_alloc_dev());
 * Use waiting version of xpt_alloc_ccb(), we are not in hurry;
 * With the waiting version we cannot get NULL return, so remove the NULL check;
 * In some csses, the name of mmcprobe_done has been written as mmc_probedone();
 * Send AC_LOST_DEVICE if we, well, lost the device;
 * Misc style(9) fixes.

Reviewed by:	manu
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D25843
2020-08-04 21:58:43 +00:00
Kyle Evans
0bc1c0786b makesyscalls.lua: improve syscall ordering validation
There were two separate issues here:

1.) #if/#else wasn't taken into account at all for maxsyscall figures, but
2.) We didn't validate contiguous syscall numbers anyways...

This kind of inconsistency is bad as we don't currently ensure explicit
indexing of, e.g., the sysent array if one syscall is unimplemented/missing.
This could be fixed and might be more robust, but it's also good to have the
"documentation" that comes from being explicit as to what the missing
syscalls are.

The new version looks much like the awk version; stash off the current
'last highest syscall seen' if we hit an #if, restore to that if we hit an
#else, and make sure that we're explicitly always defining the next syscall.

The logic at the tail end of process_syscall_def that moves maxsyscall has
been 'cleaned up' a little since we're now ensuring that it's monotonically
increasing earlier in the function. At the moment I think it's unlikely we'd
see range-definitions that are not UNIMPL, but there's no reason to
specifically handle that case for bumping maxsyscall there.

This change was provoked by reading the commit message for r363832 and
realizing that this validation hadn't been included in the initial rewrite
to lua.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D25945
2020-08-04 21:49:13 +00:00
Olivier Cochard
784d8d8db0 Skip sbin/route tests if jail not installed (WITHOUT_JAIL).
Approved by:	kp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D25935
2020-08-04 21:34:13 +00:00
Eric van Gyzen
d7e515ff26 devinfo: add man page links
Add man page links for all functions in devinfo(3).

Reported by:	vim
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2020-08-04 21:09:36 +00:00
Eric van Gyzen
32592d86df devinfo: fix memory leak on error paths
Refactor to create devinfo_free_dev().  Call it to plug a memory leak
on two error paths in devinfo_init_devices().

Reported by:	Coverity
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2020-08-04 21:05:53 +00:00
Ruslan Bukin
b64dca2b6f Remove unneeded cast to struct iommu_domain *.
Sponsored by:	DARPA, AFRL
2020-08-04 20:54:12 +00:00
Ruslan Bukin
78b517543b Add a few macroses for conversion between DMAR unit, domain, ctx
and IOMMU unit, domain, ctx.

Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D25926
2020-08-04 20:51:05 +00:00
Mateusz Guzik
8541ae04b4 rms: fix typo: bitmamp -> bitmap
Reported by:	kib
2020-08-04 20:31:03 +00:00
Emmanuel Vadot
f2df51ecc5 mmccam: Hold the periph during init
We need to sleep during this routine so acquire the cam hold too.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D25946
2020-08-04 20:04:00 +00:00
Emmanuel Vadot
cd2f74af6f mmcam: Use a static length sbuf buffer
We cannot sleep during cam proto_announce and sbuf sleeps so use
a static length buffer like nvme(4)

Reviewed by:	kibab
Differential Revision:	https://reviews.freebsd.org/D25949
2020-08-04 20:02:23 +00:00
Emmanuel Vadot
25f965fdaa mmccam: mmc_xpt: We're only interested about losing the device
Remove all the uneeded printfs

Reviewed by:	imp, kibab
Differential Revision:	https://reviews.freebsd.org/D25948
2020-08-04 20:00:21 +00:00
Mateusz Guzik
1164f7a566 cache: factor away failed vexec handling 2020-08-04 19:55:26 +00:00
Mateusz Guzik
0439b00ea8 cache: assorted tidy ups 2020-08-04 19:55:00 +00:00
Mateusz Guzik
18bd02e2ce cache: factor away lockless dot lookup and add missing stat + sdt probe 2020-08-04 19:54:37 +00:00
Mateusz Guzik
17a66c7087 vfs: add vfs_op_thread_enter/exit _crit variants
and employ them in the namecache. Eliminates all spurious checks for preemption.
2020-08-04 19:54:10 +00:00
Mateusz Guzik
0311b05fec cache: add missing numcache detrement on insertion failure 2020-08-04 19:52:52 +00:00
Mateusz Guzik
3211e783e3 rms: add a comment explaining performance deficiencies of write locking 2020-08-04 19:52:16 +00:00
Emmanuel Vadot
d6502e7c67 Import DTS files for arm, arm64, riscv from Linux 5.8
MFC after:	2 months
2020-08-04 19:44:43 +00:00
Alexander Motin
f0f2014387 Remove extra memset() left after r342388.
This memset() wiped MPI2_FUNCTION_SCSI_TASK_MGMT set by mprsas_alloc_tm(),
that broke target reset on device removal, making later re-insertion into
the same slot impossible, since firmware was still waiting for the driver
to finish with the removed device.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2020-08-04 19:27:03 +00:00
Emmanuel Vadot
2554fe8f89 Import DTS from Linux 5.8 2020-08-04 19:05:45 +00:00
John Baldwin
776b260ae2 Disable errors for -Wsystem-headers for GCC on aarch64.
GCC's own arm_neon.h triggers multiple warnings on both GCC 6 and
GCC 9.

Differential Revision:	https://reviews.freebsd.org/D25729
2020-08-04 18:24:46 +00:00
John Baldwin
ec71044958 ld.bfd requires an explicit emulation for MIPS for ld -r.
Unlike lld, ld.bfd doesn't infer the emulation from the first object
file, but assumes its compiled in default for ld -r.

Differential Revision:	https://reviews.freebsd.org/D25728
2020-08-04 18:23:32 +00:00
John Baldwin
0ea6e5109d Disable errors for -Wredundant-decls for GCC 6+.
GCC triggers warnings for this that clang does not for duplicate
declarations of yylex().

Differential Revision:	https://reviews.freebsd.org/D25727
2020-08-04 18:20:39 +00:00
John Baldwin
a02fb76280 Turn off errors for -Wmaybe-uninitialized in GCC 6+.
Recent changes to <sys/tree.h> trigger this warning and seem like a
false positive.

Differential Revision:	https://reviews.freebsd.org/D25726
2020-08-04 18:19:29 +00:00
Emmanuel Vadot
dfb4ecb38b linuxkpi: Add time_after32 and time_before32
This compare two 32 bits times

Sponsored by: The FreeBSD Foundation
Reviewed by:	kib, hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25700
2020-08-04 15:27:32 +00:00
Emmanuel Vadot
334680ab07 linuxkpi: Add clear_bit_unlock
This calls clear_bit and adds a memory barrier.

Sponsored by: The FreeBSD Foundation

Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25943
2020-08-04 15:25:22 +00:00