]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoAdd handling for non-native error values to libsysdecode.
jhb [Tue, 23 Feb 2016 20:00:55 +0000 (20:00 +0000)]
Add handling for non-native error values to libsysdecode.

Add two new functions, sysdecode_abi_to_freebsd_errno() and
sysdecode_freebsd_to_abi_errno(), which convert errno values between
the native FreeBSD ABI and other supported ABIs. Note that the
mappings are not necessarily perfect meaning in some cases multiple
errors in one ABI might map to a single error in another ABI. In that
case, the reverse mapping will return one of the errors that maps, but
which error is non-deterministic.

Change truss to always report the raw error value to the user but
use libsysdecode to map it to a native errno value that can be used
with strerror() to generate a description. Previously truss reported
the "converted" error value. Now the user will always see the exact
error value that the application sees.

Change kdump to report the truly raw error value to the user. Previously
kdump would report the absolute value of the raw error value (so for
Linux binaries it didn't output the FreeBSD error value, but the positive
value of the Linux error). Now it reports the real (i.e. negative) error
value for Linux binaries. Also, use libsysdecode to convert the native
FreeBSD error reported in the ktrace record to the raw error used by the
ABI. This means that the Linux ABI can now be handled directly in
ktrsysret() and removes the need for linux_ktrsysret().

Reviewed by: bdrewery, kib
Helpful notes: wblock (manpage)
Differential Revision: https://reviews.freebsd.org/D5314

8 years agoAdd support for displaying thread IDs to truss(1).
jhb [Tue, 23 Feb 2016 19:56:29 +0000 (19:56 +0000)]
Add support for displaying thread IDs to truss(1).

- Consolidate duplicate code for printing the metadata at the start of
  each line into a shared function.
- Add an -H option which will log the thread ID of the relevant thread
  for each event.

While here, remove some extraneous calls to clock_gettime() in
print_syscall() and print_syscall_ret().  The caller of print_syscall_ret()
always updates the current thread's "after" time before it is called.

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D5363

8 years agoDon't leak an address in an error path.
tuexen [Tue, 23 Feb 2016 18:50:34 +0000 (18:50 +0000)]
Don't leak an address in an error path.

CID: 1351729
MFC after: 3 days

8 years agoConfigure the correct bMaxPacketSize for control endpoints before
hselasky [Tue, 23 Feb 2016 18:17:01 +0000 (18:17 +0000)]
Configure the correct bMaxPacketSize for control endpoints before
requesting the initial complete device descriptor and not as part of
the subsequent babble error recovery. Babble means that the received
USB packet was bigger than than configured maximum packet size. This
only affects enumeration of FULL speed USB devices which use a
bMaxPacketSize different from 8 bytes. This patch might help fix
enumeration of USB devices which exhibit USB I/O errors in dmesg
during boot.

MFC after: 1 week

8 years agoThis fixes the fastpath code to have a better module initialization sequence when
rrs [Tue, 23 Feb 2016 17:53:39 +0000 (17:53 +0000)]
This fixes the fastpath code to have a better module initialization sequence when
included in loader.conf. It also fixes it so that no matter if some one incorrectly
specifies a load order, the lists and such will be initialized on demand at that
time so no one can make that mistake.

Reviewed by: hiren
Differential Revision: D5189

8 years agoFollowing revision r295924, the changes to a db file should be fsynced
dwmalone [Tue, 23 Feb 2016 15:28:13 +0000 (15:28 +0000)]
Following revision r295924, the changes to a db file should be fsynced
before the file is closed. Consequently, it shouldn't be necessary to
open the file with O_SYNC any more.

This improves the performance of building large .db files for large
password files a lot and should resolve this problem:

https://forums.freebsd.org/threads/10-2-pre-pwd_mkdb-slow-on-larger-master-passwd.52700/

Differential Revision: https://reviews.freebsd.org/D5186
Reviewed by: garga, vangyzen, bapt, se
MFC after: 1 week

8 years agoIf we close or sync a hash-based db file, make sure to call fsync to
dwmalone [Tue, 23 Feb 2016 15:21:13 +0000 (15:21 +0000)]
If we close or sync a hash-based db file, make sure to call fsync to
make sure the changes are on disk. The people at pfSense noticed that
it didn't always make it to the disk soon enough with soft updates.

Differential Revision: https://reviews.freebsd.org/D5186
Reviewed by: garga, vangyzen, bapt, se
MFC after: 1 week

8 years agoBe more verbose when truncating number of HID items.
hselasky [Tue, 23 Feb 2016 14:58:20 +0000 (14:58 +0000)]
Be more verbose when truncating number of HID items.

Suggested by: Larry Rosenman <ler@lerctr.org>
MFC after: 1 week

8 years agoSet a dependencies for stack(9) RISC-V MD part.
br [Tue, 23 Feb 2016 14:29:22 +0000 (14:29 +0000)]
Set a dependencies for stack(9) RISC-V MD part.

Pointed out by: andrew

