Commit Graph

220221 Commits

Author SHA1 Message Date
pfg
5c1c83ba38 dump: use NULL instead of zero for pointers.
Clean out the casts from calloc(3) while here.
2016-04-19 19:13:33 +00:00
pfg
d3a3a92848 fsck_msdosfs: use NULL instead of zero for pointers. 2016-04-19 19:08:37 +00:00
pfg
ab3928d0fe rtld-elf: use NULL instead of zero for pointers. 2016-04-19 19:03:55 +00:00
sbruno
2a633810e8 aacraid(4): Sanely copyin userland pointers and ensure that we don't get
anything janky from a user. (cturt)

aac(4): landergriffith+freebsdbugzilla@gmail.com pointed out that aacraid(4)
had the same issue and handling of pointers, so let's change that too.

PR:		206573
Submitted by:	cturt@hardenedbsd.org
Obtained from:	HardenedBSD
MFC after:	1 week
2016-04-19 18:27:28 +00:00
sbruno
edd3a7f3f9 Plug memory leak in ctl(4) when ctl_copyin_args() is called with a non-
null terminated ASCII string.

PR:		207626
Submitted by:	cturt@hardenedbsd.org
MFC after:	2 days
2016-04-19 16:48:14 +00:00
adrian
7b1f91ce8b [bhnd] Standardize bhnd device tables and quirk matching.
This add a bhnd device table mechanism that standardizes matching of
devices on the bhnd(4) bus, discovery of device quirk flags, and should
be pluggable into the new PNPINFO machinery.

Submitted by:	Landon Fuller <landonf@landonf.org>
Differential Revision:	https://reviews.freebsd.org/D5759
2016-04-19 15:56:39 +00:00
adrian
240c5e5159 [bhnd] Clean up bhnd resource handling and inherited bus methods
To facilitate use by SoC implementors working with bhnd-inheriting fdt/nexus
drivers:

* Splits bhnd_bus method implementations into generic bus implementations
  (bhnd_bus_generic) and generic bhnd(4) driver implementations (bhnd_generic)
* Simplifies bhnd resource handling, allowing bhnd bus implementations to
  support bhnd resource activation by implementing the standard BUS_*
  resource APIs and BHND_BUS_ACTIVATE_RESOURCE().

Submitted by:	Landon Fuller <landonf@landonf.org>
Differential Revision:	https://reviews.freebsd.org/D5758
2016-04-19 15:53:57 +00:00
adrian
d094c9b381 [bhnd] Add support for specifying the address space used by bhndb children
This adds support for specifying the address space used by a bridge child;
this will either be the bridged SoC address space, or the host address space
required by children that map non SoC-address ranges from the PCI BAR.

This is necessary to support SROM/OTP child devices that live directly
beneath the bhndb device and require access to host resources, instead
of the standard behavior of delegating access to the bridged SoC address
space.

Submitted by:	Landon Fuller <landonf@landonf.org>
Differential Revision:	https://reviews.freebsd.org/D5757
2016-04-19 15:52:55 +00:00
allanjude
9f3ad97e48 Fix pc98 build error introduced in r298230
Submitted by:	Toomas Soome <tsoome@me.com>
Spotted by:	bz
Differential Revision:	https://reviews.freebsd.org/D6002
2016-04-19 15:46:21 +00:00
br
97143cf924 Revert r298268 (Add optional chip_select/deselect methods).
None of supported hardware do require that.
2016-04-19 15:39:46 +00:00
br
d5e156f98e Assert CS for single transfers. 2016-04-19 15:36:18 +00:00
loos
5404d56e14 Use GPIOTOGGLE to toggle the pin state instead of read, modify and write. 2016-04-19 15:18:31 +00:00
trasz
41d99db047 Mention fsck_ffs -E in tunefs(8). It's non-obvious that one should
use it after enabling TRIM.

Reviewed by:	brueffer@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5928
2016-04-19 15:08:35 +00:00
loos
cf2857955c Add PCI ID for family 10h model 30h to amdtemp(4).
This adds support to CPU found in PC Engines APU2 series.

MFC after:	3 weeks
Sponsored by:	Rubicon Communications (Netgate)
2016-04-19 15:07:04 +00:00
br
1d218a20c7 Add driver for Xilinx AXI Quad SPI device. The device was found in
lowRISC hardware.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-04-19 14:47:08 +00:00
br
28789cdc9e Add optional chip_select/deselect methods. This is required
when we want to keep CS asserted for multiple transfers.
2016-04-19 14:18:12 +00:00
trasz
8298725669 Fix debugging printf.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-04-19 13:36:31 +00:00
kib
b69824cf4d Fix umtx lock/trylock for compat32.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-04-19 11:37:43 +00:00
araujo
660f37b59d Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 11:12:57 +00:00
araujo
400b711861 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 09:43:51 +00:00
sephe
dced14581e hyperv/vmbus: Make device probe/attach synchronous w/ vmbus attach/SYSINIT
Discussed with:	Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-19 09:42:48 +00:00
sephe
4a9731a7d4 hyperv: Remove two assign-only local variables
Submitted by:	Jun Su <junsu microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-19 09:25:56 +00:00
delphij
9454d2f01e Fix build breakage introduced by r298253. 2016-04-19 07:28:39 +00:00
araujo
9d4d4d7d3a Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 06:34:31 +00:00
araujo
fd1c51c97b Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 06:32:35 +00:00
eadler
27483b1441 Rename units.lib -> definitions.units
- this matches GNU units 2.12
add ISO country codes from units 2.12
2016-04-19 05:18:12 +00:00
eadler
bf4d4b4498 Rename units.lib -> definitions.units
- this matches GNU units 2.12
add ISO country codes from units 2.12
2016-04-19 05:17:59 +00:00
adrian
877d2ac2fd Add VHT power envelope parsing to ifconfig. 2016-04-19 05:17:43 +00:00
eadler
5ebf5daae9 Remove pathnames.h
- it only holds a single constant
- it doesn't exist in the GNU variant
2016-04-19 05:04:39 +00:00
araujo
d6cc304ba6 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:57:57 +00:00
araujo
f3d1782e9e Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:52:51 +00:00
araujo
7f18be1ecd Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:52:13 +00:00
araujo
71640ff0de Remove redundant parenthesis.
Submitted by:	pfg
MFC after:	2 weeks.
2016-04-19 04:46:13 +00:00
araujo
42055d55ae Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:42:34 +00:00
araujo
a03092e883 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:37:17 +00:00
araujo
60e49e1bc5 Use nitems() instead of sizeof(name) / sizeof(*name).
MFC after:	2 weeks.
2016-04-19 04:28:25 +00:00
allanjude
d9d7af0f72 Add a new installation type to bsdinstall/zfsboot: BIOS+UEFI
Installs both pmbr+gptzfsboot as well as boot1.efifat in separate partitions
The resulting system can be booted with either UEFI or BIOS/CSM.
Preference is controlled by the user's firmware boot settings.

