Commit Graph

236008 Commits

Author SHA1 Message Date
Marius Strobl
e94a7c27df Following r335259, don't copy boot1 from the running system for sparc64
either.
2018-08-23 22:57:42 +00:00
Allan Jude
aa2a0e0fc3 bsdinstall/zfsboot: Enable new UEFI+GELI support
After r336252 it is no longer necessary to have a separate bootpool when
booting from an encrypted disk with UEFI.

This change also switches the EFI System Partition contents from
the 800 KB boot1.efifat to a new 200 MB filesystem created with newfs_msdos
and uses loader.efi directly, instead of boot1.efi.

PR:		228916
Reviewed by:	dteske
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D12315
2018-08-23 22:50:11 +00:00
Kirk McKusick
a9c2220f5c Proper spelling of consolidation.
Submitted by: Dimitry Andric
2018-08-23 22:35:14 +00:00
Marius Strobl
602a05b0da - Use le32dec(9) for decoding EXT_CSD values where it makes sense. [1]
- Locally cache some instance variable values in mmc_discover_cards()
  in order to improve the code readability a bit.

Obtained from:	NetBSD [1]
2018-08-23 21:26:58 +00:00
Mark Johnston
899fe184c7 Add a per-pagequeue pdpages counter.
Expose these counters under the vm.domain sysctl node.  The existing
vm.stats.vm.v_pdpages sysctl is preserved.

Reviewed by:	alc (previous version)
Differential Revision:	https://reviews.freebsd.org/D14666
2018-08-23 21:03:45 +00:00
Bjoern A. Zeeb
0568fefeea Reduce the log level of tcpd_warn calls from ERR to WARNING.
This matches the name and avoids logging of warnings to console with
default syslog.conf, esp. getting rid of:
  warning: /etc/hosts.allow, line ..: can't verify hostname: \
     getaddrinfo(.., AF_INET) failed
2018-08-23 20:44:26 +00:00
Mark Johnston
99d92d732f Ensure that queue state is cleared when vm_page_dequeue() returns.
Per-page queue state is updated non-atomically, with either the page
lock or the page queue lock held.  When vm_page_dequeue() is called
without the page lock, in rare cases a different thread may be
concurrently dequeuing the page with the pagequeue lock held.  Because
of the non-atomic update, vm_page_dequeue() might return before queue
state is completely updated, which can lead to race conditions.

Restrict the vm_page_dequeue() interface so that it must be called
either with the page lock held or on a free page, and busy wait when
a different thread is concurrently updating queue state, which must
happen in a critical section.

While here, do some related cleanup: inline vm_page_dequeue_locked()
into its only caller and delete a prototype for the unimplemented
vm_page_requeue_locked().  Replace the volatile qualifier for "queue"
added in r333703 with explicit uses of atomic_load_8() where required.

Reported and tested by:	pho
Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D15980
2018-08-23 20:34:22 +00:00
Marius Strobl
608226d559 Obtain the bus mode (MMC or SD) from the directly superordinated
bus rather than reaching up to the bridge and use the cached mode
in mmcsd_delete(), too.
2018-08-23 20:25:27 +00:00
Mark Johnston
84c68e5820 Configure -zifunc-noplt for amd64 kernels.
Per r338251, this ensures that ifunc calls have the same ordinary
function calls.

Reviewed by:	emaste (previous version)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D16750
2018-08-23 19:58:24 +00:00
Michael Tuexen
90ab3571d8 Use arc4rand() instead of read_random() in the SCTP and TCP code.
This was suggested by jmg@.

Reviewed by:		delphij@, jmg@, jtl@
MFC after:		1 month
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D16860
2018-08-23 19:10:45 +00:00
Emmanuel Vadot
4ca213c07a a10_timer: Update the driver so we can use it on other SoC
a10_timer is currently use in UP allwinner SoC (A10 and A13).
Those don't have the generic arm timer.
The arm generic timecounter is broken in the A64 SoC, some attempts have
been made to fix the glitch but users still reported some minor ones.
Since the A64 (and all Allwinner SoC) still have this timer controller, rework
the driver so we can use it in any SoC.
Since it doesn't have the 64 bits counter on all SoC, use one of the
generic 32 bits counter as the timecounter source.

