Commit Graph

230103 Commits

Author SHA1 Message Date
Kyle Evans
ef62584580 stand/lua: Allow MENU_RETURN items to have a func, fix escape to prompt 2018-02-16 22:17:30 +00:00
Alan Somers
4571b2776f zfs: fix formatting in a log statement
Submitted by:	Dave Baukus <daveb@spectralogic.com>
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
2018-02-16 21:59:08 +00:00
Conrad Meyer
9531d560cf trpt(8): Clean up build hack to detect ancient compiler
Detect ancient GCC specifically, rather than using target architecture as a
crude heuristic.

Side note: compilers should really ignore -Wno- and -Wno-error= flags they
don't recognize.  Seems like modern compilers produce warnings instead of
errors.  Though, with -Werror they turn into errors.  Clang's error can be
disabled with -Wno-error=unknown-warning-option, but GCC doesn't seem to
have a named method to disable the specific warning.

Submitted by:	rpokala@ (earlier version)
Suggested by:	rpokala@
Reviewed by:	tinderbox
Sponsored by:	Dell EMC Isilon
2018-02-16 20:46:44 +00:00
Dimitry Andric
954b921d66 Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
6.0.0 (branches/release_60 r325330).

MFC after:	3 months
X-MFC-With:	r327952
PR:		224669
2018-02-16 20:45:32 +00:00
Kyle Evans
574a8bf981 lua-test: Image the loader test directory if it doesn't exist yet 2018-02-16 20:26:18 +00:00
Kyle Evans
ff8409871e Default to /tmp/loadertest for lua test scripts 2018-02-16 20:23:48 +00:00
Dimitry Andric
3c315f3a8e Vendor import of llvm release_60 branch r325330:
https://llvm.org/svn/llvm-project/llvm/branches/release_60@325330
2018-02-16 19:10:15 +00:00
Kyle Evans
5f9d54f4da stand/lua: Use escaped dot instead of single character class 2018-02-16 18:50:06 +00:00
Li-Wen Hsu
ab4a4d40ae Follow r329348 in ipcs for getting rid of the requirement to include SysV IPC
headers with _KERNEL

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D14398
2018-02-16 18:07:04 +00:00
Roger Pau Monné
c2bddfdc51 xen/pv: remove the attach of the ISA bus from the Xen PV bus
There's no need to attach the ISA bus from the Xen PV one.

Sponsored by:           Citrix Systems R&D
2018-02-16 18:04:27 +00:00
Olivier Houchard
a72c9dc53f Define CK_MD_TSO for the relevant arches (i386, amd64 and sparc64).
Defaulting to CK_MD_RMO has the unfortunate side effect of generating
memory barriers that are useless on those arches, and the even more
unfortunate side effect of generating lfence/sfence/mfence on i386, even
if older CPUs don't support it.
This should fix the panic reported when using IPFW on a Pentium 3.
Note that mfence and sfence might still be used in a few case, but that
shouldn't happen in FreeBSD right now, and should be fixed upstream first.

MFC after:	1 week
2018-02-16 17:50:06 +00:00
Kyle Evans
901d96e3fb stand/lua: Chop off the decimal for numbers passed to setcursor
Decimals screw up the escape sequence and the cursor will not get set. Right
now this only affects setting the cursor for drawing "Welcome to FreeBSD" --
the resulting number after our (x+(w/2)-9) calculation gets output as
"14.0."

This should be fixed at the interpreter level, rather than here, but this is
not a widespread problem at the moment so we'll fix it up in further work.

Reported by:	David Wolfskill <david@catwhisker.org>
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D14375
2018-02-16 17:46:07 +00:00
Kyle Evans
1504bce32d stand/lua: Correct usage and acceptance of BACKSPACE/DELETE keys 2018-02-16 17:42:38 +00:00
Alan Somers
dfbc272d5d Handle generic pathconf attributes in the .zfs ctldir
MFC instructions: change the value of _PC_LINK_MAX to INT_MAX

