Commit Graph

237687 Commits

Author SHA1 Message Date
Martin Matuska
276f481d65 MFV r340865:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1080: Spelling fixes
  PR #1084: RAR5 reader bugfixes
  PR #1091: fix use-after-free in delayed newc link processing
  PR #1092: Fix a few obvious resource leaks and strcpy() misuses

MFC after:	1 week
2018-11-24 01:25:45 +00:00
Martin Matuska
fd2a102f7b Update vendor/libarchive/dist to git 0e416f2fe757ad6841dbb3386a17d88b5c9f5533
Relevant vendor changes:
  PR #1080: Spelling fixes
  PR #1084: RAR5 reader bugfixes
  PR #1091: fix use-after-free in delayed newc link processing
  PR #1092: Fix a few obvious resource leaks and strcpy() misuses
2018-11-24 01:15:08 +00:00
Konstantin Belousov
cefb93f253 Parse FreeBSD Feature Control note on the ELF image activation.
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2018-11-23 23:33:55 +00:00
Konstantin Belousov
92328a3251 Generalize ELF parse_notes().
Remove the knowledge of the ABI note type and brandnote from it,
instead provide it with a callback to do note-specific matching and
data fetching.  Implement callback to match against ELF brand.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2018-11-23 23:29:14 +00:00
Konstantin Belousov
eda8fe63c9 Trivial reduction of the code duplication, reuse the return FALSE code.
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2018-11-23 23:16:01 +00:00
Mark Johnston
96fdfb3649 Honour the waitok parameter in kevent_expand().
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18316
2018-11-23 23:10:03 +00:00
Konstantin Belousov
f5cf758998 Provide storage for the process feature control flags in struct proc.
The flags are cleared on exec, it is up to the image activator to set
them.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2018-11-23 23:07:57 +00:00
Mark Johnston
fee65dfc37 Ensure the dirent remains initialized when dirent.d_fileno is unset.
Reported by:	rmacklem
MFC with:	r340856
Sponsored by:	The FreeBSD Foundation
2018-11-23 23:07:49 +00:00
Konstantin Belousov
e8927aa6c6 rtld: parse FreeBSD Feature Control note on the object load.
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2018-11-23 22:37:35 +00:00
Maxim Sobolev
6c81fe160c Nuke out buffer overflow safety marker code, it duplicates similar code in
the malloc()/free() as well as having potential of softening the handling
in case error is detected down to a mere warning as compared to hard panic
in free().

Submitted by:	tsoome
Differential Revision:	https://reviews.freebsd.org/D18299
2018-11-23 22:36:56 +00:00
Mark Johnston
6d2e2df764 Ensure that directory entry padding bytes are zeroed.
Directory entries must be padded to maintain alignment; in many
filesystems the padding was not initialized, resulting in stack
memory being copied out to userspace.  With the ino64 work there
are also some explicit pad fields in struct dirent.  Add a subroutine
to clear these bytes and use it in the in-tree filesystems.  The
NFS client is omitted for now as it was fixed separately in r340787.

Reported by:	Thomas Barabosch, Fraunhofer FKIE
Reviewed by:	kib
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2018-11-23 22:24:59 +00:00
Emmanuel Vadot
759436eb7c axp8xx: Rework the enable part and add the GPIOXLDO regulators
MFC after:	1 month
2018-11-23 19:45:57 +00:00
Emmanuel Vadot
8e9e4ec6b6 a10_ehci: Always set the phy to host mode
MFC after:	1 month
2018-11-23 19:45:11 +00:00
Emmanuel Vadot
84ebe16ac6 aw_usbphy: Convert to usbphy subclass
Instead of routing the phy when enabling it, do the configuration
and routing in the phynode_usb_set_mode function.
While here, if we don't have a vbus detection method, enable the phy
if requested.

MFC after:	1 month
2018-11-23 19:44:26 +00:00
Emmanuel Vadot
f9f020a409 Derive PHY class to new one specialized for USB PHY functions.
Submitted by:	mmel
2018-11-23 19:43:18 +00:00
Conrad Meyer
c15faaac95 Revert r340843 - addressed independently in r340842! 2018-11-23 18:27:16 +00:00
Conrad Meyer
66a87f8cfd rtld: Silence a false positive GCC 6.4.0 warning
The function reloc_non_plt has complicated variable lifetimes that GCC 6.4.0
(the version currently used by amd64-xtoolchain-gcc) misunderstands and
produces an erroneous warning about.  Silence it to allow the -Werror build
to proceed.

