]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agolibibverbs: Fix memory leak in ibv_read_sysfs_file().
slavash [Wed, 5 Dec 2018 13:28:17 +0000 (13:28 +0000)]
libibverbs: Fix memory leak in ibv_read_sysfs_file().

Testing packetdrill using valgrind resulted in finding a memory leak in
ibv_read_sysfs_file(). The attached patch fixes it.

Submitted by: tuexen@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agokrping: Fix for memory leak in error case.
slavash [Wed, 5 Dec 2018 13:27:48 +0000 (13:27 +0000)]
krping: Fix for memory leak in error case.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoipoib: Notify on modify QP failure only when relevant
slavash [Wed, 5 Dec 2018 13:27:17 +0000 (13:27 +0000)]
ipoib: Notify on modify QP failure only when relevant

Modify QP can fail and it can be acceptable, like when moving from RST to
ERR state, all the rest are not acceptable and a message to the log
should be printed.

The current code prints on all failures and many messages like:
"Failed to modify QP to ERROR state" appear, even when supported by the
state machine of the QP object.

Linux commit:
5dc78ad1904db597bdb4427f3ead437aae86f54c

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoipoib: increase the non-cm queue length
slavash [Wed, 5 Dec 2018 13:26:47 +0000 (13:26 +0000)]
ipoib: increase the non-cm queue length

When a packet needs fragmentation, it might generate more than 3 fragments.
With the queue length 3, all fragments are generated faster than the
queue is drained, which effectively drops fourth and later fragments on
the floor.

Submitted by:   kib@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoipoib: Don't do a light flush when MTU is unchanged.
slavash [Wed, 5 Dec 2018 13:26:17 +0000 (13:26 +0000)]
ipoib: Don't do a light flush when MTU is unchanged.

When changing the MTU of ibX network interfaces, check that the MTU was really
changed before requesting an update of the multicast rules. Else we might go
into an infinite loop joining and leaving ibX multicast groups towards the
opensm master interface.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoipoib: correct setting MTU from inside ipoib(4).
slavash [Wed, 5 Dec 2018 13:25:47 +0000 (13:25 +0000)]
ipoib: correct setting MTU from inside ipoib(4).

It is not enough to set ifnet->if_mtu to change the interface MTU.
System saves the MTU for route in the radix tree, and route cache keeps
the interface MTU as well. Since addition of the multicast group causes
recalculation of MTU, even bringing the interface up changes MTU from
4042 to 1500, which makes the system configuration inconsistent. Worse,
ip_output() prefers route MTU over interface MTU, so large packets are
not fragmented and dropped on floor.

Fix it for ipoib(4) using the same approach (or hack) as was applied
for it_tun/if_tap in r339012.  Thanks to bz@ for giving the hint.

Submitted by:   kib@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Fix clearing of bound device interface.
slavash [Wed, 5 Dec 2018 13:25:13 +0000 (13:25 +0000)]
ibcore: Fix clearing of bound device interface.

Binding to a loopback device is not allowed. Make sure the destination
device address is global by clearing the bound device interface.
Only do this conditionally, else link local addresses won't work.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: ip6_dev_find() needs to know the scope ID.
slavash [Wed, 5 Dec 2018 13:24:43 +0000 (13:24 +0000)]
ibcore: ip6_dev_find() needs to know the scope ID.

Else the wrong network device can be returned for link-local addresses.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Fix sleeping in atomic when RoCE is used
slavash [Wed, 5 Dec 2018 13:24:12 +0000 (13:24 +0000)]
ibcore: Fix sleeping in atomic when RoCE is used

A couple of places in the CM do

    spin_lock_irq(&cm_id_priv->lock);
    ...
    if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg))

However when the underlying transport is RoCE, this leads to a sleeping function
being called with the lock held - the callchain is

    cm_alloc_response_msg() ->
      ib_create_ah_from_wc() ->
        ib_init_ah_from_wc() ->
          rdma_addr_find_l2_eth_by_grh() ->
            rdma_resolve_ip()

and rdma_resolve_ip() starts out by doing

    req = kzalloc(sizeof *req, GFP_KERNEL);

not to mention rdma_addr_find_l2_eth_by_grh() doing

    wait_for_completion(&ctx.comp);

to wait for the task that rdma_resolve_ip() queues up.

Fix this by moving the AH creation out of the lock.

Linux commit:
c76161181193985087cd716fdf69b5cb6cf9ee85

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Add missing unref of netdevice.
slavash [Wed, 5 Dec 2018 13:23:44 +0000 (13:23 +0000)]
ibcore: Add missing unref of netdevice.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Fix loopback with rdma-cm.
slavash [Wed, 5 Dec 2018 13:23:14 +0000 (13:23 +0000)]
ibcore: Fix loopback with rdma-cm.

Trying to validate loopback fails because rtalloc1() resolves system
local addresses to the loopback network interface, lo0. Fix this by
explicitly checking for loopback during validation of the source
and destination network address. If the source address belongs to
a local network interface and is equal to the destination address,
there is no need to run the destination address through rtalloc1().

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Make sure all VNETs are scanned for VLAN interfaces.
slavash [Wed, 5 Dec 2018 13:22:43 +0000 (13:22 +0000)]
ibcore: Make sure all VNETs are scanned for VLAN interfaces.

The master network interface and the VLANs may reside in different VNETs.
Make sure that all VNETs are searched when scanning for GID entries.

Submitted by:   netapp
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Always check return value from ib_init_ah_from_wc().
slavash [Wed, 5 Dec 2018 13:22:07 +0000 (13:22 +0000)]
ibcore: Always check return value from ib_init_ah_from_wc().

