Commit Graph

215373 Commits

Author SHA1 Message Date
Oleksandr Tymoshenko
6de4dd4f60 Fix TI PRUSS driver panic with INVARIANTS enabled
Value passed as islocked argument to knlist_add should
be consistent with actual lock state so add lock/unlock
calls around knlist_add

PR:		212120
Submitted by:	Manuel Stuhn
2016-08-30 01:31:03 +00:00
Nathan Whitehorn
dd101c7ea3 Some versions of SLOF do not append the partition number to the boot
device argument to the stage-1 bootloader. In such cases, boot1 would
only try to read the entire device rather than checking for partitions.
Instead of panic'ing, fall back to reading the partitions as normal in
such situations. This was preventing boot of installed systems on some
versions of PowerKVM.

PR:		kern/211599
MFC after:	2 days
2016-08-30 00:47:21 +00:00
John Baldwin
e05ec081fe Implement 'devctl clear driver' to undo a previous 'devctl set driver'.
Add a new 'clear driver' command for devctl along with the accompanying
ioctl and devctl_clear_driver() library routine to reset a device to
use a wildcard devclass instead of a fixed devclass.  This can be used
to undo a previous 'set driver' command.  After the device's name has
been reset to permit wildcard names, it is reprobed so that it can
attach to newly-available (to it) device drivers.

MFC after:	1 month
Sponsored by:	Chelsio Communications
2016-08-29 22:48:36 +00:00
Enji Cooper
a3d5eb2481 Minor Makefile simplifications for lib/atf/...
- Replace uses of `${.CURDIR:H:H:H}` with ${SRCTOP}
- Use built-in :H operator instead of ".." when enumerating paths.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 22:47:53 +00:00
John Baldwin
bc32f05443 Use device_verbose() to undo device_quiet() when detaching from t[45]iovX.
The device quiet flag is not automatically reset on detach, so it is
inherited by other device drivers (e.g. when switching a device driver
over to ppt for PCI pass through).  Cope with this behavior by explicitly
marking the device verbose during detach so that the next driver can make
its own decision.

Sponsored by:	Chelsio Communications
2016-08-29 22:47:14 +00:00
Enji Cooper
cc85aca9cd Fix typo
atf_tc_expect_fail should have been atf_expect_fail per atf-sh-api(3)

PR:		212193
Pointyhat to:	ngie
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 22:38:18 +00:00
Enji Cooper
9c73efe89c Fix typo
atf_tc_expect_fail should have been atf_expect_fail per atf-sh-api(3)

PR:		212193
Pointyhat to:	ngie
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 22:34:31 +00:00
Conrad Meyer
ee5642bb35 ioat(4): Add additional CTR tracing during reset 2016-08-29 20:51:34 +00:00
Conrad Meyer
1bbc06b85b ioat(4): Don't "complete" DMA descriptors prematurely
In r304602, I mistakenly removed the ioat_process_events check that we weren't
processing events before the hardware had completed the descriptor
("last_seen").  Reinstate that logic.

Keep the defensive loop condition and additionally make sure we've actually
completed a descriptor before blindly chasing the ring around.

