Commit Graph

247867 Commits

Author SHA1 Message Date
Mateusz Guzik
6698e11f4b vfs: remove the now empty vop_unlock_post 2020-02-02 09:36:32 +00:00
Mateusz Guzik
10a15df653 vfs: remove the never set VDESC_VPP_WILLRELE flag 2020-02-02 09:35:48 +00:00
Warner Losh
bb9c7e2658 Move font.h generation to conf/files from conf/files.*
Use ${SRCTOP} instead of /usr/share.
Prefer to depend on option sc_dflt_fnt instead of sc.
gc the 4 otherwise identical instances in the tree.
Platforms that don't need this won't included it.
2020-02-02 08:27:26 +00:00
Warner Losh
e17b7f1a03 Fix old-style build
Fix the old-style build by using ${SRCTOP} instead of a weird
construct that only works for new-style build.
Simplify the building of keymap files by using macros
Move atkbdmap.h in files.x86
This has been broken since r296899 which removed the implicit
dependency on /usr/share.
2020-02-02 08:27:20 +00:00
Warner Losh
c312e0f43b Kill old armv4 busdma
Move to having one busdma option for arm: the armv6/v7 one.
Kill now-unused option ARM_USE_V6_BUSDMA too.
Fixup files.arm to match rename.
2020-02-02 08:27:14 +00:00
Warner Losh
6b29cf3343 Move arm back to having one LINT
Now that armv5 is gone, we no longer need multiple LINT files. Kill
the odd-ball support here. From now on, we just have LINT built from
notes like all the other platforms. Keep the removal of LINT-V5/7
to remove stale files for a while still..
2020-02-02 08:27:08 +00:00
Warner Losh
bf19e5b9ee Remove old boardid/mach-types support.
This has been long obsolete in linux and now that all armv4/5 support
is gone, it can be retired too.
2020-02-02 06:52:10 +00:00
Warner Losh
ff9efce0ba Remove armv5 marvell support.
Per plans to remove armv5 support, remove the armv5 marvell discovery,
kirkwood and orion families.
2020-02-02 06:52:04 +00:00
Warner Losh
20d4864396 Remove Ralink RT1310 support
This armv5 SoC is being removed consistent with the removal of
armv5 support, per discussions in arm@ mailing list.
2020-02-02 06:51:42 +00:00
Warner Losh
51691e26d0 Remove vpo.4
The Parallel Port SCSI adapter was interesting for 100MB ZIP drives, but is no
longer used or maintained. Remove it from the tree.

The Parallel Port microsequencer (microseq.9) is now mostly unused in the tree,
but remains. PPI still refrences it, but doesn't use its full functionality.

Relnotes: Yes
Reviewed by: rgrimes@, Ihor Antonov
Discussed on: arch@
Differential Revision:  https://reviews.freebsd.org/D23389
2020-02-02 04:53:27 +00:00
Warner Losh
5a622926ea Add deprecation notice to vpo.4
This driver has seen no real changes for almost 20 years. It's for
hardware that's 25 years old. It has no reports of active use, nor
has it been seen in the NYCBug dmesg database at all. Schedule
its removal for 13.0.

Reviewed by: rgrimes@ (earlier version)
Relnote: Yes
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D23403
2020-02-02 04:52:28 +00:00
Jeff Roberson
f96d4157a7 Fix a bug in r356776 where the page allocator was not properly restored to
the percpu page allocator after it had been temporarily overridden by
startup_alloc.

Reported by:	pho, bdragon
2020-02-01 23:46:30 +00:00
Konstantin Belousov
680ea3bf7b Fix build.
Sponsored by:	The FreeBSD Foundation
2020-02-01 23:16:30 +00:00
Doug Moore
5a9447a324 In dmar_gas_lowermatch, skip searching a subtree if all its addresses are greater than lowaddr.
In dmar_gas_uppermatch, skip searching a subtree if all its gaps-between-alloctions are too small.

Reviewed by:	kib
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D23391
2020-02-01 21:47:34 +00:00
Dimitry Andric
5cc422a222 Amend r357367 by using register values from the TPM datasheet.
As Ian Lepore noted, writing ~1 to a register might have a completely
different effect than doing a regular read-modify-write operation.

Follow the TCG_PC_Client_Platform_TPM_Profile_PTP_2.0_r1.03_v22
datasheet instead, and use the actual values mentioned there:
(uint32_t)1 to cancel the command, (uint32_t)0 to clear the field.