PR:	229644
2018-08-23 18:46:05 +00:00
Emmanuel Vadot
55f3f71ca0 aw_mmc: Handle MMCBR_IVAR_RETUNE_REQ
Without this the mmc stack sometimes think that we are in in a retune
operation and some command like switch the bus width to 4 bits failed.
We now switch correctly to 4 bits mode for sd card.

Reported by:	jmg, others in pine64 irc channel
2018-08-23 18:33:42 +00:00
Alex Richardson
c91575ceec Don't build skein_block_asm.s if we don't have an as binary
This fixes building libmd on MacOS/Linux. The real fix is probably to
build it as a .S file with $CC instead. It might also be better to just
compile the C file in userspace since the compiler can the use SSE/AVX.

Reviewed By:	emaste, brooks
Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16844
2018-08-23 18:19:33 +00:00
Alex Richardson
c97e51679b Only bootstrap localedef if ${MK_LOCALES} != "no"
During the build it is only used by share/ctypedef and share/colldef
which will not be built if ${MK_LOCALE} == "no". This saves a tiny bit
of time when building without locales.

Approved By:	jhb (mentor)
2018-08-23 18:19:21 +00:00
Alex Richardson
a00cd9540d Fix non-FreeBSD host lib32 build for TARGET=amd64
When building on non-FreeBSD systems we need to pass an explicit target
triple to clang otherwise it will attempt to build with the host triple.
This also has advantages when building on a FreeBSD host: we now tell
clang that we are targeting at least FreeBSD 12.0 instead of an older
version so it can enable newer features.

Reviewed By:	brooks (mentor)
Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16842
2018-08-23 18:19:10 +00:00
Alex Richardson
4635180ea7 Allow bootstrapping md5 on Linux, MacOS and FreeBSD < 12
In order to build on a Linux host we need to bootstrap md5 since the Linux
md5sum command produces output in a different format.

Reviewed By:	emaste
Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16846
2018-08-23 18:19:01 +00:00
Alex Richardson
a52fd948a2 Handle -DNO_ROOT for make compat in include/
Otherwise this step will fail on a Linux host due to missing "wheel" group

Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16841
2018-08-23 18:18:52 +00:00
Alex Richardson
101db63b42 Don't use absolute path to sed when building usr.bin/join
This is required to build sort on Linux hosts since sed is in /bin there.

Approved By:	jhb (mentor)
2018-08-23 18:18:43 +00:00
Marius Strobl
6daf59aa79 Remove a duplicated interface capability bit missed in r336313. 2018-08-23 18:11:55 +00:00
Kyle Evans
d7f41421d2 Remove hyper-v leftovers when WITHOUT_HYPERV is set
hv_vss_daemon was missed.

Submitted by:	Oliver Pinter
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D16811
2018-08-23 18:06:31 +00:00
Kyle Evans
13eade284e stand: fdt: Drop some write-only assignments/variables and leaked bits
Generally straightforward enough; a copy of argv[1] was being made in
command_fdt_internal, solely used for a comparison within the
handler-search, then promptly leaked.

Reported by:	ports gcc and clang's static analyzer
2018-08-23 18:01:34 +00:00
Marius Strobl
6dea80e699 - According to section 2.2.5 of the SDHCI specification version 4.20,
SDHCI_TRNS_ACMD12 is to be set only for multiple-block read/write
  commands without data length information, so don't unconditionally
  set this bit. The result matches what e. g. Linux does.
- Section 2.2.19 of the SDHCI specification version 4.20 states that
  SDHCI_ACMD12_ERR should be only valid if SDHCI_INT_ACMD12ERR is set
  and hardware may clear SDHCI_ACMD12_ERR when SDHCI_INT_ACMD12ERR is
  cleared (differing silicon behavior is specifically allowed, though).
  Thus, read SDHCI_ACMD12_ERR before clearing SDHCI_INT_ACMD12ERR.
  While at it, use the 16-bit accessor rather than the 32-bit one for
  reading the 16-bit SDHCI_ACMD12_ERR.
- SDHCI_INT_TUNEERR isn't one of the ROC bits in SDHCI_INT_STATUS so
  clear it explicitly.