8 years agoo Grab physical memory regions information from the device tree.
br [Tue, 23 Feb 2016 14:21:46 +0000 (14:21 +0000)]
o Grab physical memory regions information from the device tree.
o Increase memory size.

8 years agoRemove redundant __ARM_ARCH >= 6 check in armv6 specific files.
skra [Tue, 23 Feb 2016 10:12:50 +0000 (10:12 +0000)]
Remove redundant __ARM_ARCH >= 6 check in armv6 specific files.

8 years agohyperv/stor: Fix print format
sephe [Tue, 23 Feb 2016 09:29:45 +0000 (09:29 +0000)]
hyperv/stor: Fix print format

Detected by: PVS Static Analysis
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5388

8 years agohyperv/hn: Use IFQ_DRV_PREPEND instead of IF_PREPEND
sephe [Tue, 23 Feb 2016 09:25:20 +0000 (09:25 +0000)]
hyperv/hn: Use IFQ_DRV_PREPEND instead of IF_PREPEND

IF_PREPEND promises out-of-order packet sending when the TX desc list
is depleted. It was overlooked and copied blindly when the transmission
path was partially rewritten.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5386

8 years agoMake handling of mmap()'s prot argument more strict.
ed [Tue, 23 Feb 2016 09:22:00 +0000 (09:22 +0000)]
Make handling of mmap()'s prot argument more strict.

- Make the system call fail if prot contains bits other than read, write
  and exec.
- Similar to OpenBSD's W^X, don't allow write and exec to be set at the
  same time. I'd like to see for now what happens if we enforce this
  policy unconditionally. If it turns out that this is far too strict,
  we'll loosen this requirement.

8 years agohyperv/hn: Factor out hn_send_pkt() from hn_start_locked()
sephe [Tue, 23 Feb 2016 09:20:33 +0000 (09:20 +0000)]
hyperv/hn: Factor out hn_send_pkt() from hn_start_locked()

It will be shared w/ the upcoming ifnet.if_transmit method
implementation.

No functional change.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5385

8 years agoMFV r295913:
delphij [Tue, 23 Feb 2016 07:13:22 +0000 (07:13 +0000)]
MFV r295913:

Partially apply upstream changeset 6e06b1c8 (kientzle).

Limit filter recursion level to 25 (instead of infinite).  This fixes a
potential crash issue discovered by Alexander Cherepanov.

PR: 207362
Reported by: Robert Clausecker
Obtained from: libarchive github project

8 years agoStop using the global fdtbus_bs_tag and instead use the tag from the softc
ian [Tue, 23 Feb 2016 03:34:36 +0000 (03:34 +0000)]
Stop using the global fdtbus_bs_tag and instead use the tag from the softc
that was set up properly at init time.

8 years agoThis code no longer references fdtbus_bs_tag, no need for a special extern
ian [Tue, 23 Feb 2016 03:01:46 +0000 (03:01 +0000)]
This code no longer references fdtbus_bs_tag, no need for a special extern
declaration of it for aarch64.

8 years agoNow that we have OF_decode_addr(), with proper MD implementations, to obtain
ian [Tue, 23 Feb 2016 02:57:45 +0000 (02:57 +0000)]
Now that we have OF_decode_addr(), with proper MD implementations, to obtain
the bus space tag and handle for a uart console, use the values returned by
that routine to set the global uart_bus_space_mem, instead of assuming that
there will be a global variable named fdtbus_bs_tag to set it from.

Also, use OF_getencprop() instead calling fdt32_to_cpu() separately.

8 years agoAllow the size argument for law_enable() to be non-power-of-2.
jhibbits [Tue, 23 Feb 2016 02:28:19 +0000 (02:28 +0000)]
Allow the size argument for law_enable() to be non-power-of-2.

Although the local access windows are powers of 2 in size, allow arguments that
aren't power of 2, and round up.

8 years agoAdd device ID for 'AboCom 802.11n' usb.
kevlo [Tue, 23 Feb 2016 01:56:58 +0000 (01:56 +0000)]
Add device ID for 'AboCom 802.11n' usb.

PR: 207412
Submitted by: Philippe Michaud-Boudreault <pitwuu at gmail dot com>

8 years agoFix and clean up usage of DMA and TSO segments:
marius [Tue, 23 Feb 2016 01:19:26 +0000 (01:19 +0000)]
Fix and clean up usage of DMA and TSO segments:
- At Intel it is believed that most of their products support "only"
  40 DMA segments so lower {EM,IGB}_MAX_SCATTER accordingly. Actually,
  40 is more than plenty to handle full size TSO packets so it doesn't
  make sense to further distinguish between MAC variants that really
  can do 64 DMA segments. Moreover, capping at 40 DMA segments limits
  the stack usage of {em,igb}_xmit() that - given the rare use of more
  than these - previously hardly was justifiable, while still being
  sufficient to avoid the problems seen with em(4) and EM_MAX_SCATTER
  set to 32.
- In igb(4), pass the actually supported TSO parameters up the stack.
  Previously, the defaults set in if_attach_internal() were applied,
  i. e. a maximum of 35 TSO segments, which made supporting more than
  these in the driver pointless. However, this might explain why no
  problems were seen with IGB_MAX_SCATTER at 64.