This prevents code from accepting RoCEv1 connections when
only ROCEv2 is enabled and vice versa.

Linux commit:
0c4386ec77cfcd0ccbdbe8c2e67dd3a49b2a4c7f

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Add missing check for failure.
slavash [Wed, 5 Dec 2018 13:21:20 +0000 (13:21 +0000)]
ibcore: Add missing check for failure.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Fix an array index check
slavash [Wed, 5 Dec 2018 13:20:51 +0000 (13:20 +0000)]
ibcore: Fix an array index check

The array ib_mad_mgmt_class_table.method_table has MAX_MGMT_CLASS
(80) elements. Hence compare the array index with that value instead
of with IB_MGMT_MAX_METHODS (128). This patch avoids that Coverity
reports the following:

Overrunning array class->method_table of 80 8-byte elements at element index 127
(byte offset 1016) using index convert_mgmt_class(mad_hdr->mgmt_class)
(which evaluates to 127).

Linux commit:
2fe2f378dd45847d2643638c07a7658822087836

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Check ib_find_pkey() return value.
slavash [Wed, 5 Dec 2018 13:20:22 +0000 (13:20 +0000)]
ibcore: Check ib_find_pkey() return value.

Linux commit:
d3a2418ee36a59bc02e9d454723f3175dcf4bfd9

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Add support for IB_SPEED_HDR in sysfs rate printout.
slavash [Wed, 5 Dec 2018 13:19:52 +0000 (13:19 +0000)]
ibcore: Add support for IB_SPEED_HDR in sysfs rate printout.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Don't access invalid port.
slavash [Wed, 5 Dec 2018 13:19:21 +0000 (13:19 +0000)]
ibcore: Don't access invalid port.

The port number in the listen_id_priv has been observed to be zero which
means no port has been selected. The current code lacks a check for invalid
port number.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Discard unused error codes.
slavash [Wed, 5 Dec 2018 13:18:50 +0000 (13:18 +0000)]
ibcore: Discard unused error codes.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agoibcore: Make sure GID index variable gets initialized.
slavash [Wed, 5 Dec 2018 13:18:20 +0000 (13:18 +0000)]
ibcore: Make sure GID index variable gets initialized.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agolinuxkpi: Really check if PCI is offline
slavash [Wed, 5 Dec 2018 13:17:45 +0000 (13:17 +0000)]
linuxkpi: Really check if PCI is offline

Currently we always return false if for PCI offline query.
Try to read PCI config, if the return value if 0xffff probably the
PCI is offline.

Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agolinuxkpi: properly implement netif_carrier_ok().
slavash [Wed, 5 Dec 2018 13:17:15 +0000 (13:17 +0000)]
linuxkpi: properly implement netif_carrier_ok().

Submitted by:   kib@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agolinuxkpi: Fix for use-after-free when tearing down character devices.
slavash [Wed, 5 Dec 2018 13:16:39 +0000 (13:16 +0000)]
linuxkpi: Fix for use-after-free when tearing down character devices.

Make sure we hold a reference on the character device for every opened file
to prevent the character device to be freed prematurely.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agolinuxkpi: implement idr_is_empty() and ida_is_empty().
slavash [Wed, 5 Dec 2018 13:15:57 +0000 (13:15 +0000)]
linuxkpi: implement idr_is_empty() and ida_is_empty().

Submitted by:   kib@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies

5 years agonetmap: align codebase to the current upstream (760279cfb2730a585)
vmaffione [Wed, 5 Dec 2018 11:57:16 +0000 (11:57 +0000)]
netmap: align codebase to the current upstream (760279cfb2730a585)

Changelist:
  - Replace netmap passthrough host support with a more general
    mechanism to call TXSYNC/RXSYNC from an in-kernel event-loop.
    No kernel threads are used to use this feature: the application
    is required to spawn a thread (or a process) and issue a
    SYNC_KLOOP_START (NIOCCTRL) command in the thread body. The
    kernel loop is executed by the ioctl implementation, which returns
    to userspace only when a different thread calls SYNC_KLOOP_STOP
    or the netmap file descriptor is closed.
  - Update the if_ptnet driver to cope with the new data structures,
    and prune all the obsolete ptnetmap code.
  - Add support for "null" netmap ports, useful to allocate netmap_if,
    netmap_ring and netmap buffers to be used by specialized applications
    (e.g. hypervisors). TXSYNC/RXSYNC on these ports have no effect.
  - Various fixes and code refactoring.

Sponsored by: Sunny Valley Networks
Differential Revision: https://reviews.freebsd.org/D18015

5 years agoAllow bootstrapping libopenbsd on Linux
arichardson [Wed, 5 Dec 2018 10:58:02 +0000 (10:58 +0000)]
Allow bootstrapping libopenbsd on Linux

The getdtablecount.c file won't compile on Linux but it seems like none of
the bootstrap tools actually need it.

Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D14244

5 years agoFix newvers.sh with BUILD_WITH_STRICT_TMPPATH=1
arichardson [Wed, 5 Dec 2018 10:57:57 +0000 (10:57 +0000)]
Fix newvers.sh with BUILD_WITH_STRICT_TMPPATH=1

newvers.sh runs mkfifo which did not exist before this change.
However, I didn't notice before because it is run from a function
where a missing command does cause a noticeable failure.

Reviewed By: emaste, markj
Differential Revision: https://reviews.freebsd.org/D18377

5 years agoTidy up arm64 reloc_jmpslots() implementation.
mmel [Wed, 5 Dec 2018 10:30:53 +0000 (10:30 +0000)]
Tidy up arm64 reloc_jmpslots() implementation.
- don't relocate jump slots multiple times (if LD_BIND_NOW is defined).
- process only R_AARCH64_JUMP_SLOT here, other relocation types are handled
  by reloc_plt().

