Commit Graph

231716 Commits

Author SHA1 Message Date
Oleksandr Tymoshenko
f7604b1b27 Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_alloc
Change OF_getencprop_alloc semantics to be combination of malloc and
OF_getencprop and return size of the property, not number of elements
allocated.

For the use cases where number of elements is preferred introduce
OF_getencprop_alloc_multi helper function that copies semantics
of OF_getencprop_alloc prior to this change.

This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi
function signatures consistent with OF_getencprop_alloc and
OF_getencprop_alloc_multi.

Functionality-wise this patch is mostly rename of OF_getencprop_alloc
to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo
where 1 was used as a block size.
2018-04-09 22:06:16 +00:00
Ed Maste
c7fb0e1ddf linuxulator: add else case braces to reduce diffs between archs
Sponsored by:	Turing Robotic Industries Inc.
2018-04-09 19:11:24 +00:00
Kyle Evans
2967ace894 Retire the geom_aes class
It's had a good life, but it's not really configurable and not really used.

Obtained from:	opBSD (with some changes)
Differential Revision:	https://reviews.freebsd.org/D14991
2018-04-09 17:30:30 +00:00
Ed Maste
b267239d4b linuxulator: deduplicate linux_exec_imgact_try
Previously linuxulator had three identical copies of
linux_exec_imgact_try.  Deduplicate before adding another arch to
linuxulator.

Sponsored by:	Turing Robotic Industries Inc
Differential Revision:	https://reviews.freebsd.org/D14856
2018-04-09 17:24:01 +00:00
Kyle Evans
9a77a6435f if_awg: Add support for allwinner,{tx,rx}-delay-ps bindings
Split out delay parsing into a separate function; we'll support both
{tx,rx}-delay as well as the new versions.

While here, validate that they're within the expected range and fail to
attach if they are not. Assuming that we can clamp the delay is a bad idea
that might result in a non-working awg anyways, so we'll fail early to make
it easier to catch.

This version also unsets the tx and rx delay registers unconditionally and
then sets them if we read a non-zero delay. These delay properties should
default to 0 if not specified, as declared in the binding documentation.
Presumably the delays will be set via hardware configuration if they're not
explicitly set in FDT.
2018-04-09 14:05:43 +00:00
Edward Tomasz Napierala
7325329436 cfumass(4) no longer requires iscsi(4).
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-04-09 13:32:12 +00:00
Vincenzo Maffione
4f80b14ce2 netmap: align codebase to upstream version v11.4
Changelist:
  - remove unused nkr_slot_flags
  - new nm_intr adapter callback to enable/disable interrupts
  - remove unused sysctls and document the other sysctls
  - new infrastructure to support NS_MOREFRAG for NIC ports
  - support for external memory allocator (for now linux-only),
    including linux-specific changes in common headers
  - optimizations within netmap pipes datapath
  - improvements on VALE control API
  - new nm_parse() helper function in netmap_user.h
  - various bug fixes and code clean up

Approved by:	hrs (mentor)
2018-04-09 09:24:26 +00:00
Oleksandr Tymoshenko
df4531ffd9 [man] Fix return type of BUS_ADD_CHILD(9)
Fix return type of BUS_ADD_CHILD(9) in SYNOPSYS section,
it should be device_t, not int

PR:		207389
MFC after:	3 days
2018-04-09 05:48:12 +00:00
Oleksandr Tymoshenko
c581f24a3b Make OF_searchencprop signature consistent with OF_getencprop
Use pcell_t* as a destination buffer argument instead of void
pointer to be consistent with OF_getencprop signature.
2018-04-09 00:38:24 +00:00
Oleksandr Tymoshenko
b7dc17589b Fix one more OF_getprop_alloc instance missed in r332310
X-MFC-With:	r332310
2018-04-08 23:17:51 +00:00
Oleksandr Tymoshenko
217d17bcd3 Clean up OF_getprop_alloc API
OF_getprop_alloc takes element size argument and returns number of
elements in the property. There are valid use cases for such behavior
but mostly API consumers pass 1 as element size to get string
properties. What API users would expect from OF_getprop_alloc is to be
a combination of malloc + OF_getprop with the same semantic of return
value. This patch modifies API signature to match these expectations.

For the valid use cases with element size != 1 and to reduce
modification scope new OF_getprop_alloc_multi function has been
introduced that behaves the same way OF_getprop_alloc behaved prior to
this patch.