- In em(4), take the 5 m_pullup(9) invocations performed by em_xmit()
  in the TSO case into account when reporting TSO parameters upwards.
  In the worst case, each of these calls will add another mbuf and,
  thus, the requirement for an additional DMA segment. So for best
  performance, it doesn't make sense to advertize a maximum of TSO
  segments that typically will require defragmentation in em_xmit().
  Again, this leaves enough room to handle full size TSO packets.
- Drop TSO macros from if_lem.h given that corresponding MACS don't
  support TSO in the first place.

Reviewed by: erj, sbruno, jeffrey.e.pieper_intel.com
Approved by: erj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D5238

8 years agoMake imx6 systems work again after recent import of new dts files.
ian [Tue, 23 Feb 2016 01:08:39 +0000 (01:08 +0000)]
Make imx6 systems work again after recent import of new dts files.

Linux-driven changes to the way the chip's two interrupt controllers are
defined (we only support one of them) led to no interrupt processing, so
the system would hang after device instantiation.  This workaround just
rewrites the FDT data on the fly to get interrupt handling back under the
control of the main GIC device.

If/when we ever support deep sleep modes that involve powering down the
main GIC, we'll have to undo this change, write a driver for the GPC-PIC,
and somehow manage the handoff of responsibilities between the two drivers
as the chip transitions in/out of deep sleep mode.

8 years agoFix a problem in ld, causing it to sometimes print messages similar to
dim [Mon, 22 Feb 2016 22:16:32 +0000 (22:16 +0000)]
Fix a problem in ld, causing it to sometimes print messages similar to
"invalid string offset 65521 >= 27261 for section `.strtab'". for object
files produced by recent versions of clang.

In BFD's elf_create_symbuf() function, the size of the symbol buffer
('ssymbuf') is not calculated correctly, and the initial value for the
'ssym' variable is off by one, since 'ssymbuf' has shndx_count + 1
members.

MFC after: 1 week

8 years agoFix the usr.sbin/iostat build with GCC, broken by r295768
asomers [Mon, 22 Feb 2016 21:40:53 +0000 (21:40 +0000)]
Fix the usr.sbin/iostat build with GCC, broken by r295768

Renamed some local variables for compatibility with -Wshadow

Reported by: Andrew Turner
Tested by: ken
MFC after: 4 weeks
X-MFC-with: 295768
Sponsored by: Spectra Logic Corp

8 years agoAlways remove .depend.* in case switching between FAST_DEPEND on/off.
bdrewery [Mon, 22 Feb 2016 21:01:25 +0000 (21:01 +0000)]
Always remove .depend.* in case switching between FAST_DEPEND on/off.

This was missed in r295666.

Sponsored by: EMC / Isilon Storage Division

8 years agoIf the user has set a u-boot env var named rootpath, automatically
ian [Mon, 22 Feb 2016 18:53:55 +0000 (18:53 +0000)]
If the user has set a u-boot env var named rootpath, automatically
import it into the loader(8) env as dhcp.root-path, so that it overrides
any dhcp/bootp server-provided path.

Now if you have a dhcp server available you can easily net-boot a u-boot
system even if you don't control the dhcp server config, by setting just
two variables in the u-boot env:

  loaderdev=net
  rootpath=<nfsserverip>:<pathname>

Previously you had to either accept all the dhcp parameters from the
server without the ability to locally provide the rootpath, or you had
to forego dhcp and set more vars (ipaddr, netmask, serverip, rootpath).

8 years agoAdd basic trap handlers for illegal instruction and breakpoint
br [Mon, 22 Feb 2016 14:54:50 +0000 (14:54 +0000)]
Add basic trap handlers for illegal instruction and breakpoint
exceptions.

8 years agoFix comment.
br [Mon, 22 Feb 2016 14:19:45 +0000 (14:19 +0000)]
Fix comment.

8 years agoRemove duplicates.
br [Mon, 22 Feb 2016 14:13:05 +0000 (14:13 +0000)]
Remove duplicates.

8 years agoProvide stack(9) MD stubs for RISC-V so ktr(9) can be compiled in.
br [Mon, 22 Feb 2016 14:01:46 +0000 (14:01 +0000)]
Provide stack(9) MD stubs for RISC-V so ktr(9) can be compiled in.

8 years agoFix ktrace call.
br [Mon, 22 Feb 2016 13:52:08 +0000 (13:52 +0000)]
Fix ktrace call.

8 years agoAdd Intel 10Gb support to ARM64 GENERIC kernel config
wma [Mon, 22 Feb 2016 13:34:43 +0000 (13:34 +0000)]
Add Intel 10Gb support to ARM64 GENERIC kernel config

Obtained from:         Semihalf
Sponsored by:          Cavium
Approved by:           cognet (mentor)
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D5347

8 years agoRemove armv6 specific part from armv4 specific file and update comment.
skra [Mon, 22 Feb 2016 12:57:08 +0000 (12:57 +0000)]
Remove armv6 specific part from armv4 specific file and update comment.
No functional change.