MFC after: 1 week

5 years agoImplement arm64 version of __tls_get_addr().
mmel [Wed, 5 Dec 2018 10:23:38 +0000 (10:23 +0000)]
Implement arm64 version of __tls_get_addr().

MFC after: 1 week

5 years agoFix style(9).
mmel [Wed, 5 Dec 2018 10:22:14 +0000 (10:22 +0000)]
Fix style(9).
Not a functional change.

MFC after: 1 week

5 years agoEnsure that cylinder-group check-hashes are properly updated when first
mckusick [Wed, 5 Dec 2018 06:31:50 +0000 (06:31 +0000)]
Ensure that cylinder-group check-hashes are properly updated when first
creating them and when correcting them when they are found to be corrupted.

Reported by:  Don Lewis (truckman@)
Sponsored by: Netflix

5 years agoRemove MD __sys_* private symbols.
brooks [Wed, 5 Dec 2018 00:46:09 +0000 (00:46 +0000)]
Remove MD __sys_* private symbols.

No references to any of these exist in the tree. The list was also
erratic with different architectures exporting different things
(arm64 and riscv exported none).

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18425

5 years agoaltq: manual cleanup after r341507
vangyzen [Tue, 4 Dec 2018 23:53:42 +0000 (23:53 +0000)]
altq:  manual cleanup after r341507

Remove a file that became practically empty.
Fix indentation.

Like r341507, I do not plan to MFC, but anyone else can.

5 years agoaltq: remove ALTQ3_COMPAT code
vangyzen [Tue, 4 Dec 2018 23:46:43 +0000 (23:46 +0000)]
altq: remove ALTQ3_COMPAT code

This code has apparently never compiled on FreeBSD since its
introduction in 2004 (r130365).  It has certainly not compiled
since 2006, when r164033 added #elsif [sic] preprocessor directives.
The code was left in the tree to reduce the diff from upstream (KAME).
Since that upstream is no longer relevant, remove the long-dead code.

