]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMFV r297760: 6418 zpool should have a label clearing command
mav [Sat, 9 Apr 2016 20:30:50 +0000 (20:30 +0000)]
MFV r297760: 6418 zpool should have a label clearing command

Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Author: Will Andrews <will@firepipe.net>

Closes #83
Closes #32

openzfs/openzfs@9663688425131744221ea99f9e66b9ed964492ae

FreeBSD already had `zpool labelclear` functionality, so this is mostly
just a diff reduction.

MFC after: 1 month

8 years agoUse DELAY() instead of sleeping during boot-time attach.
jhb [Sat, 9 Apr 2016 20:18:34 +0000 (20:18 +0000)]
Use DELAY() instead of sleeping during boot-time attach.

Tested by: Wolfgang Zenker <wolfgang@lyxys.ka.sub.org>

8 years agosh(1): replace 0 with NULL for pointers.
pfg [Sat, 9 Apr 2016 20:05:39 +0000 (20:05 +0000)]
sh(1): replace 0 with NULL for pointers.

Found with devel/coccinelle.

Reviewed by: jilles

8 years agoAlign the start of the text segment to an 8-byte boundary. This fixes
ian [Sat, 9 Apr 2016 19:09:06 +0000 (19:09 +0000)]
Align the start of the text segment to an 8-byte boundary.  This fixes
alignment aborts in ubldr.bin for RPi that started happening with clang 3.8
(earlier clang apparently didn't generate strd instructions that trigger
the alignment fault).  The abort happened in ubldr.bin and not ubldr (elf
version) because the elf headers are 0xf4 bytes long, and stripping them
off left everything 4-byte aligned.

While here, also stop aligning the data segment to a page boundary, align
it to 8 bytes instead (aligning to a page just needlessly makes the file
bigger); pointed out by andrew@.

8 years agolibedit: replace 0 with NULL for pointers.
pfg [Sat, 9 Apr 2016 18:52:09 +0000 (18:52 +0000)]
libedit: replace 0 with NULL for pointers.

Found with devel/coccinelle.

Reviewed by: Christos Zoulas

8 years agoAdd couple new constants from SPC5r08.
mav [Sat, 9 Apr 2016 18:39:57 +0000 (18:39 +0000)]
Add couple new constants from SPC5r08.

8 years agolibpam: replace 0 with NULL for pointers.
pfg [Sat, 9 Apr 2016 18:09:10 +0000 (18:09 +0000)]
libpam: replace 0 with NULL for pointers.

Found with devel/coccinelle.

Reviewed by: des

8 years agolibfetch: replace 0 with NULL for pointers.
pfg [Sat, 9 Apr 2016 18:08:21 +0000 (18:08 +0000)]
libfetch: replace 0 with NULL for pointers.

Found with devel/coccinelle.

Reviewed by: des

8 years agoixl(4): replace 0 with NULL for pointers.
pfg [Sat, 9 Apr 2016 17:37:36 +0000 (17:37 +0000)]
ixl(4): replace 0 with NULL for pointers.

Found by devel/coccinelle.

Differential Revision: https://reviews.freebsd.org/D5894
Reviewed by: erj

8 years agosh: Fix some unquoted variables in tests.
jilles [Sat, 9 Apr 2016 16:06:13 +0000 (16:06 +0000)]
sh: Fix some unquoted variables in tests.

The builtins/getopts1.0 test failed if a single-character file existed in
the current directory.

8 years agoRegister symbolic port/node names in FC name server.
mav [Sat, 9 Apr 2016 14:50:47 +0000 (14:50 +0000)]
Register symbolic port/node names in FC name server.

This is cosmetics that simplifies identification of new ports on FC switch.

It would be good to use target name from CTL here instead of hostname, but
it is not passed here through CAM now.

MFC after: 2 weeks

8 years agoAdd more fine-grained kernel options for NUMA support.
jhb [Sat, 9 Apr 2016 13:58:04 +0000 (13:58 +0000)]
Add more fine-grained kernel options for NUMA support.

VM_NUMA_ALLOC is used to enable use of domain-aware memory allocation in
the virtual memory system.  DEVICE_NUMA is used to enable affinity
reporting for devices such as bus_get_domain().

MAXMEMDOM must still be set to a value greater than for any NUMA support
to be effective.  Note that 'cpuset -gd' always works if MAXMEMDOM is
enabled and the system supports NUMA.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D5782

8 years agoioat(4): ioat_get_dmaengine(): Add M_WAITOK mode
cem [Sat, 9 Apr 2016 13:15:34 +0000 (13:15 +0000)]
ioat(4): ioat_get_dmaengine(): Add M_WAITOK mode

Sponsored by: EMC / Isilon Storage Division

8 years agoMfp: r296310,r296343
bz [Sat, 9 Apr 2016 12:05:23 +0000 (12:05 +0000)]
Mfp: r296310,r296343

It looks like as with the safety belt of DELAY() fastened (*) we can
completely tear down and free all memory for TCP (after r281599).

(*) in theory a few ticks should be good enough to make sure the timers
are all really gone. Could we use a better matric here and check a
tcbcb count as an optimization?