8 years agoMove ARM_L2_PIPT option to std.armv6 for all armv6 platforms.
skra [Mon, 22 Feb 2016 11:47:28 +0000 (11:47 +0000)]
Move ARM_L2_PIPT option to std.armv6 for all armv6 platforms.
Only L2 PIPT cache is supported for __ARM_ARCH >= 6.

In fact, this is just a pure proclamation as this option is used
only in armv4 specific files now.

8 years agoAs <machine/vm.h> is included from <vm/vm.h>, there is no need to
skra [Mon, 22 Feb 2016 09:10:23 +0000 (09:10 +0000)]
As <machine/vm.h> is included from <vm/vm.h>, there is no need to
include it explicitly when <vm/vm.h> is already included.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D5380

8 years agoAs <machine/vmparam.h> is included from <vm/vm_param.h>, there is no
skra [Mon, 22 Feb 2016 09:08:04 +0000 (09:08 +0000)]
As <machine/vmparam.h> is included from <vm/vm_param.h>, there is no
need to include it explicitly when <vm/vm_param.h> is already included.

Suggested by: alc
Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D5379

8 years agoAs <machine/param.h> is included from <sys/param.h>, there is no need
skra [Mon, 22 Feb 2016 09:04:36 +0000 (09:04 +0000)]
As <machine/param.h> is included from <sys/param.h>, there is no need
to include it explicitly when <sys/param.h> is already included.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D5378

8 years agoAs <machine/pmap.h> is included from <vm/pmap.h>, there is no need to
skra [Mon, 22 Feb 2016 09:02:20 +0000 (09:02 +0000)]
As <machine/pmap.h> is included from <vm/pmap.h>, there is no need to
include it explicitly when <vm/pmap.h> is already included.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D5373

8 years agohyperv/hn: Add TX method for txeof processing.
sephe [Mon, 22 Feb 2016 06:28:18 +0000 (06:28 +0000)]
hyperv/hn: Add TX method for txeof processing.

Preamble to implement ifnet.if_transmit method.

Reviewed by: adrian
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5346

8 years agohyperv/hn: Staticize and rename packet TX done function
sephe [Mon, 22 Feb 2016 06:22:47 +0000 (06:22 +0000)]
hyperv/hn: Staticize and rename packet TX done function

It is only used in hv_netvsc_drv_freebsd.c; and rename it to hn_tx_done()
mainly to reserve "xmit" for ifnet.if_transmit implement.

While I'm here, remove unapplied comment.

Reviewed by: adrian
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5345

8 years agohyperv/hn: Rename TX related function and struct fields a bit
sephe [Mon, 22 Feb 2016 06:17:26 +0000 (06:17 +0000)]
hyperv/hn: Rename TX related function and struct fields a bit

Preamble to implement the ifnet.if_transmit method.

Reviewed by: adrian
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5344

8 years agourtwn: shutdown the device properly
avos [Mon, 22 Feb 2016 01:15:02 +0000 (01:15 +0000)]
urtwn: shutdown the device properly

- R92C path: NetBSD (mostly)
- R88E path: TP-Link driver

Tested with RTL8188EU and RTL8188CUS.

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5198

8 years agoifnet lock was changed to use sx(9) long time ago.
yongari [Mon, 22 Feb 2016 00:58:04 +0000 (00:58 +0000)]
ifnet lock was changed to use sx(9) long time ago.
Don't hold a driver lock for if_free(9).

8 years agourtwn: add an option to compile the driver without firmware specific code
avos [Mon, 22 Feb 2016 00:48:53 +0000 (00:48 +0000)]
urtwn: add an option to compile the driver without firmware specific code

- Add URTWN_WITHOUT_UCODE option (will disable any firmware specific code
when set).
- Do not exclude the driver from build when MK_SOURCELESS_UCODE is set
(URTWN_WITHOUT_UCODE will be enforced unconditionally).
- Do not abort initialization when firmware cannot be loaded;
behave like the URTWN_WITHOUT_UCODE option was set.
- Drop some unused variables from urtwn_softc structure.

Tested with RTL8188EU and RTL8188CUS in HOSTAP and STA modes.

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4849

8 years agoMake efi_time and EFI_GetTimeOfDay static, neither are used by other parts
andrew [Sun, 21 Feb 2016 21:20:23 +0000 (21:20 +0000)]
Make efi_time and EFI_GetTimeOfDay static, neither are used by other parts
of the efi code.

Sponsored by: ABT Systems Ltd

8 years agosh: Don't hash alias name when there are no aliases.
jilles [Sun, 21 Feb 2016 20:58:24 +0000 (20:58 +0000)]
sh: Don't hash alias name when there are no aliases.

8 years agoDocument the ability to override compiled-in env and hints using variables
ian [Sun, 21 Feb 2016 18:58:05 +0000 (18:58 +0000)]
Document the ability to override compiled-in env and hints using variables
in the bootloader-provided env.