- Add missing prototypes and sort them.
2018-08-23 17:50:41 +00:00
Patrick Kelsey
ef9afde438 Fix warning about crossing INT32_MAX boundary in computation of constant value. 2018-08-23 17:41:39 +00:00
Kyle Evans
1ee89ab5dd lualoader: Accept that people use unquoted values in loader.conf
While loader.conf(5) suggests that all values should be quoted, reality is
that this was never strictly enforced and it is used. We already make some
concession to this in number values, which aren't strictly quoted either.

The compromise here is that multi-word values must be quoted. This lets
things like `foo_load=YES` work, while denying more complex expressions on
the right hand side. This likely catches the vast majority of current usage.

A bit of a kludge is needed to accomplish this since Lua regex doesn't
support branching. I had considered splitting up expressions and generating
the right-hand side of the expressions completely in config.parse, but
deemed this too large of an overhaul to take given the current timing. This
should be re-worked shortly after the thaw.

Reported by:	royger
2018-08-23 17:27:02 +00:00
Alan Somers
7dbe228c6a tftp(1): switch default transfer mode to binary
netascii is obsolete and inefficient. It isn't even supported by many
clients. Better to use binary mode by default.

Reviewed by:	cem
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D16869
2018-08-23 17:00:07 +00:00
Bjoern A. Zeeb
20cc39d085 MFp4 bz_ipv6_fast:
Migrate udp6_send() v4mapped code to udp6_output() saving us a re-lock and
further simplifying the address-family handling code by eliminating
AF_INET checks and almost all v4mapped handling right after the start
as cases could actually not happen anymore.

Rework output path locking similar to UDP4 allowing for better
parallelism (see r222488, and later versions).

Sponsored by: The FreeBSD Foundation (2012)
Sponsored by: iXsystems (2012)
Differential Revision:	https://reviews.freebsd.org/D3721
2018-08-23 16:54:22 +00:00
Kristof Provost
903eaa68f1 xen/netfront: Ensure curvnet is set
netfront_backend_changed() is called from the xenwatch_thread(), which means
that the curvnet is not set. We have to set it before we can call things like
arp_ifinit().

PR:		230845
2018-08-23 16:52:52 +00:00
Kyle Evans
0d7bee6a2a lualoader: Fix (add) Xen support
lualoader was not respecting the 'xen_kernel' environment variable, which
hints to the interpreter that it should load a Xen kernel prior to loading
any other kernel that might be specified. If a Xen kernel is specified and
we fail to load it, we should not proceed to boot.

Reported by:	royger
Tested by:	royger
2018-08-23 16:26:03 +00:00
Navdeep Parhar
becda72184 cxgbe(4): Use fcmpset instead of cmpset when appropriate.
Suggested by:	mjg@
MFC after:	1 month
Sponsored by:	Chelsio Communications
2018-08-23 16:24:27 +00:00
Patrick Kelsey
ff7b3f731a Extend tbrsize heuristic in pfctl(8) to provide a sensible value for
higher bandwidth interfaces.  The new value is used above 2.5 Gbps,
which is the highest standard rate that could be used prior to
r338209, so the default behavior for all existing systems should
remain the same.

The value of 128 chosen is a balance between being big enough to
reduce potential precision/quantization effects stemming from frequent
bucket refills over small time intervals and being small enough to
prevent a greedy driver from burst dequeuing more packets than it has
available hardware ring slots for whenever altq transitions from idle
to backlogged.

Reviewed by:	jmallett, kp
MFC after:	2 weeks
Sponsored by:	RG Nets
Differential Revision: https://reviews.freebsd.org/D16852
2018-08-23 16:10:28 +00:00
Mark Johnston
5b27058e96 Remove a redundant #ifdef _KERNEL.
Submitted by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	3 days
2018-08-23 15:01:27 +00:00
Mark Johnston
4023442dc9 Add an lld option to emit PC-relative relocations for ifunc calls.
The current kernel ifunc implementation creates a PLT entry for each
ifunc definition.  ifunc calls therefore consist of a call to the
PLT entry followed by an indirect jump.  The jump target is written
during boot when the kernel linker resolves R_[*]_IRELATIVE relocations.
This implementation is defined by requirements for userland code, where
text relocations are avoided.  This requirement is not present for the
kernel, so the implementation has avoidable overhead (namely, an extra
indirect jump per call).