PR: 164763
Reviewed by: gnn, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5734

8 years agoReduce code duplication when executing Passthrough IOCB.
mav [Sat, 9 Apr 2016 11:54:09 +0000 (11:54 +0000)]
Reduce code duplication when executing Passthrough IOCB.

MFC after: 2 weeks

8 years agoMfp: r296260
bz [Sat, 9 Apr 2016 11:27:47 +0000 (11:27 +0000)]
Mfp: r296260

The tcp_inpcb (pcbinfo) zone should be safe to destroy.

PR: 164763
Reviewed by: gnn
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5732

8 years agoEnable PHY regulator when the optional "phy-supply" property is present.
jmcneill [Sat, 9 Apr 2016 11:23:46 +0000 (11:23 +0000)]
Enable PHY regulator when the optional "phy-supply" property is present.

Submitted by: Emmanuel Vadot <manu@bidouilliste.com>

8 years agoMfp: r296259
bz [Sat, 9 Apr 2016 10:58:08 +0000 (10:58 +0000)]
Mfp: r296259

We attach the "counter" to the tcpcbs. Thus don't free the
TCP Fastopen zone before the tcpcbs are gone, as otherwise
the zone won't be empty.
With that it should be safe to destroy the "tfo" zone without
leaking the memory.

PR: 164763
Reviewed by: gnn
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5731

8 years agoCreate /usr/local/etc before filling things into it.
phk [Sat, 9 Apr 2016 10:53:21 +0000 (10:53 +0000)]
Create /usr/local/etc before filling things into it.

Only run mtree if the NANO_CUST_FILES_MTREE is nonempty

Also umount the packages on non-signal failure

8 years agoMfp: r296309
bz [Sat, 9 Apr 2016 10:51:07 +0000 (10:51 +0000)]
Mfp: r296309

While there is no dependency interaction, stopping the timer before
freeing the rest of the resources seems more natural and avoids it
being scheduled an extra time when it is no longer needed.

Reviewed by: gnn, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5733

8 years agoMfp: r296345
bz [Sat, 9 Apr 2016 10:44:57 +0000 (10:44 +0000)]
Mfp: r296345

No need to keep type stability on raw sockets zone.
We've also been running with a KASSERT since r222488 to make sure the
ipi_count is 0 on destroy.

PR: 164763
Reviewed by: gnn
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5735

8 years agoMfp: r296346
bz [Sat, 9 Apr 2016 10:39:54 +0000 (10:39 +0000)]
Mfp: r296346

No reason identified to keep UMA_ZONE_NOFREE here.

Reviewed by: gnn
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5736

8 years agoTry to unbreak the build: the 'vap' variable is only used if ieee80211
bz [Sat, 9 Apr 2016 09:31:28 +0000 (09:31 +0000)]
Try to unbreak the build: the 'vap' variable is only used if ieee80211
debugging compile is on.

8 years agoMake the KASSERT message in hash destroy more informative.
bz [Sat, 9 Apr 2016 09:24:05 +0000 (09:24 +0000)]
Make the KASSERT message in hash destroy more informative.
While the pointer might not be too helpful, the malloc type might at
least give a good hint about which hashtbl we are talking.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Reviewed by: gnn, emaste
Differential Revision: https://reviews.freebsd.org/D5802

8 years ago[net80211] print out the channel type (eg a, b, g, n) when creating
adrian [Sat, 9 Apr 2016 04:57:25 +0000 (04:57 +0000)]
[net80211] print out the channel type (eg a, b, g, n) when creating
an IBSS network.

8 years agoFix a masking bug for e500 PMC.
jhibbits [Sat, 9 Apr 2016 01:02:17 +0000 (01:02 +0000)]
Fix a masking bug for e500 PMC.

No idea how this slipped through my regression testing.  pe_code is the event to
count, pe_cpu is the CPU family mask.

8 years ago[ath] Only process beacon frames for the IBSS/BSSID if appropriate.
adrian [Sat, 9 Apr 2016 00:58:38 +0000 (00:58 +0000)]
[ath] Only process beacon frames for the IBSS/BSSID if appropriate.

* Don't use arbitrary frames for the average RX RSSI - only frames
  from the current BSSID

* Don't log / do the syncbeacon logic for another BSSID and definitely
  don't do the syncbeacon call if we miss beacons outside of STA mode.

* Don't do the IBSS merge bits if the current node plainly won't ever
  match our current BSS (ie, the IBSS doesn't have to match, but all
  the same bits that we check in ieee80211_ibss_merge() have to match.)

Tested:

* ath(4), AR9380, IBSS mode, surrounded by a lot of IBSS 11ac networks.

Sponsored by: Eva Automation, Inc.

8 years ago[net8021] Pull out the ibss check code into a public function.
adrian [Sat, 9 Apr 2016 00:55:55 +0000 (00:55 +0000)]
[net8021] Pull out the ibss check code into a public function.

The ath(4) driver now sees beacons and management frames for different
BSSIDs in IBSS mode, which is a problem when you're in a very busy
IBSS environment.

So, expose this function so drivers can use it to check if the current
RX node is actually for a BSS we need to pay attention to or not.