8 years agosh: Optimize setprompt(0).
jilles [Sun, 21 Feb 2016 18:54:17 +0000 (18:54 +0000)]
sh: Optimize setprompt(0).

Avoid doing work to print an empty prompt (such as when reading scripts).

8 years agortwn: import r290048.
avos [Sun, 21 Feb 2016 18:51:48 +0000 (18:51 +0000)]
rtwn: import r290048.

- Fix scanning from AUTH state.

Tested by: Simone Mario Lombardo <evil.lombo@gmail.com>

PR: 203105
Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4820

8 years agoAllow a dynamic env to override a compiled-in static env by passing in the
ian [Sun, 21 Feb 2016 18:35:01 +0000 (18:35 +0000)]
Allow a dynamic env to override a compiled-in static env by passing in the
override indication in the env data.

Submitted by: bde

8 years agoMinor style cleanups.
ian [Sun, 21 Feb 2016 18:17:09 +0000 (18:17 +0000)]
Minor style cleanups.

Submitted by: bde

8 years agosh: Remove unnecessary flushouts while reading script.
jilles [Sun, 21 Feb 2016 16:48:37 +0000 (16:48 +0000)]
sh: Remove unnecessary flushouts while reading script.

Output is flushed when a builtin is done or immediately after writing it
(error messages, set -v output, prompts).

8 years agoostiInitiatorIOCompleted(): wrong sizeof() argument.
pfg [Sun, 21 Feb 2016 16:45:22 +0000 (16:45 +0000)]
ostiInitiatorIOCompleted(): wrong sizeof() argument.

Detected by: PVS Static Analysis
CID: 13316011331523

8 years agoUnconditionally set e_ident[OSABI]=ELFOSABI_FREEBSD in arm binary headers.
ian [Sun, 21 Feb 2016 14:59:24 +0000 (14:59 +0000)]
Unconditionally set e_ident[OSABI]=ELFOSABI_FREEBSD in arm binary headers.

When the armv6 support was imported from a project branch, this complex
conditional logic and related #define'd values came along, but it's really
not clear what the intent of it all was.  The effect, however, was that
OSABI was always set to zero, which is "UNIX System V ABI".  Having the wrong
value there causes pkg(8) to avoid looking inside arm elf binaries to
determine shared-lib required/provides info for packaging.

8 years agoImplement /proc/$$/limits.
des [Sun, 21 Feb 2016 14:56:05 +0000 (14:56 +0000)]
Implement /proc/$$/limits.

PR: 207386
Submitted by: Szymon Śliwa <knight.erraunt@gmail.com>
MFC after: 3 weeks

8 years agoMake the "invalid numeric value" error message actually displayable
trasz [Sun, 21 Feb 2016 14:36:50 +0000 (14:36 +0000)]
Make the "invalid numeric value" error message actually displayable
(was a dead code before).

Submitted by: bde@ (earlier version)
Reviewed by: bde@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix "invalid type '(null)'" usage messages in zfs(8) and zpool(8).
dim [Sun, 21 Feb 2016 13:03:58 +0000 (13:03 +0000)]
Fix "invalid type '(null)'" usage messages in zfs(8) and zpool(8).

Currently, zfs(8) and zpool(8) print "invalid type '(null)'" or similar
messages, if you pass in invalid types, sources or column names for "zfs
get", "zfs list" and "zpool get".  This is because the commands use
getsubopt(3), and in case of failure, they print 'value', which is NULL
when sub options don't match.

They should print 'suboptarg' instead, which is the documented way to
get at the non-matching sub option value.

Reviewed by: smh
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D5365

8 years agoAdd a missing call to dev_cleanup from the arm64 loader.efi.
andrew [Sat, 20 Feb 2016 17:29:04 +0000 (17:29 +0000)]
Add a missing call to dev_cleanup from the arm64 loader.efi.

Sponsored by: ABT Systems Ltd

8 years agoSome BIOSes ACPI bytecode needs to take (sleepable) acpi mutex for
kib [Sat, 20 Feb 2016 13:37:04 +0000 (13:37 +0000)]
Some BIOSes ACPI bytecode needs to take (sleepable) acpi mutex for
acpi_GetInteger() execution.  Intel DMAR interrupt remapping code
needs to know UID of the HPET to properly route the FSB interrupts
from the HPET, even when interrupt remapping is disabled, and the code
is executed under some non-sleepable mutexes.

Cache HPET UIDs in the device softc at the attach time and provide
lock-less method to get UID, use the method from the dmar hpet
handling code instead of calling GetInteger().

Reported and tested by: Larry Rosenman <ler@lerctr.org>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoSwitch /dev/hpet to use make_dev_s(9). Device needs si_drv1
kib [Sat, 20 Feb 2016 13:21:59 +0000 (13:21 +0000)]
Switch /dev/hpet to use make_dev_s(9).  Device needs si_drv1
initializated, do it correctly even though hpet cannot be loaded as
module.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoin pf_print_state_parts, do not use skw->proto to print the protocol but our
kp [Sat, 20 Feb 2016 12:53:53 +0000 (12:53 +0000)]
in pf_print_state_parts, do not use skw->proto to print the protocol but our
local copy proto that we very carefully set beforehands. skw being NULL is
perfectly valid there.