Address this for now by adding a special option to the static linker
to inhibit PLT creation for ifuncs.  Instead, relocations to ifunc call
sites are passed through to the output file, so the kernel linker can
enumerate such call sites and apply PC-relative relocations directly
to the text section.  Thus the overhead of an ifunc call becomes exactly
the same as that of an ordinary function call.  This option is only for
use by the kernel and will not work for regular programs.

The final form of this optimization is up for debate; for now, this
change is simple and static enough to be acceptable as an interim
solution.

Reviewed by:	emaste
Discussed with:	arichardson, dim
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D16748
2018-08-23 14:58:19 +00:00
Kyle Evans
35437b1f16 efiloader: Setup FDT in autoload to fix overlays clobbering kenv
manu found in the noted PR that overlays seemed to be clobbering the kenv
and killing the boot. Further inspection revealed that one can `fdt ls` at
the loader prompt for a successful boot, but autoboot breaks it.

In the autoboot case, first setup of FDT is happening in the middle of
bi_load, which triggers loading of the DTBO from /boot.

This is bad, bad, bad. Files in the loader are loaded somewhere in the
middle of the address space one after another. bi_load starts building the
needed kernel bootinfo immediately after the highest-addr loaded file. File
loads in the middle of bi_load suddenly clobber bootinfo and everything goes
off the rails.

The solution to this is to use take advantage of arch_autoload to setup FDT
in efiloader compiled with LOADER_FDT_SUPPORT. This matches how it works in
ubldr land, and is how it should have worked when overlay support was added
to efiloader since fdt_setup_fdtp now has the potential to load files
(courtesy of fdt_platform_load_dtb).

PR:		230804
Discussed with:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D16858
2018-08-23 13:38:38 +00:00
Emmanuel Vadot
668085e884 arm64: GENERIC: Compile allwinner dtbs 2018-08-23 13:25:32 +00:00
Emmanuel Vadot
26b29cd7aa dtb: Allwinner: Add aarch64 dts files 2018-08-23 13:24:28 +00:00
Emmanuel Vadot
81b5157b94 dtb: aarch64 uses vendor subdirectories, handle that 2018-08-23 13:23:54 +00:00
Emmanuel Vadot
5695558451 make_dtb: Always add root directory in the include path
Some arch like arm and arm64 share DTS files, add the root dts directory
to the include paths.
2018-08-23 13:23:21 +00:00
Emmanuel Vadot
c3f6b2cf9f dts: Import DTS for arm64
- Most of the boards are using U-Boot, u-boot embed a DTB that isn't
compiled with -@ (overlay ready) so we cannot use overlays. We want
overlays, overlays are nice.
 - The DTS life is going to linux, then sometimes it's imported in
U-Boot but it depend on the SoC family, U-Boot doesn't batch import
every DTS like we do. So sometimes to U-Boot DTS are very old. Or when
an interesting patch in commited upstream it is in Linux X+2 (roughly 4
months from now), we then have to wait for U-Boot to catch up, that
give us between 4 and 6 months to have an update.
 - Some boards like the Marvell ones have 3 DTS, the one in the
vendor U-Boot made by Marvell themselves, the one in u-boot mainline
and the one in Linux. I found that the DTS in the Marvell U-Boot have
some problem with FreeBSD (especially the macchiatobin that declare
node with the same address but not the same size, that is not something
that the rman code can handle, it could be modified, I don't know the
code well enough). Also some compatible are used when they shouldn't,
for example they declare the gpio being orion-gpio while this binding
requires interrupts supports, which the node doesn't have.
 - The above situation is mostly the same with RockChip SoCs (possibly
others, those are the only SoCs I work on that have this problem).

 Note that importing the DTS doesn't mean that every board will use
them, I don't intend to copy the DTB to the GENERIC memstick image for
the Overdrive 1000/3000 for example, the ones provided by the firmware
works fine.
 RPI3 will still stay an exception as we use the DTB provided by the
