freebsd-skq/sys
Bruce Evans 27c56cf357 Fix hangs in r341810 waiting for AP startup.
idle_td is dereferenced without thread-locking it to make its contents is
invariant, and was accessed without telling the compiler that its contents
is invariant.  Some compilers optimized accesses to the supposedly invariant
contents by moving the critical checks for changes outside of the loop that
waits for changes.  Fix this using atomic ops.

This bug only showed up for the following configuration: a Turion2
system, amd64 kernels, compiled by gcc, and SCHED_4BSD.  clang fails
to do the optimization with all CFLAGS that I tried, because it doesn't
fully optimize the '__asm __volatile' for cpu_spinwait() although this
asm has no memory clobber.  gcc only does the optimization with most
CFLAGS.  I mostly used -Os with all compilers.  i386 works because gcc
-m32 -Os only moves 1 or the 2 accesses outside of the loop.
Non-Turion2 systems and SCHED_ULE worked due to different timing (when
all APs start before the BP checks them outside of the loop).

Reviewed by:	kib
2019-02-20 02:40:38 +00:00
..
amd64 Remove drm from LINT kernels 2019-02-19 21:20:50 +00:00
arm Add a compatible string to match recent changes in the upstream dts. 2019-02-18 19:50:53 +00:00
arm64 Enable enabling ASLR on non-x86 architectures. 2019-02-14 14:44:53 +00:00
bsm Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
cam Fix panic message. 2019-02-13 00:10:12 +00:00
cddl Simplify the code. No functional changes. 2019-02-20 00:25:45 +00:00
compat Make taskqgroup_attach{,_cpu}(9) work across architectures 2019-02-12 21:23:59 +00:00
conf Remove the i915 and radeon drivers. 2019-02-19 19:37:02 +00:00
contrib libnv: fix revert 2019-02-17 18:32:19 +00:00
crypto Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
ddb ddb: Print the thread's pcb in 'show thread' 2019-02-09 21:08:19 +00:00
dev Remove the i915 and radeon drivers. 2019-02-19 19:37:02 +00:00
dts Adapt FreeBSD specific DT stub for Jetson TK1 board to be consistent with 2019-02-06 06:03:44 +00:00
fs Work around the "nfscl: bad open cnt on server" assertion 2019-02-19 12:45:37 +00:00
gdb
geom Limit the number of entries allocated for a REPORT_ZONES command. 2019-02-19 21:33:02 +00:00
gnu Import DTS from Linux 4.20 2019-01-11 09:40:34 +00:00
i386 Remove drm from LINT kernels 2019-02-19 21:20:50 +00:00
isa
kern Create a common function to handle freeing the kcov info struct. 2019-02-19 17:03:34 +00:00
kgssapi
libkern mcount: tidy up ANSIfication 2018-10-20 22:39:35 +00:00
mips Enable enabling ASLR on non-x86 architectures. 2019-02-14 14:44:53 +00:00
modules Remove drm2 modules. 2019-02-19 19:36:56 +00:00
net iflib: Improve return values of interrupt handlers. 2019-02-15 18:51:43 +00:00
net80211 net80211(4): hide casts for 'i_seq' field offset calculation inside 2019-02-10 23:58:56 +00:00
netgraph Remove remnants of byte order manipulation, back when FreeBSD stack 2019-02-09 03:00:00 +00:00
netinet Fix a byte ordering issue for the advertised receiver window in ACK 2019-02-15 09:45:17 +00:00
netinet6 When dropping a fragment queue count the number of fragments in the queue 2019-02-19 19:57:55 +00:00
netipsec Remove unused argument to priv_check_cred. 2018-12-11 19:32:16 +00:00
netpfil Remove `set' field from state structure and use set from parent rule. 2019-02-11 18:10:55 +00:00
netsmb Remove unused argument to priv_check_cred. 2018-12-11 19:32:16 +00:00
nfs
nfsclient
nfsserver
nlm Use syscall_helper_register() to register syscalls and initialize though 2018-02-10 01:09:22 +00:00
ofed Mechanical cleanup of epoch(9) usage in network stack. 2019-01-09 01:11:19 +00:00
opencrypto Fix another issue from r344141, having to do with size of a shift amount. 2019-02-15 04:15:43 +00:00
powerpc powerpc/booke: Fix 32-bit build 2019-02-16 04:47:33 +00:00
riscv Enable enabling ASLR on non-x86 architectures. 2019-02-14 14:44:53 +00:00
rpc Bump the default kern.rpc.gss.client_max from 128 to 1024. 2019-02-19 11:07:02 +00:00
security Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
sparc64 Enable enabling ASLR on non-x86 architectures. 2019-02-14 14:44:53 +00:00
sys Add an UPDATING entry for the removal of drm and drm2 2019-02-19 19:37:09 +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 make_dtb.sh: Use $CPP instead of assuming that cpp is in $PATH 2018-12-14 23:53:28 +00:00
ufs This bug was introduced with the change to use softdep_bp_to_mp() in 2019-01-28 21:36:45 +00:00
vm Remove a redundant flag variable. 2019-02-17 16:35:19 +00:00
x86 Fix hangs in r341810 waiting for AP startup. 2019-02-20 02:40:38 +00:00
xdr
xen xen: introduce a new way to setup event channel upcall 2019-01-30 11:34:52 +00:00
Makefile