MFC after:	3 days
2020-02-01 21:43:45 +00:00
Mateusz Guzik
7739d92766 cache: replace kern___getcwd with vn_getcwd
The previous routine was resulting in extra data copies most notably in
linux_getcwd.
2020-02-01 20:38:38 +00:00
Conrad Meyer
6a0086dd4d tpm(4): Fix 'go ready' in TPM 2.0 TIS driver
tpmtis_go_ready() read the value of the TPM_STS register, ORed
TPM_STS_CMD_READY with it, and wrote it back.  However, the TPM Profile
(PTP) specification states that only one bit in the write request value may
be set to 1, or else the entire write request is ignored.

Fix by just writing TPM_STS_CMD_READY.

Similarly, remove the call which clears the TPM_STS_CMD_READY flag in the
same function.  It was being ignored for the same reason.

Submitted by:	Darrick Lew <darrick.freebsd AT gmail.com>
Reviewed by:	vangyzen, myself
MFC after:	if you care about stable, you might want to do so
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D23081
2020-02-01 20:38:22 +00:00
Mateusz Guzik
921e7210f8 cache: return the total length from vn_fullpath1
This removes strlen from getcwd.
2020-02-01 20:37:11 +00:00
Mateusz Guzik
4511dd9d41 cache: remove vnode -> path lookup disablement
It seems to be of little to no use even when debugging.

Interested parties can resurrect it and gate compilation with a macro.
2020-02-01 20:36:35 +00:00
Mateusz Guzik
45757984f8 vfs: consistently use size_t for buflen around VOP_VPTOCNP 2020-02-01 20:34:43 +00:00
Conrad Meyer
672e12255d rand(3): Replace implementation with one backed by random(3) algorithm
rand(3)'s standard C API is extremely limiting, but we can do better
than the historical 32-bit state Park-Miller LCG we've shipped since
2001: r73156.

The justification provided at the time for not using random(3) was that
rand_r(3) could not be made to use the same algorithm.  That is still
true.  However, the irrelevance of rand_r(3) is increasingly obvious.
Since that time, POSIX has marked the interface obsolescent.  rand_r(3)
never became part of the standard C library.  If not for API
compatibility reasons, I would just remove rand_r(3) entirely.

So, I do not believe it is a problem for rand_r(3) and rand(3) to
diverge.

The 12 ABI is maintained with compatibility definitions, but this
revision does subtly change the API of rand(3).  The sequences of
pseudorandom numbers produced in programs built against new versions of
libc will differ from programs built against prior versions of libc.

Reviewed by:	kevans, markm
MFC after:	no
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D23290
2020-02-01 20:33:23 +00:00
Conrad Meyer
e656fa70dc hwpstate_intel(4): Save admin-set EPP/EPB and restore after suspend 2020-02-01 20:12:02 +00:00
Conrad Meyer
c93eb470b4 hwpstate_intel(4): Print failure message only on failure
X-MFC-With: r357379
2020-02-01 20:11:25 +00:00
Conrad Meyer
cd4e43b27d hwpstate_intel(4): Detect and support PKG variant
If package-level control is present, we default to using it.  Per-core
software control may be enabled by setting the machdep.hwpstate_pkg_ctrl
tunable to "0" in loader.conf(5).
2020-02-01 19:50:10 +00:00
Conrad Meyer
556a1a0bc6 hwpstate_intel(4): Add fallback EPP using PERF_BIAS MSR
Per Intel SDM (Vol 3b Part 2), if HWP indicates EPP (energy-performance
preference) is not supported, the hardware instead uses the ENERGY_PERF_BIAS
MSR.  In the epp sysctl handler, fall back to that MSR if HWP does not
support EPP and CPUID indicates the ENERGY_PERF_BIAS MSR is supported.
2020-02-01 19:49:13 +00:00
Conrad Meyer
5e3574c8cd x86: Add/amend some power-management comments/macros
No functional change.
2020-02-01 19:46:02 +00:00
Conrad Meyer
b80d476c3c hwpstate_intel(4): Error check epp sysctl & bail if HW does not support feature 2020-02-01 19:45:27 +00:00
Kristof Provost
50214f86c5 tests: epair: Don't fail if we load if_epair
kldload() returns a positive integer when it loads a ko, so check that the
return value is -1 to detect error cases, not that it's different from zero.

