markj [Sat, 31 Jan 2015 22:38:43 +0000 (22:38 +0000)]
Fix some proc provider tests:
* Avoid hard-coding program paths, except when it's necessary in order to
override the use of a shell builtin.
* Translate struct proc through psinfo_t so that we can access process
arguments via the pr_psargs field of psinfo_t.
* Replace uses of pstop and prun with kill(1).
kib [Sat, 31 Jan 2015 21:43:46 +0000 (21:43 +0000)]
Do not qualify the mcontext_t *mcp argument for set_mcontext(9) as
const. On x86, even after the machine context is supposedly read into
the struct ucontext, lazy FPU state save code might only mark the FPU
data as hardware-owned. Later, set_fpcontext() needs to fetch the
state from hardware, modifying the *mcp.
The set_mcontext(9) is called from sigreturn(2) and setcontext(2)
implementations and old create_thread(2) interface, which throw the
*mcp out after the set_mcontext() call.
Reported by: dim
Discussed with: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
kib [Sat, 31 Jan 2015 21:31:53 +0000 (21:31 +0000)]
Update directory times immediately after an entry is created or
removed. Postponing it until tmpfs_getattr() is called causes
discordant values reported for file times vs. directory times.
Reported and tested by: madpilot
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
andrew [Sat, 31 Jan 2015 19:55:12 +0000 (19:55 +0000)]
Stop using load-multiple with lr and pc. This has been deprecated in ARMv7
and clang 3.6 warns about it. As this is used in libc and we build it with
-Werror this warning becomes an error stopping the build.
nwhitehorn [Sat, 31 Jan 2015 19:42:08 +0000 (19:42 +0000)]
Relocate kernel to high address space (a static + 64 MB for now) to avoid
conflicts with the Linux host kernel. This lets you kexec an unmodified
GENERIC64.
nwhitehorn [Sat, 31 Jan 2015 19:16:51 +0000 (19:16 +0000)]
Build the powerpc64 kernel as a position-independent executable. At startup,
it processes its own ELF relocations and can be loaded and run in place at
any physical/virtual address.
pfg [Sat, 31 Jan 2015 16:34:39 +0000 (16:34 +0000)]
MFV r277981:
Upstream fixes for issues found with afl (Issue #417).
- Fix length checking.
Check both the captured length and the on-the-wire length (the latter
*should* be greater than or equal to the former, but that's not
guaranteed).
Add some additional length checks, so neither caplen nor length
underflow.
If we stop dissecting because the packet is too short, return 1, not 0,
as we've "dissected" what we can; 0 means "this is LLC+SNAP with an OUI
of 0 and an unknown Ethertype".
loos [Sat, 31 Jan 2015 15:50:19 +0000 (15:50 +0000)]
Implement a new method to retrieve the gpiobus reference from a GPIO
controller.
The gpiobus is responsible to keep track of the used pins and serialize
the access to pins.
Some of these features are important to devices that do not descend
directly from gpiobus and as such cannot make use of its features (one
classic example is gpioc that is attached to the GPIO controller and could
not, until now, make use of the gpiobus locking).
kib [Sat, 31 Jan 2015 12:27:40 +0000 (12:27 +0000)]
The dependency chain for priority-inheritance mutexes could be
subverted by userspace into cycle. Both umtx_propagate_priority() and
umtx_repropagate_priority() would then loop infinitely, owning the
spinlock.
Check for the cycle using standard Floyd' algorithm before doing the
pass in the affected functions. Add simple check for condition of
tricking the thread into a wait for itself, which could be easily
simulated by usermode without race.
Found by: Eric van Gyzen <eric@vangyzen.net>
In collaboration with: Eric van Gyzen <eric@vangyzen.net>
Tested by: pho
MFC after: 1 week
kib [Sat, 31 Jan 2015 12:27:18 +0000 (12:27 +0000)]
POSIX states that write(2) "shall mark for update the last data
modification and last file status change timestamps of the file".
Currently, tmpfs only modifies ctime when file was extended. Since
r277828 followed tmpfs_write(), mmaped writes also do not modify
ctime.
Fix this, by updating both ctime and mtime for writes to tmpfs files.
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
cperciva [Fri, 30 Jan 2015 23:26:03 +0000 (23:26 +0000)]
Fix 7-year-old typo: The default directory searched for fortunes is
/usr/share/games/fortune, not /usr/games/fortune (which is the path
to the fortune binary itself).
nwhitehorn [Fri, 30 Jan 2015 21:22:18 +0000 (21:22 +0000)]
Use MBR by default on BIOS systems. An increasing number of motherboards
assume that GPT means UEFI boot, resulting in the installation of
uninstallable systems. This needs a little more work before MFC, in
particular based on disk size (> 2 TB + BIOS + MBR is not workable). That
will come soon.
grembo [Fri, 30 Jan 2015 19:47:25 +0000 (19:47 +0000)]
New function smbios_match to detect BIOS versions during boot
Motivation is to introduce BIOS specific quirks early in the boot
process. smbios_match can be called before malloc is avaible, that's
why parts of smbios_detect have been moved into a separate function
smbios_probe that will be called by smbios_detect as well as
smbios_match.
dim [Fri, 30 Jan 2015 18:26:38 +0000 (18:26 +0000)]
Partially revert r273382, to reduce diffs against upstream. This was a
temporary fix to solve a conflict with an older version of libc++, and
it is no longer relevant.
ambrisko [Fri, 30 Jan 2015 18:25:53 +0000 (18:25 +0000)]
Fix UEFI PXE boot on a NIC that isn't the first NIC.
In UEFI it appears all available NICS are present to pass network traffic.
This gives the capability to load the loader.efi from disk then set
currdev="net3:" and then all I/O will over over the 2nd NIC. On this
machine is appears the first handle is the first NIC in IPv4 mode and
then the 2nd handle is the first NIC in IPv6 mode. The 3rd handle is
the 2nd NIC in IPv4 mode. The fix is to index into the handle based
on the unit cached from boot device passed into the loader.
Some testing info from a test boot via kenv:
currdev="net3:"
loaddev="net3:"
boot.netif.name="igb1"
dim [Fri, 30 Jan 2015 18:17:17 +0000 (18:17 +0000)]
For clang, disable -Wcast-qual warnings for specific aesni files, since
clang 3.6.0 will emit a number of such warnings for those files, and
they are partially contributed code.
loos [Fri, 30 Jan 2015 14:35:04 +0000 (14:35 +0000)]
Allow the retrieving of the reserved pins state.
With this change, it is now possible to verify the pin function and level
of reserved pins (but not set them).
The use of reserved pins on Raspberry pi can lead to short circuits and
real damage to the SoC.
While here, remove duplicated code, make use of OF_getencprop_alloc()
instead of using fixed sized variables and reduce the dmesg spam by
printing reserved pin ranges (when possible) instead of printing each pin
in the range.
pjd [Fri, 30 Jan 2015 10:08:38 +0000 (10:08 +0000)]
Modify nvlist_get_parent() API to take additional cookie argument.
This allow for non-recursive iteration over nested nvlists, as in documented
example.
sys/cam/scsi/scsi_all.h:
In struct scsi_extended_inquiry_data:
- Increase the length field to 2 bytes, as it is 2 bytes in SPC-4.
- Add bit definitions for the various Activiate Microcode actions.
- Add the Sequential Access Logical Block Protection support bit,
since we need that in the sa(4) driver. (For modifications
that will come later.)
- Add definitions for the various Multi I_T Nexus Microcode
Download modes.
sys/cam/ctl/ctl.c:
As of SPC-4, a single report of "REPORTED LUNS DATA HAS CHANGED"
is to be given per I_T nexus. Once it is reported, the unit
attention condition should be cleared for all LUNS attached to
an I_T nexus.
Previously that only happened when a REPORT LUNS command was
processed.
This behavior may be different (according to SAM-5) when the
UA_INTLCK_CTRL bits are non-zero in the control mode page but
CTL does not currently support that.
So, in view of the spec, whenever we report a LUN inventory
change unit attention, clear it on all LUNs for that
particular I_T nexus.
Add a new function, ctl_clear_ua() that will clear a unit
attention on all LUNs for the given I_T nexus.
One field in the extended inquiry data that we could potentially
report at some point is the maximum supported sense data length.
To do that, we would the SIM to report (via path inquiry
perhaps) how much sense data it is able to send.
Add comments to explain some of the bits that are set in the
Extended Inquiry VPD page.
Add a few comments to make it more clear which functions handle
various VPD pages.
markj [Fri, 30 Jan 2015 05:03:23 +0000 (05:03 +0000)]
Don't attempt to disable enabled fasttrap probes in an exiting process.
There's no need to do so, and we can't hold an exiting process, so this
race can result in panics.
markj [Fri, 30 Jan 2015 04:51:59 +0000 (04:51 +0000)]
In fasttrap_sigtrap(), use tdsendsignal() rather than tdksignal() to send
SIGTRAP. The latter requires that its thread argument be non-NULL, but
fasttrap_sigtrap() does not.
markj [Fri, 30 Jan 2015 04:41:49 +0000 (04:41 +0000)]
The DTrace harness (dtest.pl) executes DTrace scripts with the -C flag,
which causes dtrace(1) to run the C preprocessor on input scripts before
executing them. Suppress some warnings emitted by the preprocessor which are
confusing the DTrace lexer tests.
markj [Fri, 30 Jan 2015 04:11:30 +0000 (04:11 +0000)]
When searching for an accompanying test program, look in the directory
containing the test script rather than the current directory. This is needed
in order to run the DTrace tests under Kyua.
jhb [Thu, 29 Jan 2015 20:41:42 +0000 (20:41 +0000)]
Opt for performance over power-saving on Intel CPUs that have a
P-state but not C-state invariant TSC by changing the default behavior
to leaving the TSC enabled as the timecounter and disabling C2+ instead
of disabling the TSC by default.
Discussed with: jkim
Tested by: Jan Kokemuller <jan.kokemueller@gmail.com>
jhb [Thu, 29 Jan 2015 19:55:33 +0000 (19:55 +0000)]
Remove the d_thread_t compatibility shim provided in 5.0 to handle the
struct thread (<= 4.x) vs struct proc (>= 5.0) argument to cdevsw routines.
It is long past its expiration date.
arybchik [Thu, 29 Jan 2015 19:11:37 +0000 (19:11 +0000)]
sfxge: Separate software Tx queue limit for non-TCP traffic
Add separate software Tx queue limit for non-TCP traffic to make total
limit higher and avoid local drops of TCP packets because of no
backpressure.
There is no point to make non-TCP limit high since without backpressure
UDP stream easily overflows any sensible limit.
Split early drops statistics since it is better to have separate counter
for each drop reason to make it unabmiguous.
Add software Tx queue high watermark. The information is very useful to
understand how big queues grow under traffic load.
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
arybchik [Thu, 29 Jan 2015 18:57:27 +0000 (18:57 +0000)]
sfxge: Remove extra cache-line alignment and reorder sfxge_evq_t
Remove the first member alignment to cacheline since it is nop.
Use __aligned() for the whole structure to make sure that the structure
size is cacheline aligned.
Remove lock alignment to make the structure smaller and fit all members
used on event queue processing into one cacheline (128 bytes) on x86-64.
The lock is obtained as well from different context when event queue
statistics are retrived from sysctl context, but it is infrequent.
Reorder members to avoid padding and go in usage order on event
processing.
As the result all structure members used on event queue processing fit
into exactly one cacheline (128 byte) now.
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
arybchik [Thu, 29 Jan 2015 18:52:33 +0000 (18:52 +0000)]
sfxge: Move txq->next pointer to part writable on completion path
In fact the pointer is used only if more than one TXQ is processed in
one interrupt.
It is used (read-write) on completion path only.
Also it makes the first part of the structure smaller and it fits now
into one 128byte cache line. So, TXQ structure becomes 128 bytes smaller.
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
gonzo [Thu, 29 Jan 2015 01:59:42 +0000 (01:59 +0000)]
Set LCDC clock frequency to 2*148500 KHz
Minimum LCDC is 2 so clock freq shouild be 2*max_pixel_clock. Maximum pixel
clock for HDMI is 148500 (1920x1080). But AM335x can not run in this mode
due to bandwidth and clock limitations
dim [Wed, 28 Jan 2015 21:33:49 +0000 (21:33 +0000)]
Fix multiple instances of the following clang 3.6.0 warning in ppp:
usr.sbin/ppp/command.c:2054:74: error: address of array 'arg->bundle->radius.cfg.file'
will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
if (arg->bundle->radius.alive.interval && !arg->bundle->radius.cfg.file) {
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In all cases, the file field of struct radius is a char array, but the
intent was to check whether the string is empty, so add an indirection
to achieve that. Use a similar approach for the sockname field of
struct server.