Reported by:	jhb
MFC after:	19 days
X-MFC-With:	329265
Sponsored by:	Spectra Logic Corp
2018-02-16 16:56:09 +00:00
Andrew Turner
e90c2c3638 Put the pine64 root filesystem on teh correct partition.
The Pine64 root filesystem was incorrectly created directly on the MBR
partition. This can cause the loader to get confused when loading the
kernel from this filesystem.

The loader will see this as a small partition meaning later checks to
ensure it doesn't read past the end of the disk incorrectly report a
failure. This seems to work mostly by accident with the released images as
they are smaller than the reported size, however after growfs has run the
image may no longer boot.

Reviewed by:	gjb, emaste, imp
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14343
2018-02-16 16:22:54 +00:00
Hans Petter Selasky
f4824a028d Implement mutex_trylock_recursive() in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
2018-02-16 16:01:39 +00:00
Hans Petter Selasky
10ee3d3016 Implement memdup_user_nul() in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
2018-02-16 15:52:28 +00:00
Hans Petter Selasky
f1f7e04a29 Implement tasklet_enable() and tasklet_disable() in the LinuxKPI.
MFC after:	1 week
Requested by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
2018-02-16 15:41:16 +00:00
Mark Johnston
16759360d4 Fix a memory leak introduced in r328426.
ffs_sbget() may return a superblock buffer even if it fails, so the
caller must be prepared to free it in this case. Moreover, when tasting
alternate superblock locations in a loop, ffs_sbget()'s readfunc
callback must free the previously allocated buffer.

Reported and tested by:	pho
Reviewed by:		kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D14390
2018-02-16 15:41:03 +00:00
Mark Johnston
3f060b60b1 Use the conventional name for an array of pages.
No functional change intended.

Discussed with:	kib
MFC after:	3 days
2018-02-16 15:38:22 +00:00
Ed Maste
b8283138cd Correct module symbol export handling
EXPORT_SYMS can be set to YES, NO, a list of symbols to export from a
module, or to a filename containing such a list.  For the case that it
is set to a symbol list, replace spaces in the list with newlines, so
the created file is in the format expected by kmod_syms.awk.

Reviewed by:	imp, jhb
MFC after:	1 month
Sponsored by:	Turing Robotic Industries Inc.
Differential Revision:	https://reviews.freebsd.org/D14284
2018-02-16 15:38:02 +00:00
Hans Petter Selasky
219ff59ce2 Implement enable_irq() and disable_irq() in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
2018-02-16 15:37:33 +00:00
Hans Petter Selasky
2a7c2b914f Allow the cmpxchg() macro in the LinuxKPI to work on pointers without
generating compiler warnings, -Wint-conversion .

Requested by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
2018-02-16 15:20:21 +00:00
Ed Maste
0ba1b36553 Rationalize license text on Linuxolator files
Many licenses on Linuxolator files contained small variations from the
standard FreeBSD license text.  To avoid license proliferation switch to
the standard 2-clause FreeBSD license for those files where I have
permission from each of the listed copyright holders.  Additional files
waiting on permission from others are listed in review D14210.

Approved by:	kan, marcel, sos, rdivacky
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-02-16 15:00:14 +00:00
Kyle Evans
f35b4e7e97 stand/lua: Remove sneaky kernel assignment 2018-02-16 14:59:11 +00:00
Kyle Evans
a7cf056239 stand/lua: Create/use some MENU_ constants where applicable 2018-02-16 14:57:42 +00:00
Kyle Evans
ada26c4a88 stand/lua: Create a "carousel" menu entry type
This is a pre-cursor to boot environment support in lualoader. Create a new
menu item type, "carousel_entry", that generally provides a callback to get
the list of items, a carousel_id for storing the current value, and the
standard name/func functions that an entry has.

The difference between this and a normal menu item, functionally, is that
selecting a carousel item will automatically rotate through available items
and wrap back at the beginning when the list is exhausted.

The 'name' function takes the choice index, current choice, and the list of
choices as parameters so that the menu item can decorate the name freely as
desired.

The 'func' function takes the current choice as a parameter, so it can act
accordingly.

