Commit Graph

215323 Commits

Author SHA1 Message Date
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
Dimitry Andric
9abfdf4ac8 Define ipfilter's SOLARIS macro in a defined and portable way.
Reviewed by:	cy
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D7671
2016-08-28 11:51:46 +00:00
Mariusz Zaborski
03878a296d Remove duplicated declaration.
Reported by:	adrian@
2016-08-28 07:40:11 +00:00
Adrian Chadd
aebcd3034e [ath_hal] add USB PHY control registers for hornet/AR9330.
Obtained from:	linux ath9k
2016-08-28 05:42:03 +00:00
Adrian Chadd
6da4c4c5c3 [net80211] fix up wlanwds to compile without warnings on clang. 2016-08-28 04:54:02 +00:00
Justin Hibbits
7bd8311dec Fix UART PPS capture mode printing
* Add breaks to prevent fallthrough and printing of multiple modes.
* Only check the mode, mask out all other bits.
2016-08-28 04:40:27 +00:00
Adrian Chadd
c401c72b48 [mips] move AR91XX_BASE to std.AR91XX. 2016-08-28 04:10:23 +00:00
Adrian Chadd
c3f27beebb [mips] migrate the QCA955X_BASE file to std.QCA955X, to bring this in line with
other board defaults.
2016-08-28 04:08:26 +00:00
Adrian Chadd
473a0e619a Use ALT_BREAK_TO_DEBUGGER as well. 2016-08-28 04:08:04 +00:00
Adrian Chadd
5554db5d6e .. and since others are using wdr3600/wdr4300 right now and are having
arge issues with spammed interrupts / link issues, flip on ARGE_DEBUG too.
2016-08-28 04:07:34 +00:00
Adrian Chadd
974351045b Since i'm using carambola 2 for more debugging, enable ARGE_DEBUG by default. 2016-08-28 04:06:57 +00:00
Adrian Chadd
9a0e8f3cec [mips] make AR933X boards use ALT_BREAK_TO_DEBUGGER like the rest of the Atheros boards. 2016-08-28 04:06:36 +00:00
Adrian Chadd
054da15ecc [mips] QCA955x config file changes to bring things into alignment with the other atheros config files.
* ALT_BREAK_TO_DEBUGGER, because we get random breaks when unplugging USB
  to serial adapters
* Build more modules!
2016-08-28 04:03:52 +00:00
Konstantin Belousov
6a9e577413 Follow ABI when calling __error from the ptrace(2) wrapper.
In particular, preserve syscall arguments on stack, since callee is
not required to preserve arg-passing registers.  Align stack.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-28 00:26:06 +00:00
Konstantin Belousov
da6e468936 Do not obliterate errno value in the main thread during ptrace(2) call on x86.
Since ptrace(2) syscall can return -1 for non-error situations, libc
wrappers set errno to 0 before performing the syscall, as the service
to the caller.  On both i386 and amd64, the errno symbol was directly
referenced, which only works correctly in single-threaded process.

Change assembler wrappers for ptrace(2) to get current thread errno
location by calling __error().  Allow __error interposing, as
currently allowed in cerror().

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-27 23:03:23 +00:00
Mateusz Guzik
11d3ad2eab vfs: provide a common exit point in namei for error cases
This shortens the function, adds the SDT_PROBE use for error cases and
consistenly unrefs rootdir last.

Reviewed by:	kib
MFC after:	2 weeks
2016-08-27 22:43:41 +00:00
Dimitry Andric
8ebfbdbef8 In ncurses baudrate definitions, avoid warnings about implicit
conversions from int to short changing the values.  This applies to
B38400 and higher, since their values do not fit into a short.

However, since the wrapped values are still unique, and they only serve
as keys, there is no problem in adding a cast to silence the warnings.
This also avoids changing the ABI, which would happen if we changed
NCURSES_OSPEED to int.

Discussed with:	Thomas Dickey
MFC after:	1 week
2016-08-27 20:33:19 +00:00
Alexander Motin
1e3d53e2c4 Decode some new ATA commands found in ACS-3.
MFC after:	1 week
2016-08-27 19:51:37 +00:00
Konstantin Belousov
9ce60e28fd Consistently delimit each vnode description block with two blank
lines.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-08-27 18:12:42 +00:00
Mariusz Zaborski
6ccb0d8756 Bump date in the man page. 2016-08-27 18:08:25 +00:00
Mariusz Zaborski
a1ee7b90ab Add missed header file for cnv.h .
Submitted by:	Adam Starak <starak.adam@gmail.com>
Reported by:	ache@
2016-08-27 15:22:55 +00:00
Andrey A. Chernov
ebbc445889 The formal behavior of qsort is unstable with regard to objects that
are equal. Unfortunately, RFC 3484 requires that otherwise equal objects
remain in the order supplied by the DNS server. The present code attempts
to deal with this by returning -1 for objects that are equal (i.e.,
returns that the first parameter is less then the second parameter).
Unfortunately, the qsort API does not state that the first parameter
passed in is in any particular position in the list.