PR: kern/208644
Sponsored by: Eva Automation. Inc.

8 years ago[net80211] revert part of r282405 in order to restore IBSS behaviour.
adrian [Sat, 9 Apr 2016 00:54:02 +0000 (00:54 +0000)]
[net80211] revert part of r282405 in order to restore IBSS behaviour.

This prevents nodes being created for peers on BSSes that are not our own.
(Ie, same channel, IBSS, but different BSS.)

The "IBSS merge" thing was fixed by me enabling "see all beacons" in
the ath(4) driver a few months ago.  Trouble is, we now need the filtering
again.

Tested:

* ath(4), IBSS, on a very busy IBSS channel with lots (> 15) IBSS networks.

PR: kern/208643
Sponsored by: Eva Automation, Inc.

8 years agoFix incorrect pin definitions for Allwinner A31.
jmcneill [Fri, 8 Apr 2016 23:11:00 +0000 (23:11 +0000)]
Fix incorrect pin definitions for Allwinner A31.

8 years agoAttach hwreset resources at the same time as clock resources.
jmcneill [Fri, 8 Apr 2016 23:07:16 +0000 (23:07 +0000)]
Attach hwreset resources at the same time as clock resources.

8 years agoMake it possible to tweak RCTL throttling sysctls at runtime.
trasz [Fri, 8 Apr 2016 18:15:31 +0000 (18:15 +0000)]
Make it possible to tweak RCTL throttling sysctls at runtime.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix sending TSO packets larger than single DMA segment on VNIC
zbb [Fri, 8 Apr 2016 16:14:18 +0000 (16:14 +0000)]
Fix sending TSO packets larger than single DMA segment on VNIC

Due to the bug in the number of 'GATHER' subdescriptors for TSO
packets, VNIC was not able to transmit more than one DMA segment
with TSO enabled.

Obtained from: Semihalf
Sponsored by:  Cavium

8 years agoFix MIPS INTRNG omissions, add soft/hard interrupts with different names
sgalabov [Fri, 8 Apr 2016 15:48:10 +0000 (15:48 +0000)]
Fix MIPS INTRNG omissions, add soft/hard interrupts with different names

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

8 years agoIntroduce better locking for mtk_gpio_v[12] drivers
sgalabov [Fri, 8 Apr 2016 15:28:12 +0000 (15:28 +0000)]
Introduce better locking for mtk_gpio_v[12] drivers

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5887

8 years agoIntroduce Mediatek/Ralink PCIe support
sgalabov [Fri, 8 Apr 2016 15:26:49 +0000 (15:26 +0000)]
Introduce Mediatek/Ralink PCIe support

This revision introduces PCIe support for the relevant Mediatek/Ralink
SoCs.
Currently the PCIe support is not converted to INTRNG, this may be a
task for the future.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5886

8 years agoIntroduce XHCI support for MT7621 SoC
sgalabov [Fri, 8 Apr 2016 15:22:30 +0000 (15:22 +0000)]
Introduce XHCI support for MT7621 SoC

Tested on a MT7621 board, similar to the WiTi board.
More testing will be required to confirm everything is fine, but things
look good so far.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5885

8 years agoDisable USB PHY slew rate calibration for Mediatek SoCs for now
sgalabov [Fri, 8 Apr 2016 15:20:58 +0000 (15:20 +0000)]
Disable USB PHY slew rate calibration for Mediatek SoCs for now

USB on both MT7621 and MT7688 seems to work much better without doing
slew rate calibration.
These are the only two SoCs, apart from MT7628, which actually make
use of the slew rate calibration routines implemented in the mtk_usb_phy
driver. Since MT7628 is actually a superset of MT7688 things should be
the same for it as well.

We do not remove the code, we simply define it out.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5884

8 years agoFix wrong memory mapping
sgalabov [Fri, 8 Apr 2016 15:13:38 +0000 (15:13 +0000)]
Fix wrong memory mapping

In mtk_soc.c memory is mapped incorrectly for MT7621. This revision fixes
this.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5882

8 years agobsdinstall/zfsboot should create /tmp and /var/tmp if they do not exist
allanjude [Fri, 8 Apr 2016 15:08:22 +0000 (15:08 +0000)]
bsdinstall/zfsboot should create /tmp and /var/tmp if they do not exist

PR: 208629
PR: 208568
Submitted by: Galael LAPLANCHE <ganael.laplanche@corp.ovh.com>
MFC after: 2 weeks

8 years agoDo not add swap to fstab when swapsize is 0
allanjude [Fri, 8 Apr 2016 15:05:06 +0000 (15:05 +0000)]
Do not add swap to fstab when swapsize is 0

If a user requested encrypted swap, but 0 sized, it would still be added to fstab

PR: 208630
Submitted by: Ganael LAPLANCHE <ganael.laplanche@corp.ovh.com>
MFC after: 2 weeks
Sponsored by: ScaleEngine Inc.

8 years agotopo_set_pu_id: turn a check into an assertion
avg [Fri, 8 Apr 2016 11:59:11 +0000 (11:59 +0000)]
topo_set_pu_id: turn a check into an assertion

The new id must not be present in any cpu set in any topology element.