This is now the default for zfsboot installs

PR:		208629
Submitted by:	Galael LAPLANCHE <ganael.laplanche@corp.ovh.com> (original version)
2016-04-19 03:25:36 +00:00
allanjude
89582307e5 Unbreak the build if you enable WITH_NAND
Followup to r298230

Submitted by:	Nikolai Lifanov <lifanov@mail.lifanov.com> (original version)
Sponsored by:	ScaleEngine Inc.
2016-04-19 02:06:02 +00:00
araujo
30f25483fe Use NULL instead of 0 for pointers.
realloc will return NULL in case it cannot allocate memory.

MFC after:	2 weeks.
2016-04-19 02:05:32 +00:00
araujo
eccc897bf6 malloc will return NULL if it cannot allocate memory.
MFC after:	2 weeks.
2016-04-19 02:00:48 +00:00
araujo
542e67e53d getfsent(3) will return NULL on EOF or error.
MFC after:	2 weeks.
2016-04-19 01:59:26 +00:00
araujo
eeb0fb82dc Use NULL instead of 0 for pointers.
malloc will return NULL if it cannot allocate memory.

MFC after:	2 weeks.
2016-04-19 01:57:56 +00:00
jhibbits
01ad9aa4bf Fix SMP booting for PowerPC Book-E
Summary:
PowerPC Book-E SMP is currently broken for unknown reasons.  Pull in
Semihalf changes made c2012 for e500mc/e5500, which enables booting SMP.

This eliminates the shared software TLB1 table, replacing it with
tlb1_read_entry() function.

This does not yet support ePAPR SMP booting, and doesn't handle resetting CPUs
already released (ePAPR boot releases APs to a spin loop waiting on a specific
address).  This will be addressed in the near future by using the MPIC to reset
the AP into our own alternate boot address.

This does include a change to the dpaa/dtsec(4) driver, to mark the portals as
CPU-private.

Test Plan:
Tested on Amiga X5000/20 (P5020).  Boots, prints the following
messages:

 Adding CPU 0, pir=0, awake=1
 Waking up CPU 1 (dev=1)
 Adding CPU 1, pir=20, awake=1
 SMP: AP CPU #1 launched

top(1) shows CPU1 active.

Obtained from:	Semihalf
Relnotes:	Yes
Differential Revision: https://reviews.freebsd.org/D5945
2016-04-19 01:48:18 +00:00
araujo
01b939b543 Use NULL instead of 0 for pointers.
dbopen(3) will returns a NULL on error.

MFC after:	2 weeks.
2016-04-19 01:25:35 +00:00
araujo
a7ef04a9b9 Use NULL instead of 0.
malloc will return NULL in case it cannot allocate memory.

MFC after:	2 weeks.
2016-04-19 01:01:22 +00:00
araujo
801d6e7892 Use NULL for pointers instead of 0.
MFC after:	2 weeks.
2016-04-19 00:59:15 +00:00
araujo
de70093c62 Use NULL instead of 0 for pointers.
kvm_open(3) will return NULL when it cannot access kernel virtual memory.

MFC after:	2 weeks.
2016-04-19 00:40:43 +00:00
araujo
2613322bcf Use NULL for pointers instead of 0.
MFC after:	2 weeks.
2016-04-19 00:38:07 +00:00
sbruno
022b7dfaf4 hptmv(4) Fix potential buffer overflow in hpt_set_info.
While here, adjust some whitespace and yeild some useful debug info.

This is untested on this hardware, testing requests to -scsi went
unanswered.

PR:	206585
Submitted by:	cturt@hardenedbsd.org
MFC after:	2 weeks
2016-04-18 23:26:11 +00:00
allanjude
2b75f57932 A new implementation of the loader block cache
The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy.
Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks.
Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device.
The cache also implements limited read-ahead to increase performance.
To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache.

Booting from a virtual CD over IPMI:
0ms latency, before: 27 second, after: 7 seconds
60ms latency, before: over 12 minutes, after: under 5 minutes.

Submitted by:	Toomas Soome <tsoome@me.com>
Reviewed by:	delphij (previous version), emaste (previous version)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D4713
2016-04-18 23:09:22 +00:00