MFC after:	3 days
X-MFC-With:	r357234
2020-02-01 19:40:11 +00:00
Mark Johnston
f0a273c00f Remove a couple of lingering usages of the page lock.
Update vm_page_scan_contig() and vm_page_reclaim_run() to stop using
vm_page_change_lock().  It has no use after r356157.  Remove
vm_page_change_lock() now that it has no users.

Remove an unncessary check for wirings in vm_page_scan_contig(), which
was previously checking twice.  The check is racy until
vm_page_reclaim_run() ensures that the page is unmapped, so one check is
sufficient.

Reviewed by:	jeff, kib (previous versions)
Tested by:	pho (previous version)
Differential Revision:	https://reviews.freebsd.org/D23279
2020-02-01 18:23:51 +00:00
Conrad Meyer
f591c3c847 intel_hwpstate(4): Use identcpu-cached cpuid 6 leaf
No functional change.
2020-02-01 17:54:46 +00:00
Conrad Meyer
351896d372 intel_hwpstate(4): Don't leak bound thread in error conditions
I don't know why a Skylake CPU with the HWP feature bit present would trap
on MSR reads of the HWP registers, but if this occurs, do not leave the
attach thread bound.  This could conceivably cause reported hangs, although
I have no evidence that this is the cause.

Reported by:	ae@, Andreas Nilsson <andrnils AT gmail.com>
X-MFC-With:	r357002
2020-02-01 17:30:45 +00:00
Mitchell Horne
9e483eadd4 prci: register tlclk as a fixed clock
The PRCI exports tlclk as a constant fixed divisor clock, defined as 1/2
of the coreclk frequency. In older FU540 device trees (such as the one
provided by SiFive), tlclk is represented as its own entity, and is
automatically registered as a fixed-divisor-clock. Unfortunately the
upstream FU540 device tree (that we have in our tree) represents tlclk
as an output of the PRCI block, and we must register it manually. At
worst, users of the old device tree will end up with an unreferenced
duplicate of tlclk.

This fixes device attachment for the SiFive UART on newer device trees,
since it references tlclk via the PRCI.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D23406
2020-02-01 17:13:52 +00:00
Mitchell Horne
adec0ce785 prci: fix up compat
Add two additional compat strings that can be used to identify the PRCI.

With newer device trees the PRCI has two parents, hfclk and rtcclk, so
allow the driver to attach when more than one parent is found.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D23405
2020-02-01 17:12:15 +00:00
Mitchell Horne
f6029f2bc9 prci: register the DDR and GEMGX PLLs
The PRCI module exports three PLLs. Currently only the coreclk/corepll
is registered, so add the logic to register the DDR (memory) and GEMGX
(ethernet) clocks as well. These clocks are unused at the moment.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D23404
2020-02-01 17:09:56 +00:00
Dimitry Andric
13ae20a8a1 Fix new clang 10.0.0 warnings about converting the result of shift
operations to a boolean in tpm(4):

  sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context]
	  WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD);
					^
  sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD'
  #define TPM_CRB_CTRL_CANCEL_CMD         BIT(0)
					  ^
  sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT'
  #define BIT(x) (1 << (x))
		    ^

In this case, the intent was to clear the zeroth bit, and leave the rest
unaffected.  Therefore, the ~ operator should be used instead.

Noticed by:	cem
MFC after:	3 days
2020-02-01 17:02:26 +00:00
Dimitry Andric
f6d5b31f8b Revert r357349, since the clang 10.0.0 warning was actually correct, and
the ! operator should have been a ~ instead:

  Merge r357348 from the clang 10.0.0 import branch:

  Disable new clang 10.0.0 warnings about converting the result of
  shift operations to a boolean in tpm(4):

  sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context]
	  WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD);
					^
  sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD'
  #define TPM_CRB_CTRL_CANCEL_CMD         BIT(0)
					  ^
  sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT'
  #define BIT(x) (1 << (x))
		    ^

  Such warnings can be useful in C++ contexts, but not so much in kernel
  drivers, where this type of bit twiddling is commonplace.  So disable
  it for this case.

Noticed by:	cem
MFC after:	3 days
2020-02-01 16:57:04 +00:00
Kristof Provost
7bde621ba3 tests: epair: Don't fail if the if_epair module is already loaded
kldload() returns an error (EEXIST) if the module is already loaded.
That's not a problem for us, so ignore that error.