MFC after: 30 days

8 years agozio write issue threads should have lower (numerically greater) priority
avg [Fri, 8 Apr 2016 11:58:24 +0000 (11:58 +0000)]
zio write issue threads should have lower (numerically greater) priority

This is because they might do data compression which is quite CPU
expensive.  The original code is correct for illumos, because there
a higher priority corresponds to a greater number.

MFC after: 2 weeks

8 years agoHandle whois referrals between RIRs
fanf [Fri, 8 Apr 2016 11:43:22 +0000 (11:43 +0000)]
Handle whois referrals between RIRs

This is rather ugly, because the RIPE and APNIC whois servers do
not provide referrals for address blocks that they do not manage.
However ARIN is usually the right place or knows the right place
so we try there.

The particular instance which clued me in to this bug is U.Mich.
141.211.0.0/16 for which the referral chain should be IANA ->
RIPE -> ARIN. RIPE's RDAP does provide useful redirects (for
example try `curl -I http://rdap.db.ripe.net/ip/141.211.0.0)
so maybe their whois server can be improved.

AfriNIC's whois server gives more direct referrals, but they are
designed to be human-readable. Ugly, but we can manage.

The issue of referrals between RIRs is likely to become more important
in the future whith the increasing number of cross-region IP address
block transfers increases.

8 years agoSpeedup BGX link polling on ARM64
wma [Fri, 8 Apr 2016 11:20:56 +0000 (11:20 +0000)]
Speedup BGX link polling on ARM64

The previous values caused the callout thread stall for 100ms each 2s
if no link is present. Dtrace analysis showed that it has significant
impact on overall interrupt performance.
Decrease these values by a factor of 100.

Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           zbb
Differential Revision: https://reviews.freebsd.org/D5854

8 years agoUse __FBSDID() for .c files from lib/libthr/thread.
kib [Fri, 8 Apr 2016 11:15:26 +0000 (11:15 +0000)]
Use __FBSDID() for .c files from lib/libthr/thread.

Sponsored by: The FreeBSD Foundation

8 years agoFix regression introduced in r296986.
ae [Fri, 8 Apr 2016 11:13:24 +0000 (11:13 +0000)]
Fix regression introduced in r296986.

Currently we don't keep zoneid in in6_ifaddr structure, because there
is still some code, that doesn't properly initialize sin6_scope_id,
but some functions use sa_equal() for addresses comparison. sa_equal()
compares full sockaddr_in6 structures and such comparison will fail.
For now use zero zoneid in in6ifa_ifwithaddr(). It is safe, because
used address is in embedded form. In future we will use zoneid, so mark it
with XXX comment.

Reported by: kp
Tested by: kp

8 years agoUse ANSI C function definitions, fix spelling in a comment.
kib [Fri, 8 Apr 2016 10:59:06 +0000 (10:59 +0000)]
Use ANSI C function definitions, fix spelling in a comment.

Sponsored by: The FreeBSD Foundation

8 years agoAdd function for mapping SRAM-D area to USB0 (OTG) controller. Use a lower
jmcneill [Fri, 8 Apr 2016 10:54:59 +0000 (10:54 +0000)]
Add function for mapping SRAM-D area to USB0 (OTG) controller. Use a lower
pass number to ensure that this driver is loaded before EMAC or OTG,
regardless of the order of nodes in the DT.

8 years agoUse the ABI-prescribed name for SHT_X86_64_UNWIND in the loader and
kib [Fri, 8 Apr 2016 10:23:48 +0000 (10:23 +0000)]
Use the ABI-prescribed name for SHT_X86_64_UNWIND in the loader and
kernel linker, after the r297686.

Sponsored by: The FreeBSD Foundation

8 years agoAssert that the lock objects put into the off-page, fit into the page.
kib [Fri, 8 Apr 2016 10:21:43 +0000 (10:21 +0000)]
Assert that the lock objects put into the off-page, fit into the page.

Sponsored by: The FreeBSD Foundation

8 years agohyperv: Revert r297481
sephe [Fri, 8 Apr 2016 09:20:46 +0000 (09:20 +0000)]
hyperv: Revert r297481

Use vm_guest == VM_GUEST_HV is not enough to determine whether FreeBSD
is running on Hyper-V or not.  What a mess.

Reported by: smokehydration tutanota com
Sponsored by: Microsoft OSTC

8 years agoAdd new USB quirk.
hselasky [Fri, 8 Apr 2016 06:51:49 +0000 (06:51 +0000)]
Add new USB quirk.

Submitted by: AJ <aleksanderlothe@live.com>
PR: 208623
MFC after: 1 week

8 years agoFix comment.
kevlo [Fri, 8 Apr 2016 04:29:05 +0000 (04:29 +0000)]
Fix comment.

8 years agoaudit(8): leave unsigned comparison for last.
pfg [Fri, 8 Apr 2016 03:26:21 +0000 (03:26 +0000)]
audit(8): leave unsigned comparison for last.

aq64_minfree is unsigned so comparing to find out if it is less
than zero is a nonsense. Move the comparison to the last position
as we don't want to spend time if any of the others triggers first.

hile it would be tempting to just remove it, it may be important to
keep  it for portability with platforms where may be signed(?) or
in case we may want to change it in the future.

8 years agoGELIBoot should only prompt for the GELI passphrase if the provider has the G_ELI_FLA...
allanjude [Fri, 8 Apr 2016 01:27:40 +0000 (01:27 +0000)]
GELIBoot should only prompt for the GELI passphrase if the provider has the G_ELI_FLAG_GELIBOOT set

PR: 208251
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D5870

8 years agoCreate the GELIBOOT GEOM_ELI flag
allanjude [Fri, 8 Apr 2016 01:25:25 +0000 (01:25 +0000)]
Create the GELIBOOT GEOM_ELI flag

This flag indicates that the user wishes to use the GELIBOOT feature to boot from a fully encrypted root file system.
Currently, GELIBOOT does not support key files, and in the future when it does, they will be loaded differently.
Due to the design of GELI, and the desire for secrecy, the GELI metadata does not know if key files are used or not, it just adds the key material (if any) to the HMAC before the optional passphrase, so there is no way to tell if a GELI partition requires key files or not.

Since the GELIBOOT code in boot2 and the loader does not support keys, they will now only attempt to attach if this flag is set. This will stop GELIBOOT from prompting for passwords to GELIs that it cannot decrypt, disrupting the boot process

PR: 208251
Reviewed by: ed, oshogbo, wblock
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D5867

8 years agoDocument vfs.root.mountfrom.
sobomax [Fri, 8 Apr 2016 00:24:21 +0000 (00:24 +0000)]
Document vfs.root.mountfrom.

Reviewed by: imp, wblock
Differential Revision: https://reviews.freebsd.org/D5332

8 years agoMatch on compatible string "allwinner,sun4i-a10-sram-controller" instead of
jmcneill [Fri, 8 Apr 2016 00:01:19 +0000 (00:01 +0000)]
Match on compatible string "allwinner,sun4i-a10-sram-controller" instead of
"allwinner,sun4i-sramc", to match upstream DTS.

8 years agochdone(): Prevent returning uninitialized scalar value.
pfg [Thu, 7 Apr 2016 21:33:14 +0000 (21:33 +0000)]
chdone(): Prevent returning uninitialized scalar value.

Improve over the solution in r297527:
Instead of attempting to initialize all the possible cases, just
move the check nearer to the case where it makes sense.

CID: 1006486
Reviewed by: ken
MFC after: 2 weeks

8 years agonewvers.sh: rationalize licence condition numbering
emaste [Thu, 7 Apr 2016 20:30:46 +0000 (20:30 +0000)]
newvers.sh: rationalize licence condition numbering

8 years agoRename SHT_AMD64_UNWIND to SHT_X86_64_UNWIND per ABI doc
emaste [Thu, 7 Apr 2016 20:26:27 +0000 (20:26 +0000)]
Rename SHT_AMD64_UNWIND to SHT_X86_64_UNWIND per ABI doc

From http://www.x86-64.org/documentation_folder/abi-0.99.pdf

8 years agoAdd option to specify built-in keymap for kbdmux
emaste [Thu, 7 Apr 2016 20:12:45 +0000 (20:12 +0000)]
Add option to specify built-in keymap for kbdmux

PR: 153459
Submitted by: swell.k@gmail.com

8 years agoRemove unecessary locking, mostly from places where a read is done of a
ian [Thu, 7 Apr 2016 19:51:27 +0000 (19:51 +0000)]
Remove unecessary locking, mostly from places where a read is done of a
value that can't ever be in an inconsistant intermediate state even when
some other thread is in the middle of writing the value/register.

Locking of the hardware remains in the few places that do r-m-w operations.
Locking of metadata access is restricted to places using memcpy or sprintf
to modify the metadata.

8 years agoCode cleanup: stop searching for a pin in the array and just use the pin
ian [Thu, 7 Apr 2016 19:17:47 +0000 (19:17 +0000)]
Code cleanup:  stop searching for a pin in the array and just use the pin
number directly as an index.  We create the array ourselves and nothing
can change the order of items in it, it's a simple 1:1 mapping.

8 years agoFix a copyright glitch before it gets copy-pasted again. I think this must
ian [Thu, 7 Apr 2016 18:19:09 +0000 (18:19 +0000)]
Fix a copyright glitch before it gets copy-pasted again.  I think this must
have started as collateral damage in a global search-replace, then it got
copied around when I cloned a file to begin creating a new file.

8 years agoComestic changes; when INTRNG support was added, some functions became
ian [Thu, 7 Apr 2016 17:45:01 +0000 (17:45 +0000)]
Comestic changes; when INTRNG support was added, some functions became
oddly separated from related functionality.  This just moves some blocks
of code around so that setup_intr and teardown_intr are near each other
again, and likewise for enable/disable_intr.  No functional changes.

8 years agoAssociate device_t objects with ACPI handles via PCI_CHILD_ADDED().
jhb [Thu, 7 Apr 2016 17:15:16 +0000 (17:15 +0000)]
Associate device_t objects with ACPI handles via PCI_CHILD_ADDED().

Previously, the ACPI PCI bus driver did a single pass over the devices in
the namespace that were a child of a given PCI bus to associate the
PCI bus-enumerated device_t devices with the corresponding ACPI handles.
However, this meant that handles were only established at runtime for devices
found during the initial PCI bus scan.

PCI_IOV adds devices that show up after the initial PCI bus scan, and coming
changes to add a bus rescan can also add devices after the initial scan.

This change adds a pci_child_added() callback to the ACPI PCI bus that walks
the namespace to find the ACPI handle for each device that is added.  Using
a callback means that the handle is correctly set for any device no matter
how it is added (initial scan, IOV, or a bus rescan).

8 years agoEnhance uuencode with a -r option to produce raw output.
gahr [Thu, 7 Apr 2016 16:12:38 +0000 (16:12 +0000)]
Enhance uuencode with a -r option to produce raw output.

This matches with uudecode's -r option to decode raw data without initial and
final framing lines.

$ echo Test | uuencode -mr - | uudecode -mr
Test

Approved by: cognet
MFC after: 1 week

8 years agoProperly initialize isrc_cpu field of ISRC which is setup for an IPI.
skra [Thu, 7 Apr 2016 15:26:12 +0000 (15:26 +0000)]
Properly initialize isrc_cpu field of ISRC which is setup for an IPI.

8 years agoFix intr_irq_shuffle(). After r297539, ISRCs doing IPI may be also
skra [Thu, 7 Apr 2016 15:16:33 +0000 (15:16 +0000)]
Fix intr_irq_shuffle(). After r297539, ISRCs doing IPI may be also
registered into global interrupt table. Thus, they must be filtered out
like per-cpu interrupts. Fortunately, it does not influence anything
on interrupt controllers which already use INTRNG.

8 years agoInitial import of Ralink/Mediatek MIPS SoC support #7
sgalabov [Thu, 7 Apr 2016 15:11:24 +0000 (15:11 +0000)]
Initial import of Ralink/Mediatek MIPS SoC support #7

GPIO controller drivers import.

As with other Ralink/Mediatek work, there are 2 versions of the GPIO
controller driver, depending on the type of SoC.
This revision introduces initial support for these.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5877

8 years agoImplement intr_isrc_init_on_cpu() and use it to replace very same
skra [Thu, 7 Apr 2016 15:00:25 +0000 (15:00 +0000)]
Implement intr_isrc_init_on_cpu() and use it to replace very same
code implemented in every interrupt controller driver running SMP.
This function returns true, if provided ISRC should be enabled on
given cpu.

8 years agoRevert r296416 by removing SAVESIGVEC and switching to fork instead. This
mp [Thu, 7 Apr 2016 14:25:15 +0000 (14:25 +0000)]
Revert r296416 by removing SAVESIGVEC and switching to fork instead. This
fixes usage with system libraries which maintain their own signal state.

PR:             208132
Obtained from:  kib
MFC after: 3 days

8 years agoAlike to r293708 relax pool check in vdev_geom_open_by_path().
mav [Thu, 7 Apr 2016 12:54:44 +0000 (12:54 +0000)]
Alike to r293708 relax pool check in vdev_geom_open_by_path().

This made impossible spare disk open by known path, which kind of worked
only because the same fix was applied to vdev_geom_attach_by_guids() in
r293708.

MFC after: 1 week

8 years agoInitial import of Ralink/Mediatek MIPS SoC support #6
sgalabov [Thu, 7 Apr 2016 11:21:42 +0000 (11:21 +0000)]
Initial import of Ralink/Mediatek MIPS SoC support #6

SPI drivers for the various Ralink/Mediatek SoCs. There are 2 versions of
the SPI controller (so far) present in the supported SoCs, hence v1 and v2
drivers.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5842

8 years agoInitial import of Ralink/Mediatek MIPS SoC support #5
sgalabov [Thu, 7 Apr 2016 11:20:03 +0000 (11:20 +0000)]
Initial import of Ralink/Mediatek MIPS SoC support #5

USB support

This revision adds USB (EHCI/OHCI/OTG, depending on SoC type) support for
various Ralink/Mediatek SoCs.
Currently USB is not supported on MT7621, this will be a future addition.

A USB PHY driver is also included, so that we can properly initialize the
USB PHY (e.g., clocks, resets, registers where needed), before attempting
to initialize EHCI/OHCI/OTG functionality.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5841

8 years agoInitial import of Ralink/Mediatek MIPS SoC support #4
sgalabov [Thu, 7 Apr 2016 11:16:32 +0000 (11:16 +0000)]
Initial import of Ralink/Mediatek MIPS SoC support #4

UART drivers.

- uart_dev_mtk.[ch] are the old-style Mediatek/Ralink-specific UART driver
  as also found in sys/mips/rt305x/uart_dev_rt305x.c, with minor improvements
  and FDT attachment enabled for the appropriate SoCs.
- uart_dev_mtk_ns8250.c is the new-style ns16550a-compatible UART driver
  found in newer Mediatek SoCs. It uses the uart_dev_ns8250.c driver
  indirectly and is basically just a wrapper around it and only overrides its
  probe method.
  The reason I am not using the uart_dev_ns8250.c driver directly is because
  I have some code that does UART clock detection before initializing the
  UART, so that we don't need to hard-code the UART clock frequency in the
  dts files for each board.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5840

8 years agoInitial import of Ralink/Mediatek MIPS SoC support #3
sgalabov [Thu, 7 Apr 2016 11:12:37 +0000 (11:12 +0000)]
Initial import of Ralink/Mediatek MIPS SoC support #3

Interrupt controllers found in various Mediatek/Ralink SoCs.

mtk_intr_v1 and mtk_intr_v2 are basically the same at the moment, with
just different register mappings.

However, v1 interrupt controller has a subset of the functionality of the
v2 interrupt controller, so in the future the v2 interrupt controller driver
may be enhanced, if needed, with things like level/edge interrupts and soft
interrupts. So, for the moment I suggest we keep them as 2 separate files.

mtk_intr_gic provides very basic (similar to v1 and v2) support for MIPS GIC
controllers, which currently maps all interrupts to a single core and sets
them to type level, active high. In the future this may be developed into a
generic GIC controller to support any new MIPS SoCs that include it. The GIC
is a standard MTI interrupt controller in their multi-core line-up (e.g.,
1004K, 1074K, etc.), rather than a SoC-specific controller.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5839

8 years agoInitial import of Ralink/Mediatek MIPS SoC support #2
sgalabov [Thu, 7 Apr 2016 11:08:50 +0000 (11:08 +0000)]
Initial import of Ralink/Mediatek MIPS SoC support #2

This revision adds the following to the Mediatek/Ralink support:

- initial support for "clocks" FDT property, currently based on fdt_clock
- initial support for "resets" FDT property, currently based on the
  fdt_reset interface from D5826
- initial support for "pinctrl,bits" functionality via FDT. May be extended
  in the future to cover a better and fuller pinctrl implementation

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5827

8 years agoThis revision adds the following parts:
sgalabov [Thu, 7 Apr 2016 11:02:49 +0000 (11:02 +0000)]
This revision adds the following parts:

- machine dependent low level init code
- SoC clocks detection and some utility functions
- Common interface to read/write/modify SoC system control registers, used
  by some of the other drivers and utility functions
- simple FDT resets support, based on the fdt_clock implementation already
  in the tree. For the moment resets and clocks are managed using these
  implementations. I am planning to port those to the new extres framework
  in the future, but currently I simply don't have time to do this part too.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5826

8 years agoBring MIPS INTRNG support back up again, in line with D5370
sgalabov [Thu, 7 Apr 2016 10:48:26 +0000 (10:48 +0000)]
Bring MIPS INTRNG support back up again, in line with D5370

Reviewed by: kan
Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5838

8 years agoFix interrupts delivery on ThunderX for VF IDs beyond 8
zbb [Thu, 7 Apr 2016 10:36:50 +0000 (10:36 +0000)]
Fix interrupts delivery on ThunderX for VF IDs beyond 8

SR-IOV devices usually use Alternative Routing ID (ARI).
In that case slot/device is always assumed to be 0 and
function/identifier is extended to 8 bits.

Fix interrupts delivery to VF IDs beyond 8 by using a correct
DevID if ARI is enabled.

Reviewed by:   jhb, wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5855

8 years agoA couple of minor changes that I missed that Michael had done, most noted
rrs [Thu, 7 Apr 2016 09:34:41 +0000 (09:34 +0000)]
A couple of minor changes that I missed that Michael had done, most noted
in these is the change to non-strict ordering for incoming data (this will
make pkt-drill test 14 fail but its expected).

8 years agoThis is work done by Michael Tuexen and myself at the IETF. This
rrs [Thu, 7 Apr 2016 09:10:34 +0000 (09:10 +0000)]
This is work done by Michael Tuexen and myself at the IETF. This
adds the new I-Data (Interleaved Data) message. This allows a user
to be able to have complete freedom from Head Of Line blocking that
was previously there due to the in-ability to send multiple large
messages without the TSN's being in sequence. The code as been
tested with Michaels various packet drill scripts as well as
inter-networking between the IETF's location in Argentina and Germany.

8 years agoThis revision adds support to if_rt for more SoCs.
sgalabov [Thu, 7 Apr 2016 07:22:22 +0000 (07:22 +0000)]
This revision adds support to if_rt for more SoCs.

The SoCs I've tried the driver with include the following:
RT3050, RT5350, RT3662, RT3883, MT7620, MT7621, MT7688.
On boards, based on the above SoCs traffic is passing through correctly
and the boards survive a flood ping with very little or no drops (drops
may be caused elsewhere in my test setup, however).

One issue still remains and needs to be fixed in the future: if_rt does
not survive an ifconfig rt0 down/ifconfig rt0 up cycle.
This issue existed before this commit as well, however.

Reviewed by: ray
Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5864

8 years agohyperv: Use lapic_{alloc,free}_ipi to allocate private interrupt vector
sephe [Thu, 7 Apr 2016 07:12:57 +0000 (07:12 +0000)]
hyperv: Use lapic_{alloc,free}_ipi to allocate private interrupt vector

Suggested by: jhb
Reviewed by: Dexuan Cui <decui microsoft com>, Jun Su <junsu microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5850

8 years agoxen: Set ipi_{alloc,free} even for UP
sephe [Thu, 7 Apr 2016 07:00:00 +0000 (07:00 +0000)]
xen: Set ipi_{alloc,free} even for UP

This keeps XEN apic_ops aligned w/ x86's.

Suggested by: kib, jhb
Reviewed by: jhb, royger
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5871

8 years agox86: Allow interrupt vector allocation/free even on UP
sephe [Thu, 7 Apr 2016 06:36:03 +0000 (06:36 +0000)]
x86: Allow interrupt vector allocation/free even on UP

It is needed by the hypervisor FreeBSD guest to allocate/free private
interrupt vectors.

Reviewed by: kib, jhb, Dexuan Cui <decui microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5849

8 years agoDisable the NetBSD-specific EFAULT requirements test in gettimeofday_err
ngie [Thu, 7 Apr 2016 06:21:33 +0000 (06:21 +0000)]
Disable the NetBSD-specific EFAULT requirements test in gettimeofday_err

FreeBSD doesn't specifically list this as a supported error, and in some
configurations/versions of FreeBSD, this test will segfault as the memory
address might be evaluated in userspace, instead of in kernel space like
in NetBSD.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agohyperv: Typo in r297634
sephe [Thu, 7 Apr 2016 05:56:22 +0000 (05:56 +0000)]
hyperv: Typo in r297634

Noticed by: hiren
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/vmbus: Use default mtx for channel message queue
sephe [Thu, 7 Apr 2016 05:45:49 +0000 (05:45 +0000)]
hyperv/vmbus: Use default mtx for channel message queue

First of all sema_post() can't be called w/ spinlock, and the channel
message queue processing is not on hot code path, i.e. spinlock is not
necessary.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: sephe, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5812

8 years agohyperv: Use mb() instead of atomic_thread_fence_seq_cst()
sephe [Thu, 7 Apr 2016 05:31:22 +0000 (05:31 +0000)]
hyperv: Use mb() instead of atomic_thread_fence_seq_cst()

Since atomic_thread_fence_seq_cst() will become compiler fence on UP kernel.

Reviewed by: kib, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5852

8 years agoAdd four new RCTL resources - readbps, readiops, writebps and writeiops,
trasz [Thu, 7 Apr 2016 04:23:25 +0000 (04:23 +0000)]
Add four new RCTL resources - readbps, readiops, writebps and writeiops,
for limiting disk (actually filesystem) IO.

Note that in some cases these limits are not quite precise. It's ok,
as long as it's within some reasonable bounds.

Testing - and review of the code, in particular the VFS and VM parts - is
very welcome.

MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5080

8 years agoAdd DTrace probes for packets flagged as bad by ipfilter. All probes
cy [Thu, 7 Apr 2016 01:42:09 +0000 (01:42 +0000)]
Add DTrace probes for packets flagged as bad by ipfilter. All probes
for bad packets are named ipf_fi_bad_*.  An example of its use might be:

dtrace -n 'sdt:::ipf_fi_bad_* { stack(); }'

Reviewed by:  Darren Reed <darrenr@reed.wattle.id.au>

8 years agoFix GELIBoot support for GELI sector size is > 512
allanjude [Wed, 6 Apr 2016 23:21:44 +0000 (23:21 +0000)]
Fix GELIBoot support for GELI sector size is > 512

Add support for 4k sector GELI encrypted partitions to the bootloader
This is the default created by the installer

Because the IV is different for each sector, and the XTS tweak carries forward you can not decrypt a partial sector if the starting offset is not 0

Make boot2 and the loader read in 4k aligned chunks

Reviewed by: ed, oshogbo
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D5820

8 years agoAdd optional configuration knob NANO_CUST_FILES_MTREE. If set, it will
glebius [Wed, 6 Apr 2016 23:17:05 +0000 (23:17 +0000)]
Add optional configuration knob NANO_CUST_FILES_MTREE.  If set, it will
require an entry in custom mtree definition for every custom installed file.

Obtained from: Netflix

8 years agoConvert Allwinner port to extres clk/hwreset/regulator APIs.
jmcneill [Wed, 6 Apr 2016 23:11:03 +0000 (23:11 +0000)]
Convert Allwinner port to extres clk/hwreset/regulator APIs.

Reviewed by: andrew, gonzo, Emmanuel Vadot <manu@bidouilliste.com>
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D5752

8 years agoFollow-up r295924: Only sync hash-based db files open for writing when closing.
bdrewery [Wed, 6 Apr 2016 22:38:50 +0000 (22:38 +0000)]
Follow-up r295924: Only sync hash-based db files open for writing when closing.

This fixes a major performance regression when reading db files such as
the pw database during a 'pkg install'.

MFC after: 1 week
Tested by: bapt
Reviewed by: bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5868

8 years agoUpdate cust_pkgng with a simpler, more robust version. We don't need
imp [Wed, 6 Apr 2016 19:34:44 +0000 (19:34 +0000)]
Update cust_pkgng with a simpler, more robust version. We don't need
to loop for pkg, which simplifies things.