Reviewed by:	ian, manu
Differential Revision:	https://reviews.freebsd.org/D14850
2018-04-08 22:59:34 +00:00
Andrew Turner
9d9889b5eb Replace calls to fdt_is_compatible with ofw_bus_node_is_compatible. These
are almost identical so there is no need to keep the former around.

Sponsored by:	DARPA, AFRL
2018-04-08 22:07:06 +00:00
Oleksandr Tymoshenko
f510c340ce Document ofw_bus_subr helpers "compatible" and "status" properties
Add documentation for following functions:

- ofw_bus_is_compatible
- ofw_bus_is_compatible_strict
- ofw_bus_node_is_compatible
- ofw_bus_search_compatible
- ofw_bus_get_status
- ofw_bus_status_okay
- ofw_bus_node_status_okay

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D14724
2018-04-08 20:53:00 +00:00
Justin Hibbits
b4b4b17687 Fix typo
Reserved cause is 6, not 5.

Reported by:	cem
2018-04-08 19:33:05 +00:00
Rodney W. Grimes
01d822d33b Add the ability to control the CPU topology of created VMs
from userland without the need to use sysctls, it allows the old
sysctls to continue to function, but deprecates them at
FreeBSD_version 1200060 (Relnotes for deprecate).

The command line of bhyve is maintained in a backwards compatible way.
The API of libvmmapi is maintained in a backwards compatible way.
The sysctl's are maintained in a backwards compatible way.

Added command option looks like:
bhyve -c [[cpus=]n][,sockets=n][,cores=n][,threads=n][,maxcpus=n]
The optional parts can be specified in any order, but only a single
integer invokes the backwards compatible parse.  [,maxcpus=n] is
hidden by #ifdef until kernel support is added, though the api
is put in place.

bhyvectl --get-cpu-topology option added.

Reviewed by:	grehan (maintainer, earlier version),
Reviewed by:	bcr (manpages)
Approved by:	bde (mentor), phk (mentor)
Tested by:	Oleg Ginzburg <olevole@olevole.ru> (cbsd)
MFC after:	1 week
Relnotes:	Y
Differential Revision:	https://reviews.freebsd.org/D9930
2018-04-08 19:24:49 +00:00
Poul-Henning Kamp
92223bdded Pedantic polishing of code to please FlexeLint.
Approved by:	ed
2018-04-08 19:23:50 +00:00
Justin Hibbits
ac2605b1d1 Powerpc64: Add the facility unavailable trap subsystem
Summary:
This code adds the basic infrastructure for the facility subsystem. A facility
trap is raised when an unavailable instruction is executed. One example is
executing a Hardware Transactional Memory instruction while the MSR[TM] is
disabled. In the past, there was a specific interrupt for it (FP, VEC), but the
new instructions seem to be multiplexed on this facility interrupt.

The root cause of the trap is provided on Facility Status and Control Register
(FSCR) register.

Submitted by:	Breno Leitao
Reviewed by:	nwhitehorn
Differential Revision: https://reviews.freebsd.org/D14566
2018-04-08 19:11:25 +00:00
Brooks Davis
1a449272a3 Fix LINT (and static COMPAT_LINUX32) after r332122. 2018-04-08 17:10:32 +00:00
Ian Lepore
bc7b44aeaf Allow hinted attachment on FDT-based systems. Instead of returning ENXIO
when the FDT data doesn't enable the device instance, return
BUS_PROBE_NOWILDCARD, the same as for non-FDT systems.
2018-04-08 17:06:30 +00:00
Justin Hibbits
3762bafa7b powerpc64: Print current MSR on printtrap()
Summary:
Print current MSR on printtrap(). Currently, printtrap just prints srr1, which
contains part of the MSR prior to the exception. I find useful to dump the
current value of the MSR, since it changes when there is an interruption.

With this patch, this is the new printtrap model:

handled user trap:

    exception       = 0x700 (program)
    srr0            = 0x100008a0 (0x100008a0)
    srr1            = 0x800000000002f032
    current msr     = 0x8000000000009032
    lr              = 0x1000089c (0x1000089c)
    curthread       = 0x7a50000
	pid = 714, comm = ttrap2

Submitted by:	Breno Leitao
Reviewed by:	nwhitehorn
Differential Revision: https://reviews.freebsd.org/D14600
2018-04-08 16:55:28 +00:00
Justin Hibbits
8238d3423d powerpc64: Avoid calling isync twice
Summary:
It is not necessary to call isync() after calling mtmsr() function, mainly
because the mtmsr() calls 'isync' internally to synchronize the machine state
register. Other than that, isync() just calls the 'isync' instruction, thus,
the 'isync' instruction is being called twice, and that seems to be unnecessary.

