]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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.

8 years agoRevert a change that sneeked with 297619
andrew [Wed, 6 Apr 2016 16:50:18 +0000 (16:50 +0000)]
Revert a change that sneeked with 297619

8 years agoDisable support for compat syscalls on arm64. These symbols were never
andrew [Wed, 6 Apr 2016 16:09:10 +0000 (16:09 +0000)]
Disable support for compat syscalls on arm64. These symbols were never
shipped since arm64 exists only on 11+.

Submitted by: brooks
Reviewed by: emaste, imp

8 years agofsck_msdosfs(8): Optimimize memsets
pfg [Wed, 6 Apr 2016 15:28:26 +0000 (15:28 +0000)]
fsck_msdosfs(8): Optimimize memsets

Obtained from: NetBSD (bin/50908)
MFC after: 2 weeks

8 years agoUse PHYS_IN_DMAP to check if a physical address is within the DMAP region.
andrew [Wed, 6 Apr 2016 14:16:37 +0000 (14:16 +0000)]
Use PHYS_IN_DMAP to check if a physical address is within the DMAP region.

Approved by: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoCleanup the early pagetable creation code in preperation for increasing
andrew [Wed, 6 Apr 2016 14:12:00 +0000 (14:12 +0000)]
Cleanup the early pagetable creation code in preperation for increasing
the size of the arm64 DMAP region.

Approved by: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoAllow vmparam.h to be included from assembly files on arm64.
andrew [Wed, 6 Apr 2016 14:08:10 +0000 (14:08 +0000)]
Allow vmparam.h to be included from assembly files on arm64.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoFix PIC lookup by device and xref. There was not taken into account
skra [Wed, 6 Apr 2016 12:48:45 +0000 (12:48 +0000)]
Fix PIC lookup by device and xref. There was not taken into account
the situation that someone has a pointer to device but not its xref.
This situation is regular now, after r297539.

8 years agoMake CloudABI's way of doing TLS more friendly to userspace emulators.
ed [Wed, 6 Apr 2016 11:11:31 +0000 (11:11 +0000)]
Make CloudABI's way of doing TLS more friendly to userspace emulators.

We're currently seeing how hard it would be to run CloudABI binaries on
operating systems cannot be modified easily (Windows, Mac OS X). The
idea is that we want to just run them without any sandboxing. Now
that CloudABI executables are PIE, this is already a bit easier, but TLS
is still problematic:

- CloudABI executables want to write to the %fs, which typically
  requires extra system calls by the emulator every time it needs to
  switch between CloudABI's and its own TLS.

- If CloudABI executables overwrite the %fs base unconditionally, it
  also becomes harder for the emulator to store a backup of the old
  value of %fs. To solve this, let's no longer overwrite %fs, but just
  %fs:0.

As CloudABI's C library does not use a TCB, this space can now be used
by an emulator to keep track of its internal state. The executable can
now safely overwrite %fs:0, as long as it makes sure that the TCB is
copied over to the new TLS area.

Ensure that there is an initial TLS area set up when the process starts,
only containing a bogus TCB. We don't really care about its contents on
FreeBSD.

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

8 years agoImplement dtrace_getupcstack in ARM64
wma [Wed, 6 Apr 2016 05:13:36 +0000 (05:13 +0000)]
Implement dtrace_getupcstack in ARM64

Allow using DTRACE for performance analysis of userspace
applications - the function call stack can be captured.
This is almost an exact copy of AMD64 solution.

Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           emaste, gnn, jhibbits
Differential Revision: https://reviews.freebsd.org/D5779

8 years agoRevert accidental submit of WIP as part of r297609
rpokala [Wed, 6 Apr 2016 04:58:20 +0000 (04:58 +0000)]
Revert accidental submit of WIP as part of r297609

Pointyhat to: rpokala

8 years agoStorage Controller Interface driver - typo in unimplemented macro in
rpokala [Wed, 6 Apr 2016 04:50:28 +0000 (04:50 +0000)]
Storage Controller Interface driver - typo in unimplemented macro in
scic_sds_controller_registers.h