Reviewed by:	emaste
2018-11-23 18:23:29 +00:00
Konstantin Belousov
bac111cc74 Silence gcc warnings.
Reported by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2018-11-23 18:15:23 +00:00
Andrew Turner
30c5db2b88 Enable the BSD crtbegin/crtend by default.
It has passed an exp run on amd64 and i386, and has testing on arm64. On
other architectures it is expected to run, however it can be disabled by
building world with -DWITHOUT_BSD_CRTBEGIN.

Sponsored by:	DARPA, AFRL
2018-11-23 16:45:07 +00:00
Andrew Turner
e1fa5626cf Mark the function called by the MIPS .init/.fini sequence with .local.
As with r328939 we need to mark local symbols as such. Without this the
assembly parser treats the symbols as global and created relocations
against these private symbols.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-11-23 16:33:03 +00:00
Andrew Rybchenko
fbca55a51c sfxge(4): request info about outer frame in Rx events
For encapsulated packets, the firmware gives info about the inner frame
fields by default. When not using encapsulation offload, ask for info
about the outer frame instead.

On SFN8xxx with firmware version before v6.4.2.1007 driver reload is
needed after switching from full-feature to low-latency firmware
variant since the driver still thinks that firmware supports
encapsulation, but firmware does not tolerate request to provide info
about outer frame in Rx events.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18105
2018-11-23 16:18:36 +00:00
Andrew Rybchenko
9d89c911bb sfxge(4): ignore error in completion event on MCDIv2 HW
With MCDIv2, the reponse length can be to big to fit into the
CMDDONE_DATALEN field in the MCDI completion event. But rather that
the length being truncated, it can overflow into the CMDDONE_ERRNO
field (this is a longstanding firmware bug). Hence the CMDDONE_ERRNO
field may not be valid.

It isn't necessary to use the value in the CMDDONE_ERRNO field though,
so it can be ignored. The actual error code is already read from the
response header on MCDIv2 capable hardware and stored in emr_rc, so
that can be used instead.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18104
2018-11-23 15:59:49 +00:00
Andrew Rybchenko
641c3370f4 sfxge(4): use MCDIv2 for requests with too long response
Use MCDIv2 for requests with a response size too long for MCDIv1.

Required for MC_CMD_MAC_STATS to reports the stats without using DMA.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18103
2018-11-23 15:59:37 +00:00
Yuri Pankov
63cbe8d1d9 regexec: fix processing multibyte strings.
Matcher function incorrectly assumed that moffset that we get from
findmust is in bytes. Fix this by introducing a stepback function,
taking short path if MB_CUR_MAX is 1, and going back byte-by-byte,
checking if we have a legal character sequence otherwise.

PR:		153502
Reviewed by:	pfg, kevans
Approved by:	kib (mentor, implicit)
Differential revision:	https://reviews.freebsd.org/D18297
2018-11-23 15:49:18 +00:00
Ed Maste
76b6af6731 Disable build-id in i386 binary boot components
A user may enable build-id for all builds by adding
LDFLAGS=-Wl,--build-id=sha1 to /etc/make.conf.  In this case the build-id
note ends added up to mbr and pmbr's .text, which makes it too large (it
ends up being 532 bytes). To avoid this explicitly turn off build-id for
these components.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15470
2018-11-23 13:50:18 +00:00
Andrew Rybchenko
18b602f954 sfxge(4): support inner checksum offload on transmit
Inner checksum offloads may be used only if firmware supports
these tunnels.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18102
2018-11-23 13:12:04 +00:00
Tom Jones
831f467904 Add support for none ACPI battery method batteries
Remove the requirement that a device be a ACPI method battery to be supported
as a battery.

Require now that the device be in the battery devclass and implement the
get_status and get_info functions. This allows batteries which are not ACPI
method batteries to be supported.