This patch just remove the unecessary calls to isync() after mtmsr().

Submitted by:	Breno Leitao
Differential Revision: https://reviews.freebsd.org/D14583
2018-04-08 16:46:24 +00:00
Justin Hibbits
d6d0670814 powerpc/ofw: Fix malloc inside lock
Summary:
Currently ofw_real_bounce_alloc() is requesting memory, using WAITOK, holding a
non-sleepable locks, called 'OF Bounce Page'.

Fix this by allocating the pages outside of the lock, and only updating the
global variables while holding the lock.

Submitted by:	Breno Leitao
Differential Revision:	https://reviews.freebsd.org/D14955
2018-04-08 16:43:56 +00:00
Mateusz Guzik
a045941bd2 locks: tweak backoff a little bit
Previous limits were chosen when locking primitives had spurious lock
accesses.

Flipping the starting point to 1 (or rather 2 as the first call shifts it)
provides a modest win when mild contention is seen while not hurting worse
cases. Tested on a bunch of one, two and four socket old and new systems
(Westmere, Skylake, Threadreaper and others) by doing concurrent page faults,
buildkernel/buildworld and other stuff (although not all systems got all the
tests).

Another thing is the upper limit. It is semi-arbitrarily chosen as it was
getting out of hand for slightly less small systems (e.g. a 128-thread one).

Note that backoff is fundamentally a speculative bandaid and this change just
makes it fit a little bit better. It remains completely oblivious to the
hardware topology or the contention pattern. This is being experimented with.
2018-04-08 16:34:10 +00:00
Andrew Turner
9f56e37dbe Revert r332277, it contained an unintended extra change 2018-04-08 15:21:12 +00:00
Andrew Turner
ae6874eb3f Replace calls to fdt_is_compatible with ofw_bus_node_is_compatible. These
are almost identical so there is no need to keep the former around.

Sponsored by:	DARPA, AFRL
2018-04-08 15:12:36 +00:00
Toomas Soome
74837c798c loader: 332270 did left out stand/i386/loader/loader.rc
we have 2 instances of loader.rc...
2018-04-08 13:40:38 +00:00
Andrew Turner
626a198305 Move fdt_is_type to be a Marvell specific function. It's not used by any
other SoCs.

Sponsored by:	DARPA, AFRL
2018-04-08 12:20:06 +00:00
Michael Tuexen
efcf28ef77 Fix a logical inversion bug.
Thanks to Irene Ruengeler for finding and reporting this bug.

MFC after:	3 days
2018-04-08 12:08:20 +00:00
Toomas Soome
ff77d7a560 loader: 332270 did use wrong path for efi.4th
The correct  path is still /boot/efi.4th
2018-04-08 11:55:27 +00:00
Michael Tuexen
3bcfd10fe1 Small cleanup, no functional change.
MFC after:	3 days
2018-04-08 11:50:06 +00:00
Toomas Soome
cae0ecf693 loader: include efi.4th only if we do have uefi
Also simplify efi.4th.
2018-04-08 11:39:27 +00:00
Michael Tuexen
c3115feb7e Fix a signed/unsigned warning showing up for the userland stack
on some platforms.
Thanks to Felix Weinrank for reporting the issue.