The kernel menu item has been rewritten to use the carousel_entry type as
both an example and initial test of its functionality before it is used for
boot environment options.
2018-02-16 14:39:41 +00:00
Kyle Evans
ecdc734299 stand/lua: Set ACPI's default the proper way (setACPI) 2018-02-16 13:57:43 +00:00
Konstantin Belousov
13cad9af82 Use local symbol for offset.
Small global symbols confuse ddb which matches them against small
unrelated displacements and makes the disassembly ugly.

Reported by:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-02-16 13:32:46 +00:00
Andriy Gapon
7b394c1066 move vintr_intercept_enabled under INVARIANTS
The function is not used outside of INVARIANTS since r328622.

MFC after:	1 week
2018-02-16 07:02:14 +00:00
Andriy Gapon
c945107d23 read-behind / read-ahead support for zfs_getpages()
ZFS caches blocks it reads in its ARC, so in general the optional
pages are not as useful as with filesystems that read the data
directly into the target pages.  But still the optional pages
are useful to reduce the number of page faults and associated
VM / VFS / ZFS calls.
Another case that gets optimized (as a side effect) is paging in
from a hole.  ZFS DMU does not currently provide a convenient
API to check for a hole.  Instead it creates a temporary zero-filled
block and allows accessing it as if it were a normal data block.
Getting multiple pages one by one from a hole results in repeated
creation and destruction of the temporary block (and an associated
ARC header).

Tested with fsx using various supported blocks sizes from 512 bytes
to 128 KB and additionally 1 MB.

Please note that in illumos and ZoL they do not do the range-locking in
the page-in path. This is because ZFS has a double-caching problem
between ARC and page cache and that requires zfs_read() and zfs_write()
to consult pages in the page cache. So, in those functions they first
lock a range and then lock pages corresponding to the range. While in
the page-in (and maybe page-out) path they first lock the pages and then
would lock the range. So, they would have a deadlock.

I believe that FreeBSD does not have that problem, because the page-in
deals only with invalid pages while zfs_read() and zfs_write() need to
access only valid pages. They do not wait on a busy page unless it's
already valid.

Reviewed by:	kib
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D14263
2018-02-16 06:59:35 +00:00
Mike Silbersack
b761400b51 Prevent savecore from reading bounds from the current directory.
Rev 244218 removed the requirement that you provide a dump
directory when checking if there is a coredump ready to be written.
That had the side-effect of causing the bounds file to be read
from the current working directory instead of the dump directory.
As the bounds file is irrelevant when just checking, the simplest
fix is to not read the bounds file when checking.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D14383
2018-02-16 06:51:39 +00:00
Cy Schubert
a4d179eeb6 Document memset_s(3). memset_s(3) is defined in
C11 standard (ISO/IEC 9899:2011) K.3.7.4.1 The memset_s function
(p: 621-622)

Fix memset(3) portion of the man page by replacing the first argument
(destination) "b" with "dest", which is more descriptive than "b".
This also makes it consistent with the term used in the memset_s()
portion of the man page.

See also http://en.cppreference.com/w/c/string/byte/memset.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D13682
2018-02-16 05:48:45 +00:00
Anish Gupta
0b37d3d90e This change fixes duplicate detection of same IOMMU/AMD-Vi device for Ryzen with EFR support.
IVRS can have entry of type legacy and non-legacy present at same time for same AMD-Vi device. ivhd driver will ignore legacy if new IVHD type is present as specified in AMD-Vi specification. Earlier both of IVHD entries used and two ivhd devices were created.
Add support for new IVHD type 0x11 and 0x40 in ACPI. Create new struct of type acpi_ivrs_hardware_new for these new type of IVHDs. Legacy type 0x10 will continue to use acpi_ivrs_hardware.