Reviewed by: jtl
Approved by: jtl (mentor)
MFC after: 1 Month
Differential Revision:	https://reviews.freebsd.org/D17434
2018-11-23 12:03:01 +00:00
Andrew Rybchenko
ae346558f1 sfxge(4): make MAC naming consistent with other modules
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18101
2018-11-23 11:39:24 +00:00
Andrew Rybchenko
3caf31e90e sfxge(4): enforce packed stream fake buffer size
In the case of packed stream real size of the buffer does not fit in
Rx descriptor byte count. Real size is specified on Rx queue setup.
Non-zero fake should be used to bypass hardware checks.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18100
2018-11-23 11:39:13 +00:00
Andrew Rybchenko
5fb80fd41b sfxge(4): provide simple access to RxQ state in EvQ
Packed stream Rx datapath requires access to packed stream state
stored in event queue. Number of credits is upstead in event handler
on a new buffer, packets parsing on 64k boundary crossing and
Rx doorbell push to give credits back.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18099
2018-11-23 11:39:02 +00:00
Andrew Rybchenko
1aa1b495ed sfxge(4): improve RxQ label init prototype
RxQ type provides more information which may be useful to
setup event queue appropriately.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18098
2018-11-23 11:38:50 +00:00
Andrew Rybchenko
e50a6f3eb4 sfxge(4): support MUM/SUC firmware partitions
Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18097
2018-11-23 11:31:57 +00:00
Andrew Rybchenko
1b5bd0997a sfxge(4): fix ignoring function return value
fix PreFAST issue, add missing annotation that function return value
should not be ignored. Fix alignment.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18096
2018-11-23 11:31:45 +00:00
Andrew Rybchenko
e7144483bb sfxge(4): quieten get version methods
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18095
2018-11-23 10:22:01 +00:00
Andrew Rybchenko
0ab1d25fc4 sfxge(4): remove duplicate NVRAM asserts
The checking performed in the ->envo_type_to_partn
internal method make these assertions unnecessary.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18094
2018-11-23 10:21:50 +00:00
Andrew Rybchenko
ede1a3edaa sfxge(4): precheck and verify flash writes
Read existing flash content before writing, so the flash write can be
avoided if the existing partition content matches the new image. This
avoids unnecessary write cycles for the flash device, and may also be
faster. If the flash does need to be updated, verify the content after
writing.

Note that reading the flash content after writing but before calling
efx_nvram-rw_finish() avoids firmware bug68170, which can lead to
signed image updates failing on Medford.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18093
2018-11-23 10:21:36 +00:00
Andrew Rybchenko
6a869fec96 sfxge(4): fix check in NVRAM validate
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18092
2018-11-23 10:21:28 +00:00
Andrew Rybchenko
558eb6e7f1 sfxge(4): report correct partition write chunk size
If the firmware reports a non-zero write chunk size then nvram writes
may fail if a different granularity is used (e.g. for MUM firmware on
Sorrento).

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18091
2018-11-23 10:21:17 +00:00
Andrew Rybchenko
3d670ff531 sfxge(4): check NVRAM locking by partition ID
Tracking which partition is locked avoids being overly conservative
when EFX_NVRAM_xxx maps to more than one partition (depnding on the
current port number).

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18090
2018-11-23 10:21:06 +00:00
Andrew Rybchenko
8241ccd203 sfxge(4): simplify NVRAM type to partition mappings
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18089
2018-11-23 10:20:55 +00:00
Andrew Rybchenko
348d35299c sfxge(4): rename firmware update verify result cap field
The existing name confuses support for secure boot with
support for reporting a verify result after an NVRAM update.

As the capability only reports support for returning a verify
result, change the name to be less confusing.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18088
2018-11-23 10:20:44 +00:00
Andrew Rybchenko
d5106d0503 sfxge(4): extend NVRAM RW finish to return verify result
Extend efx_nvram_rw_finish() to return firmware verify result code.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18087
2018-11-23 10:20:32 +00:00
Andrew Rybchenko
a21b2f207d sfxge(4): report verify result from RW finish callback
This makes the verify result visible to efx_nvram_rw_finish(), which
can be extended to report it in a later patch.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18086
2018-11-23 10:20:20 +00:00
Andrew Rybchenko
f0d3455bf8 sfxge(4): simplify verify result handling
Simplify verify result handling in NVRAM update finish

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18085
2018-11-23 10:20:08 +00:00
Andrew Rybchenko
c703323657 sfxge(4): fix result code in MCDI NVRAM update finish
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18084
2018-11-23 10:19:57 +00:00
Andrew Rybchenko
4fe33ae862 sfxge(4): copy new header from firmware src
Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18083
2018-11-23 10:19:46 +00:00
Andrew Rybchenko
44d836f8d0 sfxge(4): add RSS key size define
Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18082
2018-11-23 09:16:07 +00:00
Andrew Rybchenko
e9038435e7 sfxge(4): add API to set an RSS context for a filter
Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18081
2018-11-23 09:15:56 +00:00
Andrew Rybchenko
82af879c05 sfxge(4): update RSS API to take RSS context parameter
Update efx_rx_scale_mode_set(), efx_rx_scale_key_set()
and efx_rx_scale_tbl_set().

Submitted by:   Mark Spender <mspender at solarflare.com>
Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18080
2018-11-23 09:15:44 +00:00
Andrew Rybchenko
e6d55a0b58 sfxge(4): add API to allocate and free RSS contexts
Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18079
2018-11-23 09:15:32 +00:00