MFC after:i	3 days
2018-04-08 11:37:00 +00:00
Kirk McKusick
f33fbc18f5 Add (intmax_t) type casts to some printf parameters to keep i386 happy. 2018-04-08 07:18:29 +00:00
Kirk McKusick
2a36aee276 When using the fsdb `blocks' command, replace the long and ugly list of
blocks with the much more concise and readable block list shown by the
prtblknos() function imported from tools/diag/prtblknos.
2018-04-08 07:06:12 +00:00
Kirk McKusick
5613df4f66 The ufs_disk_write() function is used to upgrade a read-only descriptor
to a read-write descriptor. Do not close the read-only descriptor until
the read-write is successfully obtained. Before this fix, a failed upgrade
left no usable descriptor with which to work.
2018-04-08 06:59:42 +00:00
Kirk McKusick
0e3f58b661 Split tools/diag/prtblknos into two parts:
main.c - opens disk and processes the argument list
		 of inodes to be printed
	prtblknos.c - prints out the list of blocks used by an inode

This change allows the fsdb program to import prtblknos() to use when
printing out the set of blocks used by an inode.

This program was switched to using the libufs library to ease its
integration with fsdb and any other filesystem utility that might
want to use it in the future.
2018-04-08 06:52:58 +00:00
Kirk McKusick
0c94b53656 Defensive programming when reading inodes in getino().
Specifically check for out-of-range inodes, and whether
return-value pointers are NULL.
2018-04-08 05:15:34 +00:00
Mark Peek
3eeb751122 Update VMCI license based on comments from core, the FreeBSD Foundation,
and VMware legal:
- Add a dual BSD-2 Clause/GPLv2 LICENSE file in the VMCI directory
- Remove the use of "All Rights Reserved"
- Per best practice, remove copyright/license info from Makefile

Reviewed by: imp, emaste, jhb, Vishnu Dasa <vdasa@vmware.com>
Approved by: VMware legal via Mark Peek <markpeek@vmware.com>
Differential Revision:  https://reviews.freebsd.org/D14979
2018-04-08 01:32:56 +00:00
Oleksandr Tymoshenko
91cc58af37 [rpi] Add fdt_pinctrl(4) support to Raspberry Pi GPIO driver
On Raspberry Pi platform GPIO controller also responsible for pins
multiplexing. Pi code predates proper FDT support in FreeBSD so a
lot of pinmux info is hardcoded. This patch:

- Implements pinctl methods in bcm2835_gpio
- Converts all devices with ad-hoc pinmux info to proper pin control
  mechanisms and adds pinmux info in FreeBSD's custom dts files.
- Adds fdt_pinctrl option to RPI2 and RPI-B kernels
- Adds SPI pinmux config to FreeBSD's customization of GNU DTS.

Reviewed by:	imp, manu
Differential Revision:	https://reviews.freebsd.org/D14104
2018-04-08 00:56:19 +00:00
Ian Lepore
1fa996add5 Add a manpage for spigen(4). 2018-04-07 23:31:55 +00:00
Kyle Evans
1e14d6eb3d Add a83t overlays for sid and emac
The sun8i-a83t-bananapi-m3-emac overlay technically doesn't match what will
be coming from upstream. The tx-delay and rx-delay should be specified in
terms of allwinner,tx-delay-ps and allwinner,rx-delay-ps respectively. The
values are still technically correct for what we write in if_awg, and
support for the new bindings will be coming soon.
2018-04-07 22:28:43 +00:00
Ian Lepore
197d784bf3 Cast the data pointer to the correct type for the data being accessed (as
opposed to one that accidentally worked on the one arch I test-compiled for
on my first try).

Reported by:	np@, O. Hartmann <ohartmann@walstatt.org>
Pointy hat:	ian@
2018-04-07 22:21:06 +00:00
Ian Lepore
e973ad2298 Don't check for impossible NULL return from malloc(..., M_WAITOK). 2018-04-07 21:31:09 +00:00
Ian Lepore
9edf7bc8d3 Add the ioctl definitions for spigen get/set spi mode. Should have been
part of r332233.
2018-04-07 20:53:34 +00:00
Ian Lepore
a0e911e097 Add an ioctl to get/set the SPI transfer mode. Also, make the bus clock
frequency ioctl actually set the corresponding ivar instead of just storing
the value locally in the softc (and then not using it for anything).  Also,
return the correct error code if the ioctl cmd is not recognized.
2018-04-07 20:38:01 +00:00
Ian Lepore
948a7ee9d8 Generate a spibus_set_[ivarname]() convenience function for each ivar,
now that they can be set.
2018-04-07 20:34:57 +00:00
Ian Lepore
3b46d8687a Remove the existing identify() hack to force-add a spigen device on
FDT-based systems, and instead add proper FDT probe code.  Because this
driver is freebsd-specific and just provides generic userland access to run
spibus transactions, there is no bindings document to mandate a compatible
string, so just arbitrarily use "freebsd,spigen".
2018-04-07 20:04:03 +00:00
Warner Losh
14ce4632d4 Add nvme_util.c to cam.ko.
cam.ko can't load onto the kernel w/o nvme in the kernel. Add
nvme_util.c to cam.ko.

Noticed by: kib@
2018-04-07 19:29:19 +00:00
Ian Lepore
c951fe9258 Arrange the list of generated sources as 1-per-line alphbetical, and add
the files required when building for FDT-based systems.
2018-04-07 19:09:57 +00:00
Ian Lepore
ade70a1ad1 Return BUS_PROBE_DEFAULT, not zero, because this is not the one driver
implementation that must be used, it's just the base system default driver.

Also add a comment noting that we're being more liberal about the bus
frequency property than the dts binding documents require.
2018-04-07 18:58:58 +00:00