s/contoller/controller/

PR: 207336
Submitted by: Tony Narlock <tony @ git-pull.com>

8 years agoConvert pci_delete_child() to a bus_child_deleted() method.
jhb [Wed, 6 Apr 2016 04:10:22 +0000 (04:10 +0000)]
Convert pci_delete_child() to a bus_child_deleted() method.

Instead of providing a wrapper around device_delete_child() that the PCI
bus and child bus drivers must call explicitly, move the bulk of the logic
from pci_delete_child() into a bus_child_deleted() method
(pci_child_deleted()).  This allows PCI devices to be safely deleted via
device_delete_child().
- Add a bus_child_deleted method to the ACPI PCI bus which clears the
  device_t associated with the corresponding ACPI handle in addition to
  the normal PCI bus cleanup.
- Change cardbus_detach_card to call device_delete_children() and move
  CardBus-specific delete logic into a new cardbus_child_deleted() method.
- Use device_delete_child() instead of pci_delete_child() in the SRIOV code.
- Add a bus_child_deleted method to the OpenFirmware PCI bus drivers which
  frees the OpenFirmware device info for each PCI device.

Reviewed by: imp
Tested on: amd64 (CardBus and PCI-e hotplug)
Differential Revision: https://reviews.freebsd.org/D5831

8 years ago[wlanstats] Convert rssi / signal / rate to use float.
adrian [Wed, 6 Apr 2016 03:22:39 +0000 (03:22 +0000)]
[wlanstats] Convert rssi / signal / rate to use float.

* Convert rssi/signal/rate to be a single digit precision float
* rssi is actually in 1/2 dBm units, so divide it by 2

8 years agoChase r296204 by renaming tzsetup(1) to tzsetup(8) in the tests
ngie [Wed, 6 Apr 2016 03:12:44 +0000 (03:12 +0000)]
Chase r296204 by renaming tzsetup(1) to tzsetup(8) in the tests

MFC after: 3 days
X-MFC with: r296204
Sponsored by: EMC / Isilon Storage Division

8 years ago[net80211] missed commit from last one - always cleanup superg state.
adrian [Wed, 6 Apr 2016 01:22:20 +0000 (01:22 +0000)]
[net80211] missed commit from last one - always cleanup superg state.

8 years ago[net80211] Initial A-MSDU support for testing / evaluation
adrian [Wed, 6 Apr 2016 01:21:51 +0000 (01:21 +0000)]
[net80211] Initial A-MSDU support for testing / evaluation

A-MSDU is another 11n aggregation mechanism where multiple ethernet
frames get LLC encapsulated (so they have a length field), padded,
and put in a single MPDU (802.11 MAC frame.)  This means it gets sent
out as a single frame, with a single seqno, it's acked as one frame, etc.

It turns out that, hah, atheros fast frames is almost but not quite
like this, so I'm reusing all of the current superg/fast-frames stuff
in order to actually transmit A-MSDU.  Yes, this means that A-MSDU
frames are also only aggregated two at a time, so it's not necessarily
a huge win, but it's better than nothing.

This doesn't do anything by default - the driver needs to say it does
A-MSDU as well as set the AMSDU software TX capability so this code path
gets exercised.

For now, the only driver that enables this is urtwn.  I'll enable it
for rsu at some point soon.
Tested:

* Add an amsdu encap path to aggregate two frames, same as the
  fast-frames path.

* Always do the superg init/teardown and node init/teardown stuff,
  regardless of whether the nodes are doing fast-frames (the ATH
  capability stuff.)  That way we can reuse it for amsdu.

* Don't do AMSDU for multicast/broadcast and EAPOL frames.

* If we're doing A-MPDU, then don't bother doing FF/A-MSDU.
  We can likely do both together, but I don't want to change
  behaviour.

* Teach the fast frames approx txtime logic to support the 11n
  rates.  But, since we don't currently have a full "current rate"
  support, assume it's HT20, long-gi, etc.  That way we overshoot
  on the TX time estimation, so we're always inside the requirements.
  (And we only aggregate two frames for now, so we're not really
  going to exceed that.)