PR:     212122
Submitted by:   Herbie.Robinson@stratus.com
MFC after:      3 days
2016-08-27 14:43:13 +00:00
Mariusz Zaborski
7dcd0f0e7b Introduce cnv man page.
Submitted by:		Adam Starak <starak.adam@gmail.com>
Reviewed by:		cem@, wblock@
Differential Revision:	https://reviews.freebsd.org/D7249
2016-08-27 13:47:52 +00:00
Mariusz Zaborski
736bc73796 Fix style issue in the cnv API.
Remove unused arguments in a macro.
Remove unused typedef.
2016-08-27 13:40:27 +00:00
Mariusz Zaborski
5ef231f6f7 Add cnv API.
cnv API is a set of functions for managing name/value pairs by cookie.
The cookie can be obtained by nvlist_next(), nvlist_get_parent() or
nvlist_get_pararr() function. This patch also includes unit tests.

Submitted by:	Adam Starak <starak.adam@gmail.com>
2016-08-27 13:37:30 +00:00
Bjoern A. Zeeb
acbeb22d01 Do not try to build cloudabi32 for pc98.
Should unbreak tinderbox.
2016-08-27 12:41:15 +00:00
Bruce Evans
de618daaf0 Fix build without INET6 and with gcc. A function definition was ifdefed
for INET6, but its protototype was not, and gcc detects the error.
2016-08-27 11:06:06 +00:00
Andrew Turner
bc3aca4bf9 Print both the kernel read and write translation in DDB when asking for
a virtual to physical translation. These may be different, e.g. when a
page is mapped as read-only.

MFC after:	1 month
Sponsored by:	ABT Systems Ltd
2016-08-27 10:30:20 +00:00
Andriy Voskoboinyk
e796f68455 iwm: fix few comment typos. 2016-08-27 10:04:48 +00:00
Ed Schouten
fb90d86466 Properly use MACHINE_CPUARCH for finding cloudabi*_sysvec.c.
The build of the cloudabi32 kernel module currently fails for PC98. In
the case of PC98, we just want to use the code for i386.

Reported by:	np
2016-08-27 09:50:11 +00:00
Andriy Voskoboinyk
d845f44fb1 iwm: add 'command accepted' debug notification (copied from wpi(4)).
Now it should be easier to find out which command causes firmware
panics when few commands are sent in a short period of time.
2016-08-27 08:34:20 +00:00
Baptiste Daroussin
f05ca6f33b Remove warning on struct-overflow on gcc 5.3.0 as zic(8) dies on it 2016-08-27 01:28:00 +00:00
Landon J. Fuller
b24852c2b3 Implement siba(4) support for bhnd_(read|write)_config.
This provides access to the siba(4) bus-mapped per-core cfg0 register
block.

Approved by:	adrian (mentor, implicit)
2016-08-27 00:58:21 +00:00
Xin LI
64093e14eb Use printable ASCII instead of octal representation.
MFC after:	2 weeks
2016-08-27 00:56:37 +00:00
Martin Matuska
54635f0c74 Temporarily disable two libarchive tests that have not yet been fixed by
vendor. Tests will be re-enabled after a fix has been merged.

MFC after:	3 days
2016-08-27 00:47:47 +00:00
Navdeep Parhar
e25621e5ea cxgbe(4): Provide more details about the card in the sysctl MIB.
dev.t5nex.0.%desc: Chelsio T580-CR
dev.t5nex.0.hw_revision: 1
dev.t5nex.0.sn: PT13140042
dev.t5nex.0.pn: 110117150A0
dev.t5nex.0.ec: 0000000000000000
dev.t5nex.0.na: 0007432AF490
dev.t5nex.0.vpd_version: 3
dev.t5nex.0.scfg_version: 53255
dev.t5nex.0.bs_version: 1.1.0.0
dev.t5nex.0.er_version: 1.0.0.68
dev.t5nex.0.tp_version: 0.1.4.9
dev.t5nex.0.firmware_version: 1.16.2.0

