Commit Graph

230120 Commits

Author SHA1 Message Date
Kyle Evans
4d290ffb2d stand/lua: Correct test sense, this should have been 'not nil' 2018-02-17 04:46:06 +00:00
Kyle Evans
7104917375 stand/lua: Address some nits
1.) Instead of string.function(s, ...), use s:function(...)
2.) Don't try to concatenate `res`, it was just tested to be nil
3.) Note that "Loading configuration" is configured modules, and be a little
more precise in mentioning what failed ("loading of one or more modules")
2018-02-17 04:43:41 +00:00
Kyle Evans
41e77b5399 stand/lua: Add debug method to dump modules 2018-02-17 04:33:37 +00:00
Kyle Evans
c990f0a990 stand/lua: Correct some trivial errors in config
An empty module_path to start with isn't ideal, but if all modules are
contained within a kernel directory (which is what we just tested) then it
isn't strictly an error. Don't assume that module_path has a value already.

When we fail to load the kernel, printing the result (which is guaranteed to
be nil) is not intended; print the name of the kernel.
2018-02-17 04:22:36 +00:00
Kyle Evans
bcf48a159e stand/lua: Color non-default kernels blue 2018-02-17 04:07:16 +00:00
Kyle Evans
702b460d41 stand/lua: Correct interpretation of autoboot_delay
autoboot_delay=NO is documented to wait for input and *not* autoboot, which
is the exact opposite of the current behavior.

Additionally, autoboot_delay=-1 is documented to disallow the user from
interrupting the boot (i.e. autoboot immediately), which was not previously
honored.

This also fixes the case insensitive comparison to be truly case
insensitive. This is kind of nit-picky, but the previous version would only
accept "no" and "NO".
2018-02-17 03:39:55 +00:00
Kyle Evans
3a0a07d0ea stand/lua: Enable menu autoboot; it seems to work 2018-02-17 03:13:05 +00:00
Kyle Evans
afa61e1c77 stand/lua: Don't set autoboot_delay=NO in menu autoboot sequence
We'll set it later if "Escape to loader prompt" is actually chosen, there's
no need to be setting it here.
2018-02-17 03:12:35 +00:00
Mateusz Guzik
015cd8dc93 On process exit signal the parent after dropping the proctree lock. 2018-02-17 00:24:50 +00:00
Mateusz Guzik
7e588b9219 Unref the prison after proctree is dropped. 2018-02-17 00:23:56 +00:00
Mateusz Guzik
65f29b9caa Postpone sx_sunlock(&proctree_lock) on fork until after allproc is dropped.
There is a significant contention on the lock during -j 128 package build.
This change drops total wait time on this lock by 60%.
2018-02-17 00:23:28 +00:00
Mateusz Guzik
6776bfeb8f Tidy up kern_wait6
- don't relock curproc in msleep
- don't relock proctree if P_STATCHILD is spotted
- reformat the proc_to_reap call in the main loop
2018-02-17 00:21:50 +00:00
Benno Rice
5857eb21be Revert r329269.
I tried to rework a section to fit inside 80 columns but the change ended
up being functional. Back this out so I can readdress.
2018-02-17 00:12:30 +00:00
Kyle Evans
5d1e2f83d0 stand/lua: Make CAROUSEL_ENTRY func parameters consistent with name
We have no need for the index yet, but add it anyways to keep signatures
consistent.
2018-02-16 23:59:50 +00:00
Konstantin Belousov
fc97574bd3 Remove unused symbols.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-02-16 23:18:42 +00:00
Kyle Evans
84f82e468c stand/lua: Don't reload kernel config if we only have one kernel
Don't move this into config.reload because we may want to force reloads if
/boot changes out from under us later.

As a caution: changing kernels in lualoader at the moment might not be
loading all of your modules (in my testing, at least) from loader.conf(5).
This is a known problem.
2018-02-16 22:57:52 +00:00
Kyle Evans
aefcaa7e85 stand/lua: Don't try to divide by 0; do nothing 2018-02-16 22:51:08 +00:00
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