* Drop the maximum FF age default down to 2ms, otherwise we end up
  with some very annoyingly large latencies.

TODO:

* We only aggregate two ethernet frames, so I'm not checking the max
  A-MSDU size.  But when it comes time to support >2 frames, we should
  obey that.

Tested:

* urtwn(4)

8 years agoFix sed functions 'i' and 'a' from discarding leading white space.
pfg [Wed, 6 Apr 2016 00:55:39 +0000 (00:55 +0000)]
Fix sed functions 'i' and 'a' from discarding leading white space.

This appears to be implementation dependent but convenient and makes
our sed behave more like GNU sed.

Given that it is not the historic behavior, bump FreeBSD_version
should userland/ports somehow depend on it.

Obtained from: NetBSD (bin/49872)

Reviewed by: bdrewery
PR: 208554
Merge after: NEVER

8 years ago[urtwn] disable doing AMPDU TX.
adrian [Wed, 6 Apr 2016 00:52:30 +0000 (00:52 +0000)]
[urtwn] disable doing AMPDU TX.

We don't do AMPDU TX for now, so don't bother setting this.

8 years ago[rsu] We don't do A-MPDU transmit right now, so don't bother registering
adrian [Wed, 6 Apr 2016 00:41:06 +0000 (00:41 +0000)]
[rsu] We don't do A-MPDU transmit right now, so don't bother registering
for it.

8 years agobhyveload: fix from loading undefined size.
pfg [Wed, 6 Apr 2016 00:01:03 +0000 (00:01 +0000)]
bhyveload: fix from loading undefined size.

We were setting an incorrect/undefined size and as it came out the st
struct was not really being used at all. This was actually a bug but
by sheer luck it had no visual effect.

CID: 1194320
Reviewed by: grehan

8 years agoAdd kern.features flags for linux and linux64 modules
bapt [Tue, 5 Apr 2016 22:36:48 +0000 (22:36 +0000)]
Add kern.features flags for linux and linux64 modules

kern.features.linux: 1 meaning linux 32 bits binaries are supported
kern.features.linux64: 1 meaning linux 64 bits binaries are supported

The goal here is to help 3rd party applications (including ports) to determine
if the host do support linux emulation

Reviewed by: dchagin
MFC after: 1 week
Relnotes: yes
Differential Revision: D5830

8 years ago[urtwn] first cut of getting the fast-frames / amsdu support in shape.
adrian [Tue, 5 Apr 2016 22:14:21 +0000 (22:14 +0000)]
[urtwn] first cut of getting the fast-frames / amsdu support in shape.

The urtwn hardware transmits FF/A-MSDU just fine - it takes an 802.11
frame and will dutifully send the thing.

So:

* bump RX queue up from 1. Why's it 1? That's really silly.
* Add the "software A-MSDU" encap capability bit.
* bump the TX buffer size up so we can at least send A-MSDU frames.
* track active frames submitted to the NIC - we can't make assumptions
  about how many are in flight in the NIC though.  For 88E parts we
  could use per-packet TX indication, but for R92 parts we can't.
  So, just fake it somewhat.
* Kick the transmit queue when we finish reception; try to avoid stalls.
* Kick the FF queue a little more regularly.

A-MSDU TX won't happen until the net80211 side is done, but atheros
fast-frames support should now work.

Tested:

* urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R ; A-MSDU transmit.

8 years ago[net80211] rename 11n rate macros into a useful spot
adrian [Tue, 5 Apr 2016 22:01:56 +0000 (22:01 +0000)]
[net80211] rename 11n rate macros into a useful spot

* begin moving the 11n macros out of ieee80211_phy.c and
  into a header so they can be used elsewhere.

* rename some of them into the IEEE80211_* namespace.

* convert HT_RC_2_MCS() to work with three-stream rates.

8 years ago[net80211] note that M_FF will soon mean "fast-frames" or "A-MSDU."
adrian [Tue, 5 Apr 2016 21:54:42 +0000 (21:54 +0000)]
[net80211] note that M_FF will soon mean "fast-frames" or "A-MSDU."