Sponsored by:	Chelsio Communications
2016-08-27 00:13:41 +00:00
Landon J. Fuller
9bb959068a bhnd(4): Include the chip model (e.g. BCM4xxx) in bhnd(4) bus's device
descriptions.

Reviewed by:	mizhka
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7570
2016-08-27 00:07:48 +00:00
Landon J. Fuller
eb175e8bfb [mips/broadcom]: Replace static frequency table with generic PMU clock
handling.


- Extended PWRCTL/PMU APIs to support querying clock frequency during very
  early boot, prior to bus attach.
- Implement generic PMU-based calculation of UART rclk values.
- Replaced use of static frequency tables (bcm_socinfo) with
  runtime-determined values.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7552
2016-08-27 00:06:20 +00:00
Landon J. Fuller
f90f4b6532 bhnd(4): Initial PMU/PWRCTL power and clock management support.
- Added bhnd_pmu driver implementations for PMU and PWRCTL chipsets,
  derived from Broadcom's ISC-licensed HND code.
- Added bhnd bus-level support for routing per-core clock and resource
  power requests to the PMU device.
- Lift ChipCommon support out into the bhnd module, dropping
  bhnd_chipc.

Reviewed by:	mizhka
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7492
2016-08-27 00:03:02 +00:00
Martin Matuska
c4676089b0 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-26 23:50:44 +00:00
Martin Matuska
5c8a8484e3 Update vendor/libarchive to git 299c6bf136b9bc328b498505f24f87e732b73ff6
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: Be more careful about extra_length
2016-08-26 22:02:37 +00:00
Ed Schouten
cd4dcac89a Improve compatibility of calls to dirname() on constant strings.
As the xinstall(8) utility had to be patched up to work with the POSIXly
correct basename()/dirname() prototypes, we make it pretty hard to build
previous versions of FreeBSD on HEAD. xinstall(8) is part of the
bootstrap tools.

Add some logic to <libgen.h> to automatically detect bad calls to
dirname() based on the type of the argument. If the argument is of type
'const char *', we simply fall back to calling into dirname@FBSD_1.0
directly.

I'll also give basename() similar treatment when importing the
thread-safe version of that function.

Tested by:	bdrewery, madpilot (thanks!)
2016-08-26 20:23:10 +00:00
Landon J. Fuller
cb4abe62ba [mips/broadcom] Generic platform_reset() support.
This adds support for performing platform_reset() on all supported
devices, using early boot enumeration of chipc capabilities and
available cores.


- Added Broadcom-specific MIPS CP0 register definitions used by
  BCM4785-specific reset handling.
- Added a bcm_platform structure for tracking chipc/pmu/cfe platform
  data.
- Extended the BCMA EROM API to support early boot lookup of core info
  (including port/region mappings).
- Extended platform_reset() to support PMU, PMU+AOB, and non-PMU
  devices.

Reviewed by:	mizhka
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7539
2016-08-26 20:16:02 +00:00
John Baldwin
ffe1b10d95 Enable I/O MMU when PCI pass through is first used.
Rather than enabling the I/O MMU when the vmm module is loaded,
defer initialization until the first attempt to pass a PCI device
through to a guest.  If the I/O MMU fails to initialize or is not
present, than fail the attempt to pass a PCI device through to a
guest.

The hw.vmm.force_iommu tunable has been removed since the I/O MMU is
no longer enabled during boot.  However, the I/O MMU support can be
disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent
use of the I/O MMU on any systems where it is buggy.

Reviewed by:	grehan
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D7448
2016-08-26 20:15:22 +00:00
Hiren Panchasara
06b99bd826 Adjust TCP module fastpath after r304803's cc_ack_received() changes.
Reported by:		hiren, bz, np
Reviewed by:		rrs
Sponsored by:		Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D7664
2016-08-26 19:23:17 +00:00
Hiren Panchasara
e7106d6be2 Update TCPS_HAVERCVDFIN() macro to correctly include all states a connection
can be in after receiving a FIN.

FWIW, NetBSD has this change for quite some time.

This has been tested at Netflix and Limelight in production traffic.

Reported by:	Sam Kumar <samkumar99 at gmail.com> on transport@
Reviewed by:	rrs
MFC after:	4 weeks
Sponsored by:	Limelight Networks
Differential Revision:	 https://reviews.freebsd.org/D7475
2016-08-26 17:48:54 +00:00