In reset, queue and finish the startup command before allowing any event
processing or submission to occur.  Avoid potential missed callouts by
requeueing the poll later.
2016-08-29 20:46:33 +00:00
Jared McNeill
704fa4fd26 When the EFI implementation (like U-Boot) does not support WaitForKey, we
can emulate efi_cons_poll(0 with a flag and caching the last key read with
ReadKeyStroke. This fixes the loader.efi countdown timer on Pine64 (and
other U-Boot + EFI using platforms).

Reviewed by:		imp, manu
Differential Revision:	https://reviews.freebsd.org/D7670
2016-08-29 20:01:53 +00:00
Konstantin Belousov
05acb548bb Typesetting fixes.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-08-29 19:53:13 +00:00
Dimitry Andric
7fcdc815d2 Avoid undefined behavior when calling va_start() in bnep_send_control(),
by making the 'type' parameter a plain unsigned.

MFC after:	3 days
2016-08-29 19:40:46 +00:00
Konstantin Belousov
7c39d98bd3 Restore the requirement of setting errno to zero before calling
ptrace(2).  Describe the behaviour of automatically zeroing errno as
historical feature.

Requested by:	ache, jhb
Reviewed by:	ache, bjk
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-29 19:33:07 +00:00
Enji Cooper
84cd8a602a MFhead @ r305020 2016-08-29 19:14:52 +00:00
Enji Cooper
47d6e5cb86 Remove redundant declarations and simplify ../ in pathing
- TESTSBASE and LOCALBASE are already defined in bsd.tests.mk
- TESTSDIR is automatically divined as ${TESTSBASE}${RELDIR:H} after
  r289158.
- Replace SRCDIR with SRCTOP

MFC after:	1 week
X-MFC with:	r305019
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 19:10:58 +00:00
Enji Cooper
68aee22c0e Remove unnecessary variable (SRCDIR) replaced by SRCTOP in Makefile.common
MFC after:	1 week
X-MFC with:	r305018
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 19:07:48 +00:00
Enji Cooper
17a7f5c474 Use SRCTOP instead of a homegrown definition for it (SRCDIR)
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 19:06:40 +00:00
Dimitry Andric
3323aadf23 Fix the zfsd unittest:
* TESTSDIR is supposed to be under cddl/usr.sbin, not cddl/sbin
* DevdCtl::EventBuffer no longer exists, so remove its forward
  declaration

MFC after:	3 days
X-MFC-With:	r305013
2016-08-29 18:55:06 +00:00
Konstantin Belousov
f6fea94e5d Remove commented out mention of ptrace.S.
After r305012 the asm wrapper is not needed.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-29 18:53:51 +00:00
Enji Cooper
2f52412dee MFhead @ r305013 2016-08-29 18:53:36 +00:00
Dimitry Andric
895897884f Add an empty virtual destructor to zfsd's Vdev class. This is needed
because the class has virtual functions, and the compiler-generated
default destructor is non-virtual.

Reviewed by:	asomers
MFC after:	3 days
2016-08-29 18:51:49 +00:00
Konstantin Belousov
afd3e268d2 Rewrite ptrace(2) wrappers in C.
Besides removing hand-translation to assembler, this also adds missing
wrappers for arm64 and risc-v.

Reviewed by:	emaste, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D7694
2016-08-29 18:47:51 +00:00
Enji Cooper
771e2c7753 Expect sub testcases 2-4 in :tests_time_rotate to fail today due to changes
to newsyslog, etc made in the past month.

The issue is being root-caused as part of the bug noted below. This commit
will need to be partially reverted once the issue has been found/fixed

PR:		212160
Reported by:	Jenkins
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 18:46:04 +00:00
Bruce Evans
b430634b31 Add screen locking calls to sc cn grab and ungrab. The locking functions
just use the same mutex locking as sc cn putc so they have the same
defects.

The locking calls to acquire the lock are actually in sc cn open and close.
Ungrab has to unlock, although this opens a race window.

Change the direct mutex lock calls in sc cn putc to the new locking
functions via the open and close functions.  Putc also has to unlock, but
doesn't keep the screen open like grab.  Screen open and close reduce to
locking, except screen open for grab also attempts to switch the screen.

Keyboard locking is more difficult and still null, even when keyboard
input calls screen functions, except some of the functions have locks
too deep to work right.

This organization gives a single place to fix some of the locking.
2016-08-29 18:41:06 +00:00
Bryan Drewery
190348ae45 Allow parallelizing clean/cleandepend/depend with all.
This now makes 'make -jX clean all install' safe.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 18:31:34 +00:00
Enji Cooper
b5864e6de2 Expect :basic to fail due to recent output changes in dirname(3)
The dirname output change bug is actively being worked on, and this
commit will need to be reverted once it's fixed.

MFC after:	never
PR:		212193
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 17:50:36 +00:00
Steven Kreuzer
6f63fee784 Null out the release notes for 12-CURRENT
Approved by:	gjb
Differential Revision:	    D7669
2016-08-29 17:23:04 +00:00
Bruce Evans
ef209971e9 Shorten banal comments about zeroing and copying pages. Don't give
implementation details that last echoed the code 15-20 years ago.
But add a detail about pagezero() on i386.  Switch from Mach style
to BSD style.
2016-08-29 14:38:31 +00:00
Bruce Evans
1a5735873e On amd64, declare sse2_pagezero() and start using it again, but only
for zeroing pages in idle where nontemporal writes are clearly best.
This is almost a no-op since zeroing in idle works does nothing good
and is off by default.  Fix END() statement forgotten in previous
commit.

Align the loop in sse2_pagezero().  Since it writes to main memory,
the loop doesn't have to be very carefully written to keep up.
Unrolling it was considered useless or harmful and was not done on
i386, but that was too careless.

Timing for i386: the loop was not unrolled at all, and moved only 4
bytes/iteration.  So on a 2GHz CPU, it needed to run at 2 cycles/
iteration to keep up with a memory speed of just 4GB/sec.  But when
it crossed a 16-byte boundary, on old CPUs it ran at 3 cycles/
iteration so it gave a maximum speed of 2.67GB/sec and couldn't even
keep up with PC3200 memory.  Fix the alignment so that it keep up with
4GB/sec memory, and unroll once to get nearer to 8GB/sec.  Further
unrolling might be useless or harmful since it would prevent the loop
fitting in 16-bytes.  My test system with an old CPU and old DDR1 only
needed 5+ GB/sec.  My test system with a new CPU and DDR3 doesn't need
any changes to keep up ~16GB/sec.

Timing for amd64: with 8-byte accesses and newer faster CPUs it is
easy to reach 16GB/sec but not so easy to go much faster.  The
alignment doesn't matter much if the CPU is not very old.  The loop
was already unrolled 4 times, but needs 32 bytes and uses a fancy
method that doesn't work for 2-way unrolling in 16 bytes.  Just
align it to 32-bytes.
2016-08-29 13:07:21 +00:00
Ed Schouten
bab6a051ec Use both the MACHINE and MACHINE_CPUARCH directories for finding sources.
When fixing this module to build on PC98, I actually broke the build on
ARM64. On PC98 we need to pull in the sources from the MACHINE_CPUARCH
(i386), but on ARM64 we need to use the MACHINE, as MACHINE_CPUARCH is
set to aarch64 instead of just arm64.
2016-08-29 07:48:35 +00:00
Martin Matuska
cff8ef76a4 Redo MFV r304866:
Sync libarchive with vendor including security fixes

Vendor issues fixed:
Issue #731: Reject tar entries >= INT64_MAX
Issue #744 (part of Issue #743): Enforce sandbox with very long pathnames
Issue #748: Zip decompression failure with highly-compressed data
Issue #767: Buffer overflow printing a filename
Issue #770: Zip read: be more careful about extra_length

MFC after:	3 days
2016-08-29 06:54:38 +00:00
Martin Matuska
c438d38492 Revert r304869
This commit was incorrect and will be re-committed asap.
2016-08-29 06:50:45 +00:00
Bruce Evans
537a47a1ba Restore the nontemporal pagezero() under the name sse2_pagezero() (the
same name as for i386).  It is not reconnected yet.

Which method is better is too machine-dependent and system-dependent
to replace the old method unconditionally.
2016-08-29 06:07:43 +00:00
Sepherosa Ziehau
fdda77284f hyperv/hn: Switch to new RNDIS set for RSS parameters.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7658
2016-08-29 05:35:35 +00:00
Sepherosa Ziehau
7681d6725a hyperv/hn: Fix # of channels setting, if RSS is not available.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7657
2016-08-29 05:08:53 +00:00
Sepherosa Ziehau
e4e0ef792c hyperv/hn: Switch to new RNDIS query for RSS capabilities extraction.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7656
2016-08-29 04:54:13 +00:00
Sepherosa Ziehau
c204be533c hyperv/hn: Switch to new RNDIS query for link status extraction.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7654
2016-08-29 04:44:24 +00:00
Sepherosa Ziehau
3dc33a77d7 hyperv/hn: Add definition for NDIS media state.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7652
2016-08-29 03:22:56 +00:00
John Baldwin
27dc50b0f0 Add missing array subscript.
This fixes a tautological pointer comparison warning, but would also a
real bug for a platform where bus_dmamap_unload of a static allocation
is not a no-op.
2016-08-29 01:59:18 +00:00
Justin Hibbits
24f4202df8 Check all compatible strings on uart devices in powerpc
Summary:
Some device trees put "fsl,ns16650" first in the compatible list.  This causes
the probe code to choke, even though the device is compatible with ns16650, and
has it listed later in the tree.

Reviewed by:	nwhitehorn
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D7676
2016-08-28 21:31:21 +00:00
Dimitry Andric
1fc157ae91 Define hastd's STRICT_ALIGN macro in a defined and portable way.
MFC after:	3 days
2016-08-28 21:26:11 +00:00
Landon J. Fuller
d851916ef2 bhnd(4): Apply the siba chipid ncore fixup in bhnd_read_chipid(), ensuring
that bhndb et al are always operating on a valid core count.

Approved by:	adrian (mentor, implicit)
2016-08-28 20:39:53 +00:00
Peter Wemm
99cbd70f0b The read-ahead code from r298230 made it likely the boot code would read
beyond the end of disk. r298900 added code to prevent this.  Some BIOSes
cause significant delays if asked to read past end-of-disk.

We never trusted the BIOS to accurately report the sectorsize of disks
before and this set of changes.  Unfortuately they interact badly with
the infamous >2TB wraparound bugs.  We have a number of relatively-recent
machines in the FreeBSD.org cluster where the BIOS reports 3TB disks as 1TB.

With pre-r298900 they work just fine.  After r298900 they stop working if
the boot environment attempts to access anything outside the first 1TB on
the disk.  'ZFS: I/O error, all block copies unavailable' etc.  It affects
both UFS and ZFS if they try to boot from large volumes.

This change replaces the blind trust of the BIOS end-of-disk reporting
with a read-ahead clip to prevent reads crossing the of end-of-disk
boundary.  Since 2^32 (2TB) size reporting truncation is not uncommon,
the clipping is done on 2TB aliases of the reported end-of-disk.
ie: a 3TB disk reported as 1TB has readahead clipped at 1TB, 3TB, 5TB, ...
as one of them is likely to be the real end-of-disk.

This should make the loader on these broken machines behave the same as
traditional pre-r298900 loader behavior, without disabling read-ahead.

PR:		212139
Discussed with:	tsoome, allanjude
2016-08-28 20:39:33 +00:00
Dimitry Andric
338dc8086d Follow-up to r304953, in which I broke the build: apparently the SOLARIS
macro is defined in lots of different places in ipfilter, so replace all
of the nonportable definitions with portable ones.

Pointy hat to:	dim
X-MFC-With:	r304959, r304953
MFC after:	3 days
2016-08-28 19:35:29 +00:00
Landon J. Fuller
203788adf0 bhnd(4): Add a bhnd bus method for fetching the device's core table.
This will allow us to perform bhndb(4) bridge configuration based on
the identified hardware, prior to performing full enumeration of the
child bhnd bus.

Approved by:	adrian (mentor, implicit)
2016-08-28 19:34:22 +00:00
Bruce Evans
27a465b033 Expand error messages: print symbol names, parentheses and shift tokens,
and negative shift counts.

Fix error messages: print "Division" instead of "Divide"; print
multiplier-like, addition-like and logical operator tokens instead of
garbage (usually the command name).

ddb has a primitive lexer with excessive information hiding that makes
it hard to find even the point in the line where a syntax error is
detected.  Old ddb just printed "Syntax error" and this was unimproved
in most places by printing a garbage token.
2016-08-28 19:33:09 +00:00
Konstantin Belousov
252664bd71 Complete r304953.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-08-28 18:10:29 +00:00
Bruce Evans
be1ed810b1 Fix vm86 initialization, part 1 of 2 and a half.
Early use of vm86 depends on the PIC being reset to mask interrupts,
but r286667 moved PIC initialization to after where vm86 may be first
used.

Move the PIC initialization up to immdiately before vm86 initialization.
All invocations of diff that I tried display this move poorly so that it
looks like PIC and vm86 initialization was moved later.

r286667 was to move console initialization later.  The diffs are again
unreadable -- they show a large move that doesn't seem to involve the
console.  The PIC initialization stayed just below the console
initialization where it could still be debugged but no longer works.

Later console initialization breaks mainly debugging vm86 initialization
and memory sizing using ddb and printf().  There are several printf()s
in the memory sizing that now go nowhere since message buffer
initialization has always been too late.  Memory sizing is done by loader
for most users, but the lost messages for this case are even more
interesting than for an auto-probe since they tell you what the loader
found.
2016-08-28 15:23:44 +00:00
Bruce Evans
441ead70cd Fix vm86 initialization, part 1 of 2 and a half.
vm86 uses the tss, but r273995 moved tss initialization to after where
it may be first used, just because tss_esp0 now depends on later
initializations and/or amd64 does it later.

vm86 is first used for memory sizing in cases where the loader can't
figure out the size or is not used.  Its initialization is placed
immediately before memory sizing to support this, and the tss was
initialized a little earlier.

Move everything in the tss initialization except for tss_esp0 back to
almost where it was, immediately before vm86 initialization (the
combined move is from before dblflt_tss initialization to after).  Add
only early initialization of tss_esp0, later reloading of the tss, and
comments.  The initial tss_esp0 no longer has space for the pcb since
initially the size of the pcb is not known and no pcb is needed.
(Later changes broke debugging at this point, so the nonexistent pcb
cannot be used by debuggers, and at the time of 273995 when ddb was
almost able to debug this problem it didn't need the pcb.)  The
iniitial tss_esp0 still has a magic 16 bytes reserved for vm86
although I think this is unused too.
2016-08-28 14:03:25 +00:00
Bjoern A. Zeeb
787650cde6 Back out r304907, Ed had fixed it apparently earlier in the cloudabi*
subdirectories.

Reported by:	np
2016-08-28 12:05:34 +00:00