8 years ago[net80211] Add a new capability flag to indicate that the stack should
adrian [Tue, 5 Apr 2016 21:54:07 +0000 (21:54 +0000)]
[net80211] Add a new capability flag to indicate that the stack should
do software A-MSDU encapsulation.

Right now there's AMSDU TX/RX capability bits and they're mostly
unused, however I'd like to maintain those as the general configuration,
not also "please software encap AMSDU."  For platforms that can do
A-MSDU in firmware (iwn, iwm, etc) then their init paths can read
this flag to configure A-MSDU.

8 years agonet80211: copy MAC address into iv_myaddr[] instead of aliasing it.
avos [Tue, 5 Apr 2016 21:29:11 +0000 (21:29 +0000)]
net80211: copy MAC address into iv_myaddr[] instead of aliasing it.

Since IF_LLADDR() returns a non-constant pointer to the MAC address
preserve a copy of it in iv_myaddr.

PR: 208505

8 years agoRemove leftover _LDSCRIPTROOT missed in r297270.
bdrewery [Tue, 5 Apr 2016 21:12:03 +0000 (21:12 +0000)]
Remove leftover _LDSCRIPTROOT missed in r297270.

Sponsored by: EMC / Isilon Storage Division

8 years agobhyve: Remove unneeded variable ncq.
pfg [Tue, 5 Apr 2016 19:30:19 +0000 (19:30 +0000)]
bhyve: Remove unneeded variable ncq.

ncq was not being inititialized properly but it was not actually
necessary either, so make the code smaller by removing it.

CID: 1248842
Reviewed by: grehan

8 years agoRemove misleading comment. musb supports host mode for more than two years now
gonzo [Tue, 5 Apr 2016 18:07:13 +0000 (18:07 +0000)]
Remove misleading comment. musb supports host mode for more than two years now

Spotted by: jmcneill

8 years agoFix typo. No functional change.
skra [Tue, 5 Apr 2016 13:56:43 +0000 (13:56 +0000)]
Fix typo. No functional change.

8 years agoAdd more DPRINTF() to the ftdi driver. Now everything that can change the
ian [Tue, 5 Apr 2016 13:47:06 +0000 (13:47 +0000)]
Add more DPRINTF() to the ftdi driver.  Now everything that can change the
chip's state has a DPRINTF, with things that happen repeatedly at debug=2
level and things that happen frequently (like per-transfer IO) at debug=3.

8 years agoRework BCM283x gpio interrupt controller for INTRNG. It's used on RPI-B
skra [Tue, 5 Apr 2016 13:45:23 +0000 (13:45 +0000)]
Rework BCM283x gpio interrupt controller for INTRNG. It's used on RPI-B
and RPI2 where INTRNG is already enabled by default.

Differential Revision: https://reviews.freebsd.org/D5810

8 years agoImplement bcm2836 interrupt controller for INTRNG and enable it
skra [Tue, 5 Apr 2016 13:41:51 +0000 (13:41 +0000)]
Implement bcm2836 interrupt controller for INTRNG and enable it
on RPI2 by default.

Differential Revision: https://reviews.freebsd.org/D5822

8 years agoRework bcm283x interrupt controller for INTRNG and enable it
skra [Tue, 5 Apr 2016 13:37:03 +0000 (13:37 +0000)]
Rework bcm283x interrupt controller for INTRNG and enable it
on RPI-B by default.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D5809

8 years agoehci_interrupt is MPSAFE code. Most drivers in tree calls bus_setup_intr
mmel [Tue, 5 Apr 2016 12:13:53 +0000 (12:13 +0000)]
ehci_interrupt is MPSAFE code. Most drivers in tree calls bus_setup_intr
with MPSAFE, some are not. Fix those.

Submitted by: Howard Su <howard0su@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5755

8 years agoUse proper locking macros in RACCT in RCTL.
trasz [Tue, 5 Apr 2016 11:30:52 +0000 (11:30 +0000)]
Use proper locking macros in RACCT in RCTL.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agox86 topo: add some comments, descriptions and references to documentation
avg [Tue, 5 Apr 2016 10:36:40 +0000 (10:36 +0000)]
x86 topo: add some comments, descriptions and references to documentation