rpi-firmware package, so they come from the rpi foundation linux fork.
2018-08-23 13:21:01 +00:00
Renato Botelho
7ae43b318f usr.sbin/ndp: Cleanup in preparation to add libxo support
* Constify rtpref_str declaration
* Remove unused h_errno declaration
* Use time_t type for expire
* Use strlcpy to set static "?" value to ifname
* Rename local variable 's' to stop shadowing global definition
* Close socket used in pfx_flush()
* Use local variables for sock() in setdefif() and getdefif()
* Increase WARNS to 3

Reviewed by:	allanjude, kevans
Approved by:	allanjude
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D11118
2018-08-23 10:38:59 +00:00
Marcelo Araujo
1aa56353ad Add manpage entry for the new bhyve options -s "help" and -l "help".
Reported by:	0mp
Sponsored by:	iXsystems Inc.
2018-08-23 07:34:51 +00:00
Michael Tuexen
4ba1513d1a Don't use the explicit number 32 for the length of the secrets,
use sizeof() or explicit #definesi instead. No functional change.
This was suggested by jmg@.

MFC after:		1 month
XMFC with:		r338053
Sponsored by:		Netflix, Inc.
2018-08-23 06:03:59 +00:00
Warner Losh
2324e9b028 Forgot to bump .Dd in r338233 like I promised in the review. Doh! 2018-08-23 05:08:38 +00:00
Warner Losh
84b9dfe433 Add a special note to UPDATING for the devmatch stuff. While tested,
there's an elevated risk of trouble, and you must update kernel,
userland and rc scripts for the best experience.
2018-08-23 05:06:31 +00:00
Warner Losh
8a317ce4b3 Implement blacklisting for devmatch
devmatch_blacklist is a space separated list of modules (w/o the .ko
or full path) to exclude from devmatch's processing.

Differential Revision: https://reviews.freebsd.org/D16735
2018-08-23 05:06:27 +00:00
Warner Losh
ce1ba01c8a When trying to match the nomatch event passed to us, attempt to look
up the device described by the nomatch event in the device tree. If we
find it, then if the device is marked as have already attached to a
device once, then ignore the device.

This keeps us from reloading the device driver when it has just been
manually unloaded. All devies that have had a driver attach to them at
least once no longer participate in pnp-based autoloading.

Differential Revision: https://reviews.freebsd.org/D16735
2018-08-23 05:06:22 +00:00
Warner Losh
d36967bd2b Add a new device flag: DF_ATTACHED_ONCE
This flag is set once the device has been successfully attached. When
set, it inhibits devmatch from trying to match the device. This in
turn allows kldunload to work as expected. Prior to the change, the
driver would immediately reload because devmatch had no notion that
the driver had once been attached, and therefore shouldn't participate
in further matching.

Differential Revision: https://reviews.freebsd.org/D16735
2018-08-23 05:06:16 +00:00
Warner Losh
84725a5fd0 Remove sorting of matches and print all the matches as we find them.
This backs out the hack we added in r329458. Now that we can freeze /
thaw probing, this is a much better solution to that problem. Revert
to simply printing the results as we find them, and relying on an
external sort | uniq to clean up the list.

Differential Revision: https://reviews.freebsd.org/D16735
2018-08-23 05:06:11 +00:00
Warner Losh
8769858311 Improve devmatch driver loading
Use devctl freeze / thaw to allow us to laod multiple modules before
doing the probe/attach so they all get a bite at the apple.

Differential Revision: https://reviews.freebsd.org/D16735
2018-08-23 05:06:07 +00:00
Warner Losh
5fa2979791 Create devctl freeze/thaw.
This adds it to devctl, libdevctl, defines the two IOCTLs and
implements the kernel bits. causes any new drivers that are added via
kldload to be deferred until a 'thaw' comes in. These do not stack: it
is an error to freeze while frozen, or thaw while thawed.

Differential Revision: https://reviews.freebsd.org/D16735
2018-08-23 05:05:47 +00:00
Kyle Evans
67b60a1b7d dtc(1): Update to 0892ec7; HACKING and implicit header fixes
Fixes courtesy of arichardson and jmg:
- HACKING was pointing to the wrong place
- Added headers were being relied on implicitly, but libstdc++ did not
  comply with the unspoken wishes of dtc.

MFC after:	1 week
2018-08-23 02:26:40 +00:00