freebsd-skq/sys
Bjoern A. Zeeb 4c62bffef5 Fix dpcpu and vnet panics with complex types at the end of the section.
Apply a linker script when linking i386 kernel modules to apply padding
to a set_pcpu or set_vnet section.  The padding value is kind-of random
and is used to catch modules not compiled with the linker-script, so
possibly still having problems leading to kernel panics.

This is needed as the code generated on certain architectures for
non-simple-types, e.g., an array can generate an absolute relocation
on the edge (just outside) the section and thus will not be properly
relocated. Adding the padding to the end of the section will ensure
that even absolute relocations of complex types will be inside the
section, if they are the last object in there and hence relocation will
work properly and avoid panics such as observed with carp.ko or ipsec.ko.

There is a rather lengthy discussion of various options to apply in
the mentioned PRs and their depends/blocks, and the review.
There seems no best solution working across multiple toolchains and
multiple version of them, so I took the liberty of taking one,
as currently our users (and our CI system) are hitting this on
just i386 and we need some solution.  I wish we would have a proper
fix rather than another "hack".

Also backout r340009 which manually, temporarily fixed CARP before 12.0-R
"by chance" after a lead-up of various other link-elf.c and related fixes.

PR:			230857,238012
With suggestions from:	arichardson (originally last year)
Tested by:		lwhsu
Event:			Waterloo Hackathon 2019
Reported by:		lwhsu, olivier
MFC after:		6 weeks
Differential Revision:	https://reviews.freebsd.org/D17512
2019-06-08 17:44:42 +00:00
..
amd64 Remove lazy FPU switch support from amd64. 2019-06-08 16:03:34 +00:00
arm bcm2835_sdhci.c: exit DMA if not enough data left to avoid timeout errors 2019-06-08 16:15:00 +00:00
arm64 very large dma mappings can cause integer overflow 2019-06-03 19:19:35 +00:00
bsm
cam Introduce sim_dev and cam_sim_alloc_dev(). 2019-06-08 15:19:50 +00:00
cddl Fix comparison signedness in arc_is_overflowing(). 2019-06-07 20:59:24 +00:00
compat Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). 2019-06-07 18:23:29 +00:00
conf Fix dpcpu and vnet panics with complex types at the end of the section. 2019-06-08 17:44:42 +00:00
contrib While working on a PR, more are discovered. 2019-06-04 19:37:51 +00:00
crypto aesni(4): Fix trivial type typo 2019-05-27 00:47:51 +00:00
ddb Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
dev Add SDIO support. 2019-06-08 16:26:56 +00:00
dts arm64: Add support for NanoPI NEO2 2019-05-02 12:56:13 +00:00
fs Manually clear text references on reclaim for nullfs and tmpfs. 2019-06-05 20:16:25 +00:00
gdb
geom geli: build warning fixes 2019-06-05 22:46:18 +00:00
gnu dts: Import files from Linux 5.1 2019-05-08 19:27:30 +00:00
i386 i386 trap.c: Remove unused MAX_TRAP_MSG define. 2019-06-08 13:41:39 +00:00
isa
kern Fix dpcpu and vnet panics with complex types at the end of the section. 2019-06-08 17:44:42 +00:00
kgssapi * Handle SIGPIPE in gssd 2019-02-21 01:30:37 +00:00
libkern random(4): depessimize arc4random 2019-05-12 06:32:46 +00:00
mips Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). 2019-06-07 18:23:29 +00:00
modules Add SDIO support. 2019-06-08 16:26:56 +00:00
net Restore the comment removed in r348745. 2019-06-06 17:20:35 +00:00
net80211 Restructure mbuf send tags to provide stronger guarantees. 2019-05-24 22:30:40 +00:00
netgraph Remove 'dir' argument in ng_ipfw_input, since ip_fw_args now has this info. 2019-03-14 22:30:05 +00:00
netinet Fix dpcpu and vnet panics with complex types at the end of the section. 2019-06-08 17:44:42 +00:00
netinet6 Restructure mbuf send tags to provide stronger guarantees. 2019-05-24 22:30:40 +00:00
netipsec Add deprecation warnings for IPsec algorithms deprecated in RFC 8221. 2019-05-23 22:06:57 +00:00
netpfil Initialize V_nat64out methods explicitly. 2019-06-05 09:25:40 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Fix prio vs. nonprio tagged traffic in RDMACM 2019-06-04 06:21:31 +00:00
opencrypto cryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe. 2019-05-24 02:44:15 +00:00
powerpc powerpc/pmap: Move the SLB spill handlers to a better place 2019-06-08 03:07:08 +00:00
riscv Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). 2019-06-07 18:23:29 +00:00
rpc Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled. 2019-04-04 01:23:06 +00:00
security Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
sparc64 FCP-101: Remove wb(4) 2019-05-17 15:24:34 +00:00
sys Fix dpcpu and vnet panics with complex types at the end of the section. 2019-06-08 17:44:42 +00:00
teken Attempt to complete fixing programmable function keys for syscons. 2019-02-20 02:14:41 +00:00
tests Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
tools Add SDIO support. 2019-06-08 16:26:56 +00:00
ufs Add a missing bresle() in seldom-used error return. 2019-05-28 17:31:35 +00:00
vm Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). 2019-06-07 18:23:29 +00:00
x86 another occurrence where a very large dma mapping can cause integer overflow 2019-06-05 13:08:21 +00:00
xdr
xen
Makefile