While here also clean up include statements.

MFC after:	3 days
X-MFC-With:	r357234
2020-02-01 11:31:45 +00:00
Mateusz Piotrowski
dcac254a3a bridge.4: Remove notes about FreeBSD 6.2-7.2
Reported by:	Mateusz Kwiatkowski
Reviewed by:	brueffer
Approved by:	bcr (mentor)
Differential Revision:	 https://reviews.freebsd.org/D23393
2020-02-01 10:25:13 +00:00
Pawel Jakub Dawidek
76b47dfb8f The error variable is not really needed. Remove it. 2020-02-01 10:15:23 +00:00
Pawel Jakub Dawidek
d731a314d3 Restore previous usage presentation (without "pwait: " prefix).
Pointed out by:	jilles
2020-02-01 09:13:11 +00:00
Mateusz Guzik
643656cfaf vfs: replace VOP_MARKATIME with VOP_MMAPPED
The routine is only provided by ufs and is only used on mmap and exec.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23422
2020-02-01 06:46:55 +00:00
Mateusz Guzik
0a09292188 ufs: drop ufs_markatime from ufs_fifoops
The routine is only called on mmap and exec, both of which are invalid for
this type.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23421
2020-02-01 06:41:44 +00:00
Mateusz Guzik
90f4ec3328 vfs: save on atomics on the root vnode for absolute lookups
There are 2 back-to-back atomics on the vnode, but we can check upfront if one
is sufficient. Similarly we can handle relative lookups where current working
directory == root directory.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23427
2020-02-01 06:40:35 +00:00
Mateusz Guzik
21c4f1041e vfs: add vrefactn
Differential Revision:	https://reviews.freebsd.org/D23427
2020-02-01 06:39:49 +00:00
Mateusz Guzik
f0c402e425 zfs: ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED -> ZFS_TEARDOWN_INACTIVE_WLOCKED
Fix up the argument used in one case as well.
2020-02-01 06:39:10 +00:00
Kristof Provost
eb03a44325 vlan: Fix panic when vnet jail with a vlan interface is destroyed
During vnet cleanup vnet_if_uninit() checks that no more interfaces remain in
the vnet. Any interface borrowed from another vnet is returned by
vnet_if_return(). Other interfaces (i.e. cloned interfaces) should have been
destroyed by their cloner at this point.

The if_vlan VNET_SYSUNINIT had priority SI_ORDER_FIRST, which means it had
equal priority as vnet_if_uninit(). In other words: it was possible for it to
be called *after* vnet_if_uninit(), which would lead to assertion failures.

Set the priority to SI_ORDER_ANY, like other cloners to ensure that vlan
interfaces are destroyed before we enter vnet_if_uninit().

The sys/net/if_vlan test provoked this.
2020-01-31 22:54:44 +00:00
Jeff Roberson
915c367e8e Add two missing fences with comments describing them. These were found by
inspection and after a lengthy discussion with jhb and kib.  They have not
produced test failures.

Don't pointer chase through cpu0's smr.  Use cpu correct smr even when not
in a critical section to reduce the likelihood of false sharing.
2020-01-31 22:21:15 +00:00
Bryan Drewery
82952c4065 make all is needed to generate .depend.*
PR:		241746
X-MFC-With:	r357043
MFC after:	1 week
2020-01-31 21:08:33 +00:00
Konstantin Belousov
4b919d5cdd smrstress: Add 'publishing' fences to operations on smrs_current.
Reported and tested by:	andrew
Reviewed by:	jeff
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D23440
2020-01-31 20:30:50 +00:00
Dimitry Andric
19e5e202c7 Merge r357348 from the clang 10.0.0 import branch:
Disable new clang 10.0.0 warnings about converting the result of shift
operations to a boolean in tpm(4):

sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context]
        WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD);
                                      ^
sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD'
#define TPM_CRB_CTRL_CANCEL_CMD         BIT(0)
                                        ^
sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT'
#define BIT(x) (1 << (x))
                  ^

Such warnings can be useful in C++ contexts, but not so much in kernel
drivers, where this type of bit twiddling is commonplace.  So disable it
for this case.

MFC after:	3 days
2020-01-31 19:36:14 +00:00