Reviewed by:	avg
Approved by:	grehan
Differential Revision:https://reviews.freebsd.org/D13160
2018-02-16 05:17:00 +00:00
Kyle Evans
39006570a4 stand/lua: Remove a magic number/string (not a trivial literal)
We'll arbitrarily use KEYSTR_ for string representations of non-trivial
characters.
2018-02-16 04:59:21 +00:00
Kyle Evans
e908401285 stand/lua: Say "loader prompt" instead of "lua interpreter"
Noting that we're in lualoader is nice, but it's not a difference we raelly
need to expose to Fred. Re-word it to match the 4th wording and reduce
differences.
2018-02-16 04:50:14 +00:00
Kyle Evans
1666dfc03e stand/lua: Remove explicit alias from "Back to main menu"
This removes a redundant alias that has since been converted into a global
alias. It was converted to a global alias before to ensure that we always
have a way to go up one level in the menu.
2018-02-16 04:45:53 +00:00
Kyle Evans
196ba16663 stand/lua: Allow menu items to not have explicit aliases
This will generally be used for cases like "Back to main menu" that already
have global aliases installed.
2018-02-16 04:44:47 +00:00
Kyle Evans
b1b1f2b8fd stand/lua: Move kernel selection into main menu
This matches the corresponding 4th behavior.
2018-02-16 04:31:09 +00:00
Conrad Meyer
648905e629 trpt(8): Work around GCC4 shenanigans
Reduce warns to known good value and do not add -Wno- flag the ancient GCC4
does not understand.

Reported by:	jhibbits
Sponsored by:	Dell EMC Isilon
2018-02-16 04:30:57 +00:00
Devin Teske
492494d92f Add inline to errno.d for translating int to string
Gives DTrace scripts strerror(3) functionality.

Reviewed by:	markj
Sponsored by:	Smule, Inc.
Differential Revision:	https://reviews.freebsd.org/D14386
2018-02-16 04:22:29 +00:00
Kyle Evans
27fac8ff4c stand/lua: Consistently use semicolons for line endings 2018-02-16 04:10:10 +00:00
Kyle Evans
6401094f62 stand/lua: Set reasonable ACPI default based on presence
Set it based on hint.acpi.0.rsdp. Initially, hint.acpi.0.disabled will be
respected. "Using System Defaults" will override whether it's explicitly
disabled by hint and re-load it based on whether it's present on the system.

Unlike the 4th version, this is not restricted to x86. I have no strong
reasoning for this, so this is definitely open to change.
2018-02-16 04:03:15 +00:00
Kyle Evans
6a5a7e8a53 stand/lua: Don't descend into an empty kernels submenu
This submenu is likely going to go away in favor of kernel selection as it
is done in forth at the moment, but for the time being don't descend into it
if we have no kernels available for listing.
2018-02-16 03:14:23 +00:00
Kyle Evans
fe672a15db stand/lua: Reduce magic numbers
Enter/backspace values are hardcoded in both the menu and password scripts.
Separate these out to core for reuse between the two.
2018-02-16 03:12:24 +00:00
Brooks Davis
27b95863a9 Get rid of the requirement to include SysV IPC headers with _KERNEL
defined in ipcrm by introducing _WANT_SYSVxxx_INTERNALS defines.

Reviewed by:	jhb
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14271
2018-02-16 01:33:01 +00:00
Konstantin Belousov
2c64e2664b Note that on amd64 pmap_enter(psind = 1) works (since r321378).
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2018-02-16 01:08:32 +00:00
Conrad Meyer
6f4a47613b rc.conf.5: Flip default background_fsck language to match defaults
Reviewed by:	Daniel O'Connor <darius AT dons.net.au>
Sponsored by:	Dell EMC Isilon
2018-02-16 01:03:08 +00:00
Warner Losh
fcdb1f0317 Eliminate bsd.stand.mk and -fPIC 32-bit intel builds
OK. We don't really need a bsd.stand.mk, and it was causing a -fPIC
for the toolchain to be added (bogusly) when building on amd64. Pull
all relevant defs back into defs.mk and delete bsd.stand.mk.

This saves about 15-20k on i386 loader and zfsloader which when
combined with Lua give us a lot more stack space in those constrained
environments.
2018-02-16 00:17:32 +00:00
Alan Somers
d727d8b0b1 Optimize zfsd for the happy case
If there are no damaged pools, then ignore all GEOM events.  We only use
them to fix damaged pools.  However, still pay attention to ZFS events.

MFC after:	20 days
X-MFC-With:	329284
Sponsored by:	Spectra Logic Corp
2018-02-15 21:30:30 +00:00