This commit is the direct result of:

    unifdef -m -UALTQ3_COMPAT sys/net/altq/*

A later commit will do some manual cleanup.

I do not plan to MFC this.  If that would help you, go for it.

5 years agoext2fs.4: basic updates.
pfg [Tue, 4 Dec 2018 22:51:13 +0000 (22:51 +0000)]
ext2fs.4: basic updates.

Starting with FreeBSD 12 we fully support writing ext4 filesystems.
Mention some features that we don't support while here.

MFC after: 3 days

5 years agoRegen after r341495: Remove NOARGS from oaccept.
brooks [Tue, 4 Dec 2018 21:57:26 +0000 (21:57 +0000)]
Regen after r341495: Remove NOARGS from oaccept.

5 years agoRemove NOARGS from oaccept.
brooks [Tue, 4 Dec 2018 21:56:45 +0000 (21:56 +0000)]
Remove NOARGS from oaccept.

This was in the orignal patch, but lost in a rebase.

Reported by: andrew
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15816

5 years agoAnother attempt to fix issue with the DIOCGDELETE ioctl(2) not
sobomax [Tue, 4 Dec 2018 21:48:56 +0000 (21:48 +0000)]
Another attempt to fix issue with the DIOCGDELETE ioctl(2) not
handling slightly out-of-bound requests properly (r340187).
Perform range check here rather then rely on g_delete_data() to DTRT.

The g_delete_data() would always return success for requests
starting just the next byte after providers media boundary.

MFC after: 4 weeks

5 years agoOnly gnu/lib/csu when MK_BSD_CRTBEGIN is off.
andrew [Tue, 4 Dec 2018 18:51:28 +0000 (18:51 +0000)]
Only gnu/lib/csu when MK_BSD_CRTBEGIN is off.

We were still building it from Makefile.inc1. Disable it there so we don't
try to build the GNU crtbegin/crtend when the BSD version was asked for.

PR: 233733
Reported by: lwhsu
Reviewed by: emaste
MFC with: r339738
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18428

5 years agoAlways treat firmware request and response sizes as unsigned.
gordon [Tue, 4 Dec 2018 18:28:25 +0000 (18:28 +0000)]
Always treat firmware request and response sizes as unsigned.

This fixes an incomplete bounds check on the guest-supplied request
size where a very large request size could be interpreted as a negative
value and not be caught by the bounds check.

Submitted by: jhb
Reported by: Reno Robert
Approved by: so
Security: FreeBSD-SA-18:14.bhyve
Security: CVE-2018-17160

5 years agoRegen after r341474: Normalize COMPAT_43 syscall declarations.
brooks [Tue, 4 Dec 2018 16:49:14 +0000 (16:49 +0000)]
Regen after r341474: Normalize COMPAT_43 syscall declarations.

5 years agoNormalize COMPAT_43 syscall declarations.
brooks [Tue, 4 Dec 2018 16:48:47 +0000 (16:48 +0000)]
Normalize COMPAT_43 syscall declarations.

Have ogetkerninfo, ogetpagesize, ogethostname, osethostname, and oaccept
declare o<foo>_args structs rather than non-compat ones. Due to a
failure to use NOARGS in most cases this adds only one new declaration.

No changes required in freebsd32 as only ogetpagesize() is implemented
and it has a 32-bit specific implementation.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15816

5 years agoFix args cross-threading between gptboot(8) and loader(8) with zfs support.
ian [Tue, 4 Dec 2018 16:43:50 +0000 (16:43 +0000)]
Fix args cross-threading between gptboot(8) and loader(8) with zfs support.

When loader(8) is built with zfs support enabled, it assumes that any extarg
data present is a zfs_boot_args struct, but if the first-stage loader was
gptboot(8) the extarg data is actually a geli_boot_args struct.  Luckily,
zfsboot(8) and gptzfsboot(8) have always passed KARGS_FLAGS_ZFS along with
KARGS_FLAGS_EXTARG, so we can use KARGS_FLAGS_ZFS to decide whether the
extarg data is a zfs_boot_args struct.

To avoid similar problems in the future, gptboot(8) now passes a new
KARGS_FLAGS_GELI to indicate that extarg data is geli_boot_args.  In
loader(8), if the neither KARGS_FLAGS_ZFS nor KARGS_FLAGS_GELI is set but
extarg data is present (which will be the case for gptboot compiled before
this change), we now check for the known size of the geli_boot_args struct
passed by the older versions of gptboot as a way of confirming what type of
extarg data is present.

In a semi-related tidying up, since loader's main() has already decided
what type of extarg data is present and set the global 'zargs' var
accordingly, don't repeat the check in extract_currdev, just check whether
zargs is NULL or not.

X-MFC after: a few days, along with prior related changes.

5 years agoAdd ability to request listing and deleting only for dynamic states.
ae [Tue, 4 Dec 2018 16:12:43 +0000 (16:12 +0000)]
Add ability to request listing and deleting only for dynamic states.

This can be useful, when net.inet.ip.fw.dyn_keep_states is enabled, but
after rules reloading some state must be deleted. Added new flag '-D'
for such purpose.

Retire '-e' flag, since there can not be expired states in the meaning
that this flag historically had.

Also add "verbose" mode for listing of dynamic states, it can be enabled
with '-v' flag and adds additional information to states list. This can
be useful for debugging.

Obtained from: Yandex LLC
MFC after: 2 months
Sponsored by: Yandex LLC

5 years agoReimplement how net.inet.ip.fw.dyn_keep_states works.
ae [Tue, 4 Dec 2018 16:01:25 +0000 (16:01 +0000)]
Reimplement how net.inet.ip.fw.dyn_keep_states works.

Turning on of this feature allows to keep dynamic states when parent
rule is deleted. But it works only when the default rule is
"allow from any to any".

Now when rule with dynamic opcode is going to be deleted, and
net.inet.ip.fw.dyn_keep_states is enabled, existing states will reference
named objects corresponding to this rule, and also reference the rule.
And when ipfw_dyn_lookup_state() will find state for deleted parent rule,
it will return the pointer to the deleted rule, that is still valid.
This implementation doesn't support O_LIMIT_PARENT rules.

The refcnt field was added to struct ip_fw to keep reference, also
next pointer added to be able iterate rules and not damage the content
when deleted rules are chained.

Named objects are referenced only when states are going to be deleted to
be able reuse kidx of named objects when new parent rules will be
installed.

ipfw_dyn_get_count() function was modified and now it also looks into
dynamic states and constructs maps of existing named objects. This is
needed to correctly export orphaned states into userland.

ipfw_free_rule() was changed to be global, since now dynamic state can
free rule, when it is expired and references counters becomes 1.

External actions subsystem also modified, since external actions can be
deregisterd and instances can be destroyed. In these cases deleted rules,
that are referenced by orphaned states, must be modified to prevent access
to freed memory. ipfw_dyn_reset_eaction(), ipfw_reset_eaction_instance()
functions added for these purposes.

Obtained from: Yandex LLC
MFC after: 2 months
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17532

5 years agoggated: do not expose stack data in sendfail()
emaste [Tue, 4 Dec 2018 15:25:15 +0000 (15:25 +0000)]
ggated: do not expose stack data in sendfail()

admbugs: 590
Submitted by: Fabian Keil <fk@fabiankeil.de>
Obtained from: ElectroBSD

5 years agoAdd assertion to check that named object has correct type.
ae [Tue, 4 Dec 2018 15:12:28 +0000 (15:12 +0000)]
Add assertion to check that named object has correct type.

Obtained from: Yandex LLC
MFC after: 1 week

5 years agoRestore /var/crash permissions to 0750, as declared in mtree file. After
garga [Tue, 4 Dec 2018 12:34:22 +0000 (12:34 +0000)]
Restore /var/crash permissions to 0750, as declared in mtree file. After
r337337 it changed to 0755.

Reviewed by: loos
Approved by: loos
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D18355

5 years agoAs part of the general cleanup of the ipfilter code, special cases
cy [Tue, 4 Dec 2018 06:11:04 +0000 (06:11 +0000)]
As part of the general cleanup of the ipfilter code, special cases
are committed separately to document fixing them separately from
the general cleanup. In this case we don't want to hide the utter
brokenness of what is being fixed.

Clean up a discombobulated block of #if's, with one block unreachable.
ip_fil.c is used in ipftest which is used to dry-run test ipfilter
rules in userspace without loading them in the kernel. The call to
(*ifp->if_output) matches that in the FreeBSD kernel.

Further testing and work will be required to make ipftest fully
functional.

MFC after: 1 week

5 years agoSprinkle EARLY_DRIVER_MODULE around the tree
jhibbits [Tue, 4 Dec 2018 04:55:49 +0000 (04:55 +0000)]
Sprinkle EARLY_DRIVER_MODULE around the tree

Mark some buses as BUS_PASS_BUS, and some resources as BUS_PASS_RESOURCE.
This also decouples some resource attachment orderings from being races by
device tree ordering, instead relying on the bus pass to provide the
ordering.

This was originally intended to support multipass suspend/resume, but it's
also needed on PowerMacs when using fdt, as the device tree seems to get
created in reverse of the OFW tree.
Reviewed by: nwhitehorn (long ago)
Differential Revision: https://reviews.freebsd.org/D918

5 years agopowerpc: preload_addr_relocate is no longer necessary for booke
jhibbits [Tue, 4 Dec 2018 03:51:10 +0000 (03:51 +0000)]
powerpc: preload_addr_relocate is no longer necessary for booke

The same behavior was moved to machdep.c, paired with AIM's relocation,
making this redundant.  With this, it's now possible to boot FreeBSD with
ubldr on a uboot Book-E platform, even with a
KERNBASE != VM_MIN_KERNEL_ADDRESS.

5 years agoRevert r340997 at the request of multiple users.
sbruno [Tue, 4 Dec 2018 03:23:14 +0000 (03:23 +0000)]
Revert r340997 at the request of multiple users.
- breaks ports-mgmt/pkg build for mips64, powerpc64 and i386 for some users.

--- pkg-static ---
/usr/lib/liblzma.a(stream_encoder_mt.o): In function `mythread_cond_init':
/usr/local/poudriere/jails/ppc64/usr/src/contrib/xz/src/common/mythread.h:230:
undefined reference to `pthread_condattr_init'

Reported by: jhibbits zeising

5 years agoRemove test for KSE (removed in 2008).
brooks [Tue, 4 Dec 2018 00:22:08 +0000 (00:22 +0000)]
Remove test for KSE (removed in 2008).

Approved by: julian

5 years agoRemove a needlessly clever hack to start init with sys_exec().
brooks [Tue, 4 Dec 2018 00:15:47 +0000 (00:15 +0000)]
Remove a needlessly clever hack to start init with sys_exec().

Construct a struct image_args with the help of new exec_args_*() helper
functions and call kern_execve().

The previous code mapped a page in userspace, copied arguments out
to it one at a time, and then constructed a struct execve_args all so
that sys_execve() can call exec_copyin_args() to copy the data back in
to a struct image_args.

Opencode the part of pre_execve()/post_execve() that releases a
reference to the initial vmspace. We don't need to stop threads like
they do.

Reviewed by: kib, jhb (prior version)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D15469

5 years agoPrint type designator 'D' for the KF_TYPE_DEV files.
kib [Mon, 3 Dec 2018 23:42:04 +0000 (23:42 +0000)]
Print type designator 'D' for the KF_TYPE_DEV files.

No type-specific data is provided by the kernel.

Sponsored by: Mellanox Technologies
MFC after: 1 week

5 years agoImprove procstat reporting for the linux cdev file descriptors.
kib [Mon, 3 Dec 2018 23:39:45 +0000 (23:39 +0000)]
Improve procstat reporting for the linux cdev file descriptors.

If there is a vnode attached to the linux file, use it to fill
kinfo_file.  Otherwise, report a new KF_TYPE_DEV file type, without
supplying any type-specific information.

KF_TYPE_DEV is supposed to be used by most devfs-specific file types.

Sponsored by: Mellanox Technologies
MFC after: 1 week

5 years agomkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.
yuripv [Mon, 3 Dec 2018 22:31:57 +0000 (22:31 +0000)]
mkisoimages.sh: don't use -p flag when copying loader.efi to msdosfs.

This fixes 'cdrom' target in the case when world was built by user,
and not root.

Reviewed by: imp
Differential revision: https://reviews.freebsd.org/D18414

5 years agoRemove declarations of syscalls not used in libthr.
brooks [Mon, 3 Dec 2018 22:09:23 +0000 (22:09 +0000)]
Remove declarations of syscalls not used in libthr.

Reviewed by: kib
Sponsored by: DARPA, AFRL

5 years agoAdd a missing definition for the !COMPAT_FREEBSD32 case.
markj [Mon, 3 Dec 2018 21:07:10 +0000 (21:07 +0000)]
Add a missing definition for the !COMPAT_FREEBSD32 case.

Reported by: jenkins
MFC with: r341442
Sponsored by: The FreeBSD Foundation

5 years agoPlug memory disclosures via ptrace(2).
markj [Mon, 3 Dec 2018 20:54:17 +0000 (20:54 +0000)]
Plug memory disclosures via ptrace(2).

On some architectures, the structures returned by PT_GET*REGS were not
fully populated and could contain uninitialized stack memory.  The same
issue existed with the register files in procfs.

Reported by: Thomas Barabosch, Fraunhofer FKIE
Reviewed by: kib
MFC after: 3 days
Security: kernel stack memory disclosure
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18421

5 years agoSome fixes for LD_BIND_NOW + ifuncs.
kib [Mon, 3 Dec 2018 20:03:43 +0000 (20:03 +0000)]
Some fixes for LD_BIND_NOW + ifuncs.

- Do not perform ifunc relocations together with other PLT relocations
  in PLT.  Instead, do it during an additional pass over the init
  list, so that ifuncs are resolved in the order of dso
  dependencies. This allows the ifuncs resolvers to call into depended
  libs.  Init list now includes all objects instead of only objects
  with init/fini callables.
- Disable relro protection around bind_now ifunc relocations.

I considered calling ifunc resolvers of dso after initializers of all
dependencies are processed, and decided that this is wrong/should not
be supported. The order now is normal relocations for all
objects->ifunc resolution in init order->initializers, where each step
does complete pass over all loaded objects before moving to the next
step.

Reported, tested and reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18400

5 years agoClarify that /dev/kmem is not used.
sevan [Mon, 3 Dec 2018 20:01:51 +0000 (20:01 +0000)]
Clarify that /dev/kmem is not used.
Move cross ref to right place while here.

Submitted by: kib
MFC after: 7 days

5 years agoProvide naive but self-contained implementations of memset(3) and
kib [Mon, 3 Dec 2018 19:55:55 +0000 (19:55 +0000)]
Provide naive but self-contained implementations of memset(3) and
bzero(3) for rtld.

This again reduces rtld dependency on libc, and in future, avoid ifunc
relocations when the functions are converted to ifuncs in libc.

Reported by: mjg
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18400

5 years agozfs: we can boot from dataset with large_dnode enabled
tsoome [Mon, 3 Dec 2018 19:35:21 +0000 (19:35 +0000)]
zfs: we can boot from dataset with large_dnode enabled

loader has been supporting large_dnode for some time, no need to block the
feature for boot dataset.

Reviewed by: avg
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18391

5 years agostand/i386: rename .s to .S to use Clang IAS
emaste [Mon, 3 Dec 2018 19:16:34 +0000 (19:16 +0000)]
stand/i386: rename .s to .S to use Clang IAS

As part of the migration away from obsolete binutils we want to retire
GNU as.  Most assembly files used on amd64 have a .S extension and
(via rules in share/mk/bsd.suffixes.mk) are assembled with Clang's
Integrated Assembler (IAS).  Rename files in stand/i386 to .S to use
the integrated assembler.

Clang's IAS supports the defsym option (via -Wa,) but only with one
dash, not two.  As both -defsym and --defsym are accepted by GNU as,
use the former.

PR: 233611
Reviewed by: tsoome
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18369

5 years agoNote these tools use kvm(3) and not procfs as in Solaris.
sevan [Mon, 3 Dec 2018 18:00:46 +0000 (18:00 +0000)]
Note these tools use kvm(3) and not procfs as in Solaris.

Obtained from: NetBSD
MFC after: 7 days

5 years agoMove inclusion of src.opts.mk later.
imp [Mon, 3 Dec 2018 17:51:10 +0000 (17:51 +0000)]
Move inclusion of src.opts.mk later.

src.opts.mk includes bsd.own.mk. This in turn defines CTFCONVERT_CMD
depending on the MK_CTF value. We then set MK_CTF to no, which has no
real effect. The solution is to set all the MK_foo values before
including src.opts.mk.

This should stop the cdboot binary from exploding in size for releases
built WITH_CTF=yes in src.conf.

Sponsored by: Netflix

5 years agonetmap(4): improve man page
vmaffione [Mon, 3 Dec 2018 17:17:59 +0000 (17:17 +0000)]
netmap(4): improve man page

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D18057

5 years agodisable BIND_NOW in libc, libthr, and rtld
emaste [Mon, 3 Dec 2018 15:59:46 +0000 (15:59 +0000)]
disable BIND_NOW in libc, libthr, and rtld

An issue remains with BIND_NOW and processes using threads.  For now,
restore libc's BIND_NOW disable, and also disable BIND_NOW in rtld and
libthr.

A patch is in review (D18400) that likely fixes this issue, but just
disable BIND_NOW pending further testing after it is committed.

PR: 233333
Sponsored by: The FreeBSD Foundation

5 years agoUse less misleading directory name.
trasz [Mon, 3 Dec 2018 13:15:54 +0000 (13:15 +0000)]
Use less misleading directory name.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoDisable the BSD CRT code on powerpc and sparc64, they need extra crt*.o
andrew [Mon, 3 Dec 2018 09:40:37 +0000 (09:40 +0000)]
Disable the BSD CRT code on powerpc and sparc64, they need extra crt*.o
files that haven't been implemented.

Reported by: sbruno
MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agopowerpc: Check for a fdt in the metadata if it doesn't already exist
jhibbits [Mon, 3 Dec 2018 04:56:06 +0000 (04:56 +0000)]
powerpc: Check for a fdt in the metadata if it doesn't already exist

It's possible the fdt pointer was passed in via the metadata, as is done in
ubldr.  Check for the fdt here, instead of working with a NULL fdt, and
panicking.

5 years agopowerpc/booke: Check for the metadata address by physical address
jhibbits [Mon, 3 Dec 2018 04:47:28 +0000 (04:47 +0000)]
powerpc/booke: Check for the metadata address by physical address

The metadata pointer will almost never be at or above 'btext', as btext is a
relocated symbol, so will be based at VM_MIN_KERNEL_ADDRESS, not at
KERNBASE.  Check the address against kernload, where the kernel is
physically loaded.

5 years agoEliminate duplicated code and struct member definitions in the handoff
ian [Mon, 3 Dec 2018 03:58:30 +0000 (03:58 +0000)]
Eliminate duplicated code and struct member definitions in the handoff
of args data between gptboot/zfsboot and loader(8).

Despite what seems like a lot of changes here, there are no actual
changes in behavior, or in the data layout in the structures involved.
This is just eliminating identical code pasted into multiple locations.

In detail, the changes are...

- Move struct zfs_boot_args definition from libsa/zfs/libzfs.h to
  i386/common/bootargs.h because it is specific to x86 booting and the
  handoff between zfsboot and loader, and has no relation to the zfs
  library code in general.

- The geli_boot_args and zfs_boot_args structs both contain an identical
  set of member variables containing geli information.  Extract this out
  to a new geli_boot_data struct, and embed it in the arg-passing structs.

- Provide new routines geli_import_boot_data() and geli_export_boot_data()
  that can be shared between gptboot, zfsboot, and loader instead of
  pasting identical code into several different .c files.

- Remove some checks for a NULL pointer that can never be true because the
  pointer being tested was set using pointer math (kargs + 1) and that can
  never result in NULL in this code.

5 years agoFix typo in comment
imp [Sun, 2 Dec 2018 23:13:45 +0000 (23:13 +0000)]
Fix typo in comment

Sponsored by: Netflix

5 years agoDelete the undocumented alias 'wds'.
imp [Sun, 2 Dec 2018 23:13:35 +0000 (23:13 +0000)]
Delete the undocumented alias 'wds'.

This was a typo for wdc. Eliminate it since it was in error. People
should use either 'wdc' or 'hgst' for the vendor from now on. 'hgst'
works for all versions this functionality is present for.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403

5 years agoMove Intel specific log pages to intel.c
imp [Sun, 2 Dec 2018 23:13:24 +0000 (23:13 +0000)]
Move Intel specific log pages to intel.c

Move the Intel specific log pages (including the one that samsung
implements) to intel.c. Add comment to the samsung vendor that it will
be going away soon.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403

5 years agoUsage cleanup pt 2
imp [Sun, 2 Dec 2018 23:13:12 +0000 (23:13 +0000)]
Usage cleanup pt 2

Eliminage redundant spaces and nvmecontrol at start of all the usage
strings. Update the usage printing code to add them back when
presenting to the user. Allow multi-line usage messages and print
proper leading spaces for lines starting with a space.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403

5 years agoUsage cleanup pt 1
imp [Sun, 2 Dec 2018 23:12:58 +0000 (23:12 +0000)]
Usage cleanup pt 1

Provide a usage() function that takes a struct nvme_function pointer
and produces a usage mssage. Eliminate all now-redundant usage
functions. Propigate the new argument through the program as needed.
Use common routine to print usage.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403

5 years agoReturn after we find the dispatched function.
imp [Sun, 2 Dec 2018 23:12:48 +0000 (23:12 +0000)]
Return after we find the dispatched function.

If the dispatched function doesn't exit, then we get can get a
spurious function not found message. They all do exit, but this is a
little cleaner.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403

5 years agoMove the hgst/wdc log page printing code into wdc.c
imp [Sun, 2 Dec 2018 23:12:37 +0000 (23:12 +0000)]
Move the hgst/wdc log page printing code into wdc.c

These are all hgst/wdc specific, so move them into the wdc.c to live
with the wdc command.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403

5 years agoMove common logpage routines into nvmecontrol.h
imp [Sun, 2 Dec 2018 23:12:26 +0000 (23:12 +0000)]
Move common logpage routines into nvmecontrol.h

For the upcoming move of vendor specific code into vendor specific
files, make the common logpage routines global and move them to
nvmecontrol.h.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403

5 years agoMake logpage functions a linker set.
imp [Sun, 2 Dec 2018 23:12:16 +0000 (23:12 +0000)]
Make logpage functions a linker set.

Move logpage function def to header. Convert all the logpage_function
elements to elements of the linker set. Leave them all in logpage.c
for the moment.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403

5 years agoMove nvmecontrol to using linker sets for commands
imp [Sun, 2 Dec 2018 23:10:55 +0000 (23:10 +0000)]
Move nvmecontrol to using linker sets for commands

More commands will be added to nvmecontrol. Also, there will be a few
more vendor commands (some of which may need to remain private to
companies writing them). The first step on that journey is to move to
using linker sets to dispatch commands. The next step will be using
dlopen to bring in the .so's that have the command that might need
to remain private for seamless integration.

Similar changes to this will be needed for vendor specific log pages.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403

5 years agoFix PCI driver unload for Marvell PCI controller
gonzo [Sun, 2 Dec 2018 21:58:36 +0000 (21:58 +0000)]
Fix PCI driver unload for Marvell PCI controller

Add generic implementation for bus_deactivate_resource method. Without
it bus_release_resource fails with "Failed to release active resource"
message

MFC after: 1 week

5 years agoBuild the dtb for the rock64 board.
andreast [Sun, 2 Dec 2018 19:36:20 +0000 (19:36 +0000)]
Build the dtb for the rock64 board.

Reviewed by: manu@

5 years agoAdd rule to build the dtb for the rock64 board.
andreast [Sun, 2 Dec 2018 19:35:22 +0000 (19:35 +0000)]
Add rule to build the dtb for the rock64 board.

Reviewed by: manu@

5 years agoFix off-by-one (page) errors in checks in d_mmap methods of several drivers.
kib [Sun, 2 Dec 2018 18:30:58 +0000 (18:30 +0000)]
Fix off-by-one (page) errors in checks in d_mmap methods of several drivers.

Reported by: C Turt <ecturt@gmail.com>
Reviewed by: alc, markj
admbug: 781
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoAdd a comment noting that the additional range checks are not needed.
kib [Sun, 2 Dec 2018 13:29:13 +0000 (13:29 +0000)]
Add a comment noting that the additional range checks are not needed.

The object size is set in the dsp_mmap_single() which provides the
range limit by vm_fault().

Reported by: C Turt <ecturt@gmail.com>
Reviewed by: alc, markj
admbug: 781
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoFix off by one in hpet_mmap() csw method.
kib [Sun, 2 Dec 2018 13:27:36 +0000 (13:27 +0000)]
Fix off by one in hpet_mmap() csw method.

Reported by: C Turt <ecturt@gmail.com>
Reviewed by: alc, markj
Tested by: pho
admbug: 781
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoChange the vm_ooffset_t type to unsigned.
kib [Sun, 2 Dec 2018 13:16:46 +0000 (13:16 +0000)]
Change the vm_ooffset_t type to unsigned.

The type represents byte offset in the vm_object_t data space, which
does not span negative offsets in FreeBSD VM.  The change matches byte
offset signess with the unsignedness of the vm_pindex_t which
represents the type of the page indexes in the objects.

This allows to remove the UOFF_TO_IDX() macro which was used when we
have to forcibly interpret the type as unsigned anyway.  Also it fixes
a lot of implicit bugs in the device drivers d_mmap methods.

Reviewed by: alc, markj (previous version)
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoCorrect accuracy of the barrier writes accounting.
kib [Sun, 2 Dec 2018 12:53:39 +0000 (12:53 +0000)]
Correct accuracy of the barrier writes accounting.

Discussed with: mckusick
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoReturn computed real memory size, not a value from similarly named
mmel [Sun, 2 Dec 2018 07:39:16 +0000 (07:39 +0000)]
Return computed real memory size, not a value from similarly named
global variable.

MFC after: 1 week

5 years agoUnbreak geli/gmirror testcases if their geom classes cannot be loaded
asomers [Sun, 2 Dec 2018 05:06:37 +0000 (05:06 +0000)]
Unbreak geli/gmirror testcases if their geom classes cannot be loaded

The problem with the logic prior to this commit was twofold:

1. The wrong set of idioms (TAP-compatible) were being applied to the ATF
   testcases when run, resulting in confusing ATF failure results on setup.
2. The cleanup subroutines were broken when the geom classes could not be
   loaded as they exited with 0 unexpectedly.

This commit changes the test code to source the class-specific configuration
(conf.sh) once globally, instead of sourcing it per testcase and per cleanup
subroutine, and to call the ATF-specific setup subroutine(s) inline in
the testcases.

The refactoring done is effectively a no-op for the TAP testcases, modulo
any refactoring done to create common code between the ATF and TAP
testcases.

This unbreaks the geli testcases converted to ATF in r327662 and r327683,
and the gmirror testcases added in r327780, respectively, when the geom
class could not be loaded.

tests/sys/geom/class/mirror/...
    While here, ignore errors when turning debug failpoint sysctl off, which
    could occur if the gmirror class was not loaded.

Submitted by: ngie
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd/pull/241

5 years agoubldr: Force 'usefdt' variable to 1 for powerpc
jhibbits [Sun, 2 Dec 2018 02:20:35 +0000 (02:20 +0000)]
ubldr: Force 'usefdt' variable to 1 for powerpc

The fdt is gated, on powerpc, with a 'usefdt' environment variable.  Force
enable it in ubldr, so that the fdt is passed through the metadata.

5 years agoRemove some dead code from the geli tests
asomers [Sun, 2 Dec 2018 00:41:43 +0000 (00:41 +0000)]
Remove some dead code from the geli tests

This is detritus in the Makefile, leftover from 327662.

MFC after: 2 weeks

5 years agopmcr: Fix pstate setting on Power8
cem [Sat, 1 Dec 2018 21:37:47 +0000 (21:37 +0000)]
pmcr: Fix pstate setting on Power8

Fix p-state setting on Power8 by removing the accidental double-indirection of
the pstate_ids table.

The pstate_ids table comes from the OF property "ibm,pstate-ids."  On Power9,
the values happen to be identical to the indices, so the extra indirection was
harmless.  On Power8, the values were out of the range [0, npstates], so
pmcr_set() would fail the spec[0] range check with EINVAL.

While here, include both the value and index in the driver-specific register
array as spec[0] and spec[1] respectively.  They're redundant, but relatively
harmless, and it may aid debugging.

While here, fix the range check to exclude the index npstates, which is one
past the last valid index.

PR: 233693
Reported and tested by: sbruno
Reviewed by: jhibbits

5 years agoRestore build of the kernel, removed through r341377
cem [Sat, 1 Dec 2018 21:28:05 +0000 (21:28 +0000)]
Restore build of the kernel, removed through r341377

Turns out we already had a path_mtu_discovery variable.

X-MFC-with: r341377

5 years agoFix PowerPC64 ELFv1-specific problem in __elf_phdr_match_addr() leading to crash
jhibbits [Sat, 1 Dec 2018 20:39:20 +0000 (20:39 +0000)]
Fix PowerPC64 ELFv1-specific problem in __elf_phdr_match_addr() leading to crash
in threaded programs that unload libraries.

Summary:
The GNOME update to 3.28 exposed a bug in __elf_phdr_match_addr(), which leads
to a crash when building devel/libsoup on powerpc64.

Due to __elf_phdr_match_addr() limiting its search to PF_X sections, on the
PPC64 ELFv1 ABI, it was never matching function pointers properly.

This meant that libthr was never cleaning up its atfork list in
__pthread_cxa_finalize(), so if a library with an atfork handler was unloaded,
libthr would crash on the next fork.

Normally, the null pointer check it does before calling the handler would avoid
this crash, but, due to PPC64 ELFv1 using function descriptors instead of raw
function pointers, a null check against the pointer itself is insufficient, as
the pointer itself was not null, it was just pointing at a function descriptor
that had been zeroed. (Which is an ABI violation.)

Calling a zeroed function descriptor on PPC64 ELFv1 causes a jump to address 0
with a zeroed r2 and r11.

Submitted by: git_bdragon.rtk0.net
Reviewed By: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18364

5 years agoAdd Silergy SYR827 PMIC driver
manu [Sat, 1 Dec 2018 20:31:49 +0000 (20:31 +0000)]
Add Silergy SYR827 PMIC driver

SYR827 is a PMIC that can output a voltage from 0.7125V to 1.5V in 12.5mV steps
It's controlled via I2C.

MFC after: 1 month