Plus a minor cosmetic change.

MFC after: 1 month

8 years agoTEGRA: Fix CPU frequency switching.
mmel [Tue, 5 Apr 2016 09:20:52 +0000 (09:20 +0000)]
TEGRA: Fix CPU frequency switching.
The PLL_X, base CPU frequency source, doesn't have a bypass switch and thus
we must use another frequency source for CPU while changing its frequency.
PLL_P is ideal for this, it runs at 480MHz and CPU can be clocked at this
frequency at any CPU voltage.

8 years agoAdd support for the Microchip mcp7941x.
jhibbits [Tue, 5 Apr 2016 03:27:33 +0000 (03:27 +0000)]
Add support for the Microchip mcp7941x.

This is compatible with the ds1307, but comparing the mcp7941x datasheet vs the
ds1307 code, appears there is one bit placement difference, so that is now
accounted for.

Relnotes: yes

8 years agoMake i2c device child auto-probe work for MPC85xx and QorIQ SoCs.
jhibbits [Tue, 5 Apr 2016 02:27:01 +0000 (02:27 +0000)]
Make i2c device child auto-probe work for MPC85xx and QorIQ SoCs.

OFW i2c probing requires a new method ofw_bus_get_node(), and the bus device is
assumed iichb.  With these changes, i2c devices attached in fdt are probed and
attached automagically.

8 years agoAdd another real-life example of setting a quirk for a USB gaming
wblock [Tue, 5 Apr 2016 01:12:56 +0000 (01:12 +0000)]
Add another real-life example of setting a quirk for a USB gaming
keyboard.  From forum thread: https://forums.freebsd.org/threads/55717/

MFC after: 1 week

8 years agoRemove a redundant check.
jhb [Tue, 5 Apr 2016 00:10:07 +0000 (00:10 +0000)]
Remove a redundant check.

cpu_suspend_map is always empty if smp_started is false.

Sponsored by: Netflix

8 years agoRemove an unneeded check.
jhb [Tue, 5 Apr 2016 00:09:19 +0000 (00:09 +0000)]
Remove an unneeded check.

CPUs with valid per-CPU data are not absent.

Sponsored by: Netflix

8 years agoDon't wakeup the fdc worker thread once a second when idle.
jhb [Tue, 5 Apr 2016 00:08:42 +0000 (00:08 +0000)]
Don't wakeup the fdc worker thread once a second when idle.

The fdc worker thread was using a one second timeout while waiting for
a new bio to arrive or for the device to detach.  However, the driver
already does a wakeup when queueing a new bio or asking the thread to
detach, so the timeout only served to waste CPU time waking up the
thread once a second just so it could go right back to sleep.  Use an
infinite timeout instead.

Discussed with: phk
Sponsored by: Netflix

8 years agoDIRDEPS_BUILD: Use 1 parameter for defining -rpath-link.
bdrewery [Mon, 4 Apr 2016 23:15:57 +0000 (23:15 +0000)]
DIRDEPS_BUILD: Use 1 parameter for defining -rpath-link.

Sponsored by: EMC / Isilon Storage Division

8 years ago[net80211] Add an A-MSDU debug output shortcut.
adrian [Mon, 4 Apr 2016 22:10:52 +0000 (22:10 +0000)]
[net80211] Add an A-MSDU debug output shortcut.

8 years agoAdd early_customize_cmd() that allows to register custom functions run
glebius [Mon, 4 Apr 2016 21:06:44 +0000 (21:06 +0000)]
Add early_customize_cmd() that allows to register custom functions run
before the build stage.

Reviewed by: imp
Obtained from: Netflix

8 years ago[net80211] teach wlanstats about the ff_encapfail field.
adrian [Mon, 4 Apr 2016 20:33:16 +0000 (20:33 +0000)]
[net80211] teach wlanstats about the ff_encapfail field.

Without this it just displays a blank, short column which is just
plainly not useful.