Obtained from: OpenBSD (henning)

8 years agoRevert r295756:
zbb [Sat, 20 Feb 2016 12:28:20 +0000 (12:28 +0000)]
Revert r295756:
Extract common code from PowerPC's ofw_pci

Import portions of the PowerPC OF PCI implementation into
new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and
ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations
are moved to sys/dev/ofw/ofw_pci.h.

This creates a new ofw_pci_write_ivar() function and modifies
ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt()
methods.
Most functions contain existing ppc implementations in the majority
unchanged. Now there is no need to have multiple identical copies
of methods for various architectures.

Submitted by:  Marcin Mazurek <mma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Annapurna Labs
Reviewed by:   jhibbits, mmel
Differential Revision: https://reviews.freebsd.org/D4879

This needs to return to the drawing board as it breaks both
PowerPC and Sparc64 build.

Pointed out by: jhibbits

8 years agoifconfig(8): can't use 'name' or 'description' when creating interface with auto...
kp [Sat, 20 Feb 2016 11:36:35 +0000 (11:36 +0000)]
ifconfig(8): can't use 'name' or 'description' when creating interface with auto numbering

If one does 'ifconfig tap create name blah', it will return error because the
'name' command doesn't properly populate the request sent to ioctl(...). The
'description' command has the same bug, and is also fixed with this patch.

If one does 'ifconfig tap create mtu 9000 name blah', it DOES work, but 'tap0'
(or other sequence number) is echoed, instead of the expected 'blah'. (assuming
the name change actually succeeded)

Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5341

8 years agoRename busdma_machdep.c to busdma_machdep-v4.c, pmap.c to pmap-v4.c
skra [Sat, 20 Feb 2016 07:45:21 +0000 (07:45 +0000)]
Rename busdma_machdep.c to busdma_machdep-v4.c, pmap.c to pmap-v4.c
and trap.c to trap-v4.c to be plain and consistent with other armv4
specific files.

8 years agoFix the definition of RM_MAX_END.
jhibbits [Sat, 20 Feb 2016 01:34:13 +0000 (01:34 +0000)]
Fix the definition of RM_MAX_END.

Even though casting from signed to unsigned is well-defined in C, it's better to
first cast to the larger unsigned type, then negate.

8 years agoIntroduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.
jhibbits [Sat, 20 Feb 2016 01:32:58 +0000 (01:32 +0000)]
Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.

This simplifies checking for default resource range for bus_alloc_resource(),
and improves readability.

This is part of, and related to, the migration of rman_res_t from u_long to
uintmax_t.

Discussed with: jhb
Suggested by: marcel

8 years agoixl(4)/ixlv(4): Revert m_collapse() in ixl_xmit() to m_defrag().
erj [Fri, 19 Feb 2016 22:48:20 +0000 (22:48 +0000)]
ixl(4)/ixlv(4): Revert m_collapse() in ixl_xmit() to m_defrag().

The m_collapse() call would fail when transmitting medium-sized packets
when the interface mtu was set to 9000, so revert back to m_defrag(),
which does not fail.

Differential Revision: https://reviews.freebsd.org/D5207
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation

8 years agoRemove dead code. Code Cleanup. Improve clarity in debug messages
davidcs [Fri, 19 Feb 2016 22:46:52 +0000 (22:46 +0000)]
Remove dead code. Code Cleanup. Improve clarity in debug messages

MFC after:5 days

8 years agoixl(4): Fix errors in queue interrupt setup in MSIX mode.
erj [Fri, 19 Feb 2016 22:45:09 +0000 (22:45 +0000)]
ixl(4): Fix errors in queue interrupt setup in MSIX mode.

- I40E_PFINT_DYN_CTLN needs to be cleared, and not have a queue index
  written to it.
- The interrupt linked list for each queue is changed to only include
  the queue's Rx and Tx queues.

Differential Revision: https://reviews.freebsd.org/D5206
Reviewed by: sbruno
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation

8 years agoixl(4): Remove unsupported device IDs.
erj [Fri, 19 Feb 2016 22:33:50 +0000 (22:33 +0000)]
ixl(4): Remove unsupported device IDs.

There is no official support for 20G SKUs on FreeBSD, and the KX_A
device ID was never used.

Differential Revision: https://reviews.freebsd.org/D5204
Reviewed by: sbruno, jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation

8 years agoDIRDEPS_BUILD: Enable the post-build footer/stats display.
bdrewery [Fri, 19 Feb 2016 22:28:45 +0000 (22:28 +0000)]
DIRDEPS_BUILD: Enable the post-build footer/stats display.

There is no real downside to this and it is useful to have enabled.

Sponsored by: EMC / Isilon Storage Division

8 years agoixl(4): Fix two important RSS bugs.
erj [Fri, 19 Feb 2016 21:58:14 +0000 (21:58 +0000)]
ixl(4): Fix two important RSS bugs.

