ian [Thu, 25 Dec 2014 17:06:58 +0000 (17:06 +0000)]
For data and instruction prefetch aborts, call the same handler in the C
code, passing a 0/1 flag that indicates which type of abort it was. This
sets the stage for unifying the handling of page faults in a single routine.
Submitted by: Svatopluk Kraus <onwahe@gmail.com>,
Michal Meloun <meloun@miracle.cz
ian [Thu, 25 Dec 2014 16:49:33 +0000 (16:49 +0000)]
Create 'L' variants of all the ENTRY macros for file-static/local symbols.
If it seems like this is getting out of hand, I quite agree. I wonder if
it's safe, here in the 21st century, to lose the distinction between C and
ASM symbols?
ian [Thu, 25 Dec 2014 04:41:43 +0000 (04:41 +0000)]
Remove _PROF_PROLOGUE from the EENTRY() macros. These macros define
'extra' entry points which are nested within or provide a synonym name
for another function. It's most likely not safe to be messing with the
IP and LR registers at anything other than the primary entry point to a
function. Anywhere beyond initial function entry, those registers may
be in use as scratch or variable registers.
ian [Thu, 25 Dec 2014 03:41:56 +0000 (03:41 +0000)]
Change the style of the DO_AST macro to match the others in this file --
semicolons between the code and comments instead of after the comments,
and line continuations in the arbitrary but now consistant column 76.
rmacklem [Thu, 25 Dec 2014 01:55:17 +0000 (01:55 +0000)]
A deadlock in the NFSv4 server with vfs.nfsd.enable_locallocks=1
was reported via email. This was caused by a LOR between the
sleep lock used to serialize the local locking (nfsrv_locklf())
and locking the vnode. I believe this patch fixes the problem
by delaying relocking of the vnode until the sleep lock is
unlocked (nfsrv_unlocklf()). To avoid nfsvno_advlock() having the side
effect of unlocking the vnode, unlocking the vnode was moved to before
the functions that call nfsvno_advlock().
It shouldn't affect the execution of the default case where
vfs.nfsd.enable_locallocks=0.
rmacklem [Wed, 24 Dec 2014 22:58:08 +0000 (22:58 +0000)]
Modify vop_stdadvlock{async}() so that it only
locks/unlocks the vnode and does a VOP_GETATTR()
for the SEEK_END case. This is safe to do, since
lf_advlock{async}() only uses the size argument
for the SEEK_END case.
The NFSv4 server needs this when
vfs.nfsd.enable_locallocks!=0 since locking the
vnode results in a LOR that can cause a deadlock
for the nfsd threads.
ian [Wed, 24 Dec 2014 18:54:31 +0000 (18:54 +0000)]
Cleanup up ARM *frame structures...
- Eliminate unused irqframe
- Eliminate unused saframe
- Instead of splitting r4-sp storage between the stack and switchframe,
just put all the registers in switchframe and eliminate the un_32 struct.
Submitted by: Svatopluk Kraus <onwahe@gmail.com>,
Michal Meloun <meloun@miracle.cz>
emaste [Wed, 24 Dec 2014 18:51:25 +0000 (18:51 +0000)]
Build gperf before gcc
The ARM image builds build the in-tree gcc in order to build u-boot
and gperf is needed to build gcc, but is no longer installed on archs
that use clang.
Invoking the make targets as separate steps is done to work around
a build failure which is not yet fully understood.
Reviewed by: gjb, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1317
ae [Wed, 24 Dec 2014 18:34:56 +0000 (18:34 +0000)]
Rename ip4_def_policy variable to def_policy. It is used by both IPv4 and
IPv6. Initialize it only once in def_policy_init(). Remove its
initialization from key_init() and make it static.
Remove several fields from struct secpolicy:
* lock - it isn't so useful having mutex in the structure, but the only
thing we do with it is initialization and destroying.
* state - it has only two values - DEAD and ALIVE. Instead of take a lock
and change the state to DEAD, then take lock again in GC function and
delete policy from the chain - keep in the chain only ALIVE policies.
* scangen - it was used in GC function to protect from sending several
SADB_SPDEXPIRE messages for one SPD entry. Now we don't keep DEAD entries
in the chain and there is no need to have scangen variable.
Use TAILQ to implement SPD entries chain. Use rmlock to protect access
to SPD entries chain. Protect all SP lookup with RLOCK, and use WLOCK
when we are inserting (or removing) SP entry in the chain.
Instead of using pattern "LOCK(); refcnt++; UNLOCK();", use refcount(9)
API to implement refcounting in SPD. Merge code from key_delsp() and
_key_delsp() into _key_freesp(). And use KEY_FREESP() macro in all cases
when we want to release reference or just delete SP entry.
ian [Wed, 24 Dec 2014 03:02:12 +0000 (03:02 +0000)]
Define the old-school arm arch constants we still use internally based on
the somewhat newer constants predefined by the compiler. This will allow
userland apps to use various machine/foo.h headers without CPUTYPE defined.
smh [Wed, 24 Dec 2014 01:50:44 +0000 (01:50 +0000)]
Allow info to display correctly in for varying tabstop settings
The SAMPLE message and notes where tab seperated for some parts and hence
displayed incorrectly unless tabstop was set to 8. Switch to spaces to it
displays correctly independent of the tabstop setting.
adrian [Tue, 23 Dec 2014 18:48:45 +0000 (18:48 +0000)]
Bump the valid GPIO range for rfkill up from 8 to 16.
AR5416 and later NICs have more than 8 (Well, more than 6) GPIO pins.
So to support rfkill on these NICs we need to bump this up or the
rfkill GPIO pin may get reset to the wrong value.
Noticed by: Anthony Jenkins <scoobi_doo@yahoo.com>
ae [Tue, 23 Dec 2014 16:17:37 +0000 (16:17 +0000)]
Remove in_gif.h and in6_gif.h files. They only contain function
declarations used by gif(4). Instead declare these functions in C files.
Also make some variables static.
emaste [Tue, 23 Dec 2014 15:58:45 +0000 (15:58 +0000)]
Use explicit --output-target to set EFI file format
According to objcopy(1) --target is for use where the input and output
formats are the same ("no translation"). In practice it does detect the
input format in any case, but be explicit that we're specifying the
output format as we are translating from ELF to EFI PE format.
markj [Tue, 23 Dec 2014 15:38:19 +0000 (15:38 +0000)]
Restore the trap type argument to the DTrace trap hook, removed in r268600.
It's redundant at the moment since it can be obtained from the trapframe
on the architectures where DTrace is supported, but this won't be the case
with ARM.
rmacklem [Tue, 23 Dec 2014 14:24:36 +0000 (14:24 +0000)]
Fix kernel builds with "options NFS_DEBUG" that
were broken by r276096. Also delete the two
kernel options NFS_GATHERDELAY, NFS_WDELAYHASHSIZ
which are no longer used.
glebius [Tue, 23 Dec 2014 12:26:35 +0000 (12:26 +0000)]
m_clrprotoflags() is designed to cleanup M_PROTO flags when mbufs cross
protocol and facility boundaries. However, now it cleans up only the
first mbuf, while intent clearly means all mbufs in a possible chain.
Differential Revision: https://reviews.freebsd.org/D1352
Reviewed by: rpaulo, gnn, adrian
Sponsored by: Nginx, Inc.
bapt [Tue, 23 Dec 2014 10:43:35 +0000 (10:43 +0000)]
Fix build with recent binutils
Recent binutils considered the .gnu.warning.symbol section as a fatal error when
run with --fatal-warnings which makes any users of "insecure" functions from
libc failing to build with recent binutils.
Introduce a new macro: LD_FATAL_WARNINGS=no to run ld(1) with
--no-fatal-warnings for the users of "insecure" functions
imp [Tue, 23 Dec 2014 05:50:53 +0000 (05:50 +0000)]
Always select the card before we do the 4.x specific stuff and
deselect it after setting the block size. This is a similar bug that
was fixed elsewhere, but not here. This makes sure that we leave the
card deselected at the end of the loop, and we don't send any commands
to the card without it selected.
neel [Tue, 23 Dec 2014 02:14:49 +0000 (02:14 +0000)]
Allow ktr(4) tracing of all guest exceptions via the tunable
"hw.vmm.trace_guest_exceptions". To enable this feature set the tunable
to "1" before loading vmm.ko.
Tracing the guest exceptions can be useful when debugging guest triple faults.
Note that there is a performance impact when exception tracing is enabled
since every exception will now trigger a VM-exit.
Also, handle machine check exceptions that happen during guest execution
by vectoring to the host's machine check handler via "int $18".
rmacklem [Tue, 23 Dec 2014 00:47:46 +0000 (00:47 +0000)]
Remove the old NFS client and server from head,
which means that the NFSCLIENT and NFSSERVER
kernel options will no longer work. This commit
only removes the kernel components. Removal of
unused code in the user utilities will be done
later. This commit does not include an addition
to UPDATING, but that will be committed in a
few minutes.
ian [Mon, 22 Dec 2014 22:07:22 +0000 (22:07 +0000)]
Add a new loader(8) variable, twiddle_divisor, allowing control over the
output frequency of the "twiddle" IO progress indicator. The default
value is 1. For larger values N, the next stage of the animation is only
output on every Nth call to the output routine. A sufficiently large N
effectively disables the animation completely.
cperciva [Mon, 22 Dec 2014 21:52:37 +0000 (21:52 +0000)]
Strip trailing / characters from paths in "not present" index entries, not
just "directory" entries.
Prior to this commit, if / was added as part of a security update (how? In
the most recent case, because lib32 was accidentally omitted and was then
re-added, and every installer distribution set gets its own paths) then
the code which was supposed to filter out updates to deleted parts of the
base system (if someone decides to delete / then we shouldn't re-create it
for them) would instead get confused and decided that while / should exist,
// should not exist and needs to be removed.
This fixes the bug which caused freebsd-update to want to delete / (which is
harmless, since `rm /` fails, but scary nonetheless). A workaround is being
applied to the update bits in order to avoid triggering the bug on unpatched
systems.
ian [Mon, 22 Dec 2014 20:42:36 +0000 (20:42 +0000)]
Add a divisor parameter to twiddle() so that callers can request that output
only happen on every Nth call. Update the existing twiddle() calls done in
various IO loops to roughly reflect the relative IO sizes. That is, tftp
and nfs call twiddle() on every 1K block, ufs on every filesystem block,
so the network calls now use a much larger divisor than disk IO calls.
Also add a new twiddle_divisor() function that allows an application to set
a global divisor that is applied on top of the per-call divisors. Nothing
calls this yet, but loader(8) will be using it to further throttle the
cursor for slow serial consoles.
smh [Mon, 22 Dec 2014 18:39:38 +0000 (18:39 +0000)]
Fix panic when resizing ZFS zvol's
Resizing a ZFS ZVOL with debug enabled would result in a panic due to
recursion on dp_config_rwlock.
The upstream change "3464 zfs synctask code needs restructuring" changed
zvol_set_volsize to avoid the recursion on dp_config_rwlock, but this was
missed when originally merged in by r248571 due to significant differences
in our codebases in this area.
These changes also relied on bring in changes from upstream:
3557 dumpvp_size is not updated correctly when a dump zvol's size is
changed, which where also not present.
In order to help prevent future issues in this area a direct comparison
and diff minimisation from current upstream version (b515258) of zvol.c.
jhb [Mon, 22 Dec 2014 16:53:04 +0000 (16:53 +0000)]
Explicitly treat timeouts when waiting for IBF or OBF to change state as an
error. This fixes occasional hangs in the IPMI kcs thread when using
ipmitool locally.
royger [Mon, 22 Dec 2014 16:46:07 +0000 (16:46 +0000)]
vt: register the memory regions used by the vt drivers
Current VT drivers don't register the memory regions they use with the
nexus. This patch makes vt_vga and vt_efifb register the memory regions they
use.
This is needed (at least) for Xen support, since the FreeBSD kernel will try
to use the holes in the memory map to map memory from other domains and
setup it's grant table.
Sponsored by: Citrix Systems R&D
Reported by: sbruno
Tested by: emaste
Reviewed by: ray
PR: 195537
Differential Revision: https://reviews.freebsd.org/D1291
emaste [Mon, 22 Dec 2014 16:31:09 +0000 (16:31 +0000)]
Set up default shstrtab entries at shstrtab initialization
Instead of waiting until the addition of the first non-default entry.
This fixes a segfault when strip(1) is asked to remove every section from
an object file.
Upstream elftoolchain ticket 463
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1341
ngie [Mon, 22 Dec 2014 04:52:24 +0000 (04:52 +0000)]
Build selective portions of gnu/usr.bin/texinfo as part of build-tools to
ensure that building on a host without makeinfo (i.e. a host where
make delete-old -DWITHOUT_INFO was run), then building with MK_INFO == yes
doesn't manifest in build errors when building info pages
This manifested itself like the following when I was build testing an MFC
change on stable/10:
makeinfo --no-split -I /usr/src/gnu/lib/libregex/doc -I /usr/src/gnu/lib/libregex/doc regex.texi -o regex.info
makeinfo: not found
*** [regex.info] Error code 127
make[6]: stopped in /usr/src/gnu/lib/libregex/doc
1 error
Tested on a head VM without makeinfo installed and by building with MK_INFO=yes
ian [Mon, 22 Dec 2014 00:50:01 +0000 (00:50 +0000)]
Replace the clock divisor terms with values that also result in a 1 MHz
clock, but actually work on real hardware, unlike the original set of
values I chose.
PR: 195009
Submitted by: Scott Ellis <jumpnowtek@gmail.com>
jilles [Sun, 21 Dec 2014 22:18:30 +0000 (22:18 +0000)]
sh: Remove EXP_REDIR.
EXP_REDIR was supposed to generate pathnames in redirection if exactly one
file matches, as permitted but not required by POSIX in interactive mode. It
is unlikely this will be implemented.
andrew [Sun, 21 Dec 2014 21:38:12 +0000 (21:38 +0000)]
Fix the unwinder to get past functions with no stack but may cause an
exception. In this case no registers will be updated but the link register
will be copied to the program counter to be used to find the calling
function. In this case the program counter may be updated and we should
continue with the trace.
smh [Sun, 21 Dec 2014 17:21:29 +0000 (17:21 +0000)]
Switch zfsboot installer force 4K option to use vfs.zfs.min_auto_ashift=12
Previously we used gnop(8) to fake 4K sector size disks but ZFS now has a
sysctl to control this when creating new top level vdev's so use that
instead.
ian [Sun, 21 Dec 2014 17:10:24 +0000 (17:10 +0000)]
Allow whitspace to appear between device name and unit number in loaderdev.
This allows the same value to be used in u-boot commands and the loaderdev
env var that gets passed to ubldr, for example 'fatload mmc 1 ${bootfile}".
smh [Sun, 21 Dec 2014 16:32:57 +0000 (16:32 +0000)]
Return the error from ahci_setup_interrupt in ahci_attach
Previously ahci_attach returned a hard coded ENXIO instead of the value
from ahci_setup_interrupt. This is effectively a NOOP change as currently
ahci_setup_interrupt only ever returns 0 or ENXIO, so just there to protect
against any future changes to that.