- Change tc_mapping field to assign 64 queues instead of 16 to the PF's VSI;
  add comments to describe how this is done.

- Set hash lut size to 512 when setting filter control; the lut size defaults
  to 128 if this isn't set.

Differential Revision: https://reviews.freebsd.org/D5203
Reviewed by: gallatin
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation

8 years agosh: Rework code to remove '\0' from shell input.
jilles [Fri, 19 Feb 2016 21:53:12 +0000 (21:53 +0000)]
sh: Rework code to remove '\0' from shell input.

This fixes bugs where '\0' was not removed correctly and speeds up the
parser.

8 years agoModified the use of bxe_grc_dump() function so that it can be invoked directly at...
davidcs [Fri, 19 Feb 2016 21:32:49 +0000 (21:32 +0000)]
Modified the use of bxe_grc_dump() function so that it can be invoked directly at any potential error path, where a fwdump is needed. The fwdump (a.k.a grcdump) is stored in a driver buffer. The sysctl grcdump_done indicates if a fwdump was taken and waiting to be retrieved.
The sysctl trigger_grcdump can be used to manually trigger a fwdump.

MFC after:5 days

8 years agoqlxgb: fix mismatch.
pfg [Fri, 19 Feb 2016 18:05:02 +0000 (18:05 +0000)]
qlxgb: fix mismatch.

Found by: PVS Static Analysis
Reviewed by: davidcs
MFC after: 1 month

8 years agosh: Add tests for comments in sh -c.
jilles [Fri, 19 Feb 2016 16:56:07 +0000 (16:56 +0000)]
sh: Add tests for comments in sh -c.

8 years agoFix syntax error introduced in previous commit where I removed one
se [Fri, 19 Feb 2016 16:53:21 +0000 (16:53 +0000)]
Fix syntax error introduced in previous commit where I removed one
character to few. I should have waited for the kernel compile to finish,
even though the change seemed so trivial.

8 years agoRemove redundant check for "(dinfo != NULL)", it has already been performed
se [Fri, 19 Feb 2016 16:43:03 +0000 (16:43 +0000)]
Remove redundant check for "(dinfo != NULL)", it has already been performed
as the first part of this complex loop conditional.

Found by:    PVS Static Analysis

8 years agoExt2: cleanup setting of ctime/mtime/birthtime.
pfg [Fri, 19 Feb 2016 15:53:08 +0000 (15:53 +0000)]
Ext2: cleanup setting of ctime/mtime/birthtime.

This adopts the same change as r291936 for UFS.
Directly clear IN_ACCESS or IN_UPDATE when user supplied the time, and
copy the value into the inode.

This keeps the behaviour cleaner and is consistent with UFS.

Reviewed by: bde
MFC after: 1 month (only 10)

8 years agofirewire: fix a mismatch introduced in r230558.
pfg [Fri, 19 Feb 2016 15:35:20 +0000 (15:35 +0000)]
firewire: fix a mismatch introduced in r230558.

Found by: PVS Static Analysis
Reviewed by: sbruno
MFC after: 1 month

8 years agoRemove objcopy in WITHOUT_TOOLCHAIN if it's from elftoolchain
emaste [Fri, 19 Feb 2016 15:11:54 +0000 (15:11 +0000)]
Remove objcopy in WITHOUT_TOOLCHAIN if it's from elftoolchain

8 years agoAdd initial support for the Allwinner A31i and A31s. This just adds the
andrew [Fri, 19 Feb 2016 14:15:31 +0000 (14:15 +0000)]
Add initial support for the Allwinner A31i and A31s. This just adds the
FDT platform code to detect when we are booting on one of these SoCs. The
driver changes will be added shortly.

Submitted by: Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision: https://reviews.freebsd.org/D5338

8 years agoInclude ofw_bus_subr.h before ofw_pci.h for the definition of struct
andrew [Fri, 19 Feb 2016 14:05:28 +0000 (14:05 +0000)]
Include ofw_bus_subr.h before ofw_pci.h for the definition of struct
ofw_bus_iinfo.

Sponsored by: ABT Systems Ltd

8 years agoFix possible out-of-bounds access detected by Ulrich Spörleins "scan-build".
se [Fri, 19 Feb 2016 14:01:35 +0000 (14:01 +0000)]
Fix possible out-of-bounds access detected by Ulrich Spörleins "scan-build".
Some invalid PCI device selectors could cause read access to an initialized
variable next to the array (local loop index variable).

While here, the parser has been made more strict with regard to the syntax
of PCI device selectors as documented in the man-page. E.g. "pci:" used to
be interpreted as "pci0:0".

MFC after: 3 days

8 years agoUse the SCTP level pointer, not the interface level.
tuexen [Fri, 19 Feb 2016 11:25:18 +0000 (11:25 +0000)]
Use the SCTP level pointer, not the interface level.

MFC after: 3 days

8 years agoRemove not used static function pmap_kenter_attr().
skra [Fri, 19 Feb 2016 10:40:04 +0000 (10:40 +0000)]
Remove not used static function pmap_kenter_attr().

8 years agoRemove not used definitions and fix some style nits.
skra [Fri, 19 Feb 2016 10:32:17 +0000 (10:32 +0000)]
Remove not used definitions and fix some style nits.
No functional changes.

8 years agoRemove AP_KRW definition not needed after r295801.
skra [Fri, 19 Feb 2016 09:52:11 +0000 (09:52 +0000)]
Remove AP_KRW definition not needed after r295801.

8 years agoRename pte.h to pte-v4.h and start including directly either pte-v4.h
skra [Fri, 19 Feb 2016 09:23:32 +0000 (09:23 +0000)]
Rename pte.h to pte-v4.h and start including directly either pte-v4.h
or pte-v6.h in files which needs it.

There are quite internal definitions in pte-v4.h and pte-v6.h headers
specific for corresponding pmap implementation. These headers should be
included only in very few files and an intention is to not hide for
which implementation such files are.

Further, sys/arm/arm/elf_trampoline.c is an example of file which
uses armv4 like pmap implementation for both armv4 and armv6 platforms.
This is another reason why pte.h which includes specific header
according to __ARM_ARCH is not created.

8 years agoRemove O_SYNC from the options passed to dbmopen().
se [Fri, 19 Feb 2016 08:42:13 +0000 (08:42 +0000)]
Remove O_SYNC from the options passed to dbmopen().

The output file is created as a temporary file that is moved over the
existing file after completion. Thus there is no need to immediately
flush all created db records to the temporary file.

This speeds up creation of the termcap db by a factor of 40 on my
ZFS based /etc filesytem (from 25 seconds to 0.6 seconds).

I have compared multiple output files created with and without O_SYNC
and they came out identical each time.  Nonetheless it might be best
to MFC this change and the similar one for services_mkdb (r295465) at
the same time when the changes to hash.c in review D5186 are merged.

MFC:  1 week

8 years agoMove common definitions from both pmap-v4.h and pmap-v6.h into pmap.h.
skra [Fri, 19 Feb 2016 08:41:47 +0000 (08:41 +0000)]
Move common definitions from both pmap-v4.h and pmap-v6.h into pmap.h.
(1) MI interface needed for vm subsystem.
(2) MD interface created for ARM architecture to be used in files
    shared by armv4 and armv6 platforms.

8 years agoRename pmap.h to pmap-v4.h and remove pmap-v6.h include from it.
skra [Fri, 19 Feb 2016 08:35:29 +0000 (08:35 +0000)]
Rename pmap.h to pmap-v4.h and remove pmap-v6.h include from it.
Create new pmap.h which includes specific header according to
__ARM_ARCH.

Note that <machine/pmap.h> is included from <vm/pmap.h> so one common
<machine/pmap.h> must exist.

8 years agoRemove sys/types.h
kevlo [Fri, 19 Feb 2016 06:50:00 +0000 (06:50 +0000)]
Remove sys/types.h

8 years agoFix regression introduced on 272446r.
araujo [Fri, 19 Feb 2016 06:35:53 +0000 (06:35 +0000)]
Fix regression introduced on 272446r.

lagg(4) supports the protocol none, where it disables any traffic without
disabling the lagg(4) interface itself.

PR: 206921
Submitted by: Pushkar Kothavade <pushkarbk@gmail.com>
Reviewed by: rpokala
Approved by: bapt (mentor)
MFC after: 3 weeks
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D5076

8 years agonet80211: add few missing subtype names.
avos [Fri, 19 Feb 2016 05:59:38 +0000 (05:59 +0000)]
net80211: add few missing subtype names.

- Add definitions for Timing Advertisement and Control Wrapper frames.
- Refresh ieee80211_mgt_subtype_name and ieee80211_ctl_subtype_name
arrays.
- Count Timing Advertisement frames as discarded management frames in all
modes.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5331

8 years agohyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed
sephe [Fri, 19 Feb 2016 05:13:56 +0000 (05:13 +0000)]
hyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed

Reviewed by: adrian
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5318

8 years agohyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012)
sephe [Fri, 19 Feb 2016 05:08:44 +0000 (05:08 +0000)]
hyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012)

Tested on Windows Server 2012.

Reviewed by: adrian
Approved by: adrian (mentor)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5317

8 years agohyperv/hn: Add option to bind TX taskqueues to the specified CPU
sephe [Fri, 19 Feb 2016 05:03:17 +0000 (05:03 +0000)]
hyperv/hn: Add option to bind TX taskqueues to the specified CPU

It will be used to help tracking host side transmission ring selection
issue; and it will be turned on by default, once we have concrete result.

Reviewed by: adrian, Jun Su <junsu microsoft com>
Approved by: adrian (mento)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5316

8 years agodocument some ACPI related sysctls.
adrian [Fri, 19 Feb 2016 05:02:17 +0000 (05:02 +0000)]
document some ACPI related sysctls.

Submitted by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Sponsored by: HardenedBSD
Differential Revision: https://reviews.freebsd.org/D5263