freebsd-dev/sys/arm
Konstantin Belousov 30b3018d48 Provide protection against starvation of the ll/sc loops when accessing userpace.
Casueword(9) on ll/sc architectures must be prepared for userspace
constantly modifying the same cache line as containing the CAS word,
and not loop infinitely.  Otherwise, rogue userspace livelocks the
kernel.

To fix the issue, change casueword(9) interface to return new value 1
indicating that either comparision or store failed, instead of relying
on the oldval == *oldvalp comparison.  The primitive no longer retries
the operation if it failed spuriously.  Modify callers of
casueword(9), all in kern_umtx.c, to handle retries, and react to
stops and requests to terminate between retries.

On x86, despite cmpxchg should not return spurious failures, we can
take advantage of the new interface and just return PSL.ZF.

Reviewed by:	andrew (arm64, previous version), markj
Tested by:	pho
Reported by:	https://xenbits.xen.org/xsa/advisory-295.txt
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D20772
2019-07-12 18:43:24 +00:00
..
allwinner Add the rtc8583 driver to conf/files. Also, move sy8106a from 2019-06-23 17:23:56 +00:00
altera/socfpga arm: Add kern_clocksource.c directly in files.arm 2019-04-16 20:04:22 +00:00
amlogic/aml8726 Implement missing MMCBR ivars 2019-07-04 14:15:04 +00:00
annapurna/alpine arm: Add kern_clocksource.c directly in files.arm 2019-04-16 20:04:22 +00:00
arm Provide protection against starvation of the ll/sc loops when accessing userpace. 2019-07-12 18:43:24 +00:00
broadcom/bcm2835 A bit of code hygiene (no functional changes). 2019-06-10 23:25:40 +00:00
cloudabi32 Remove sv_pagesize, originally introduced with r100384. 2019-03-01 16:16:38 +00:00
conf Remove a couple of harmless stray references to nandfs. 2019-06-25 16:39:25 +00:00
freescale Remove NAND and NANDFS support 2019-06-25 04:50:09 +00:00
include De-pollute arm's sysarch.h. 2019-07-10 14:34:52 +00:00
mv Remove NAND and NANDFS support 2019-06-25 04:50:09 +00:00
nvidia Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). 2019-06-07 18:23:29 +00:00
qemu arm: Add kern_clocksource.c directly in files.arm 2019-04-16 20:04:22 +00:00
ralink arm: Add kern_clocksource.c directly in files.arm 2019-04-16 20:04:22 +00:00
rockchip Include eventhandler.h in more compilation units 2019-05-21 01:18:43 +00:00
samsung/exynos arm: Add kern_clocksource.c directly in files.arm 2019-04-16 20:04:22 +00:00
ti Add support for the PWM(9) API. This allows configuring the pwm output using 2019-06-21 14:24:33 +00:00
versatile Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
xilinx arm: Add kern_clocksource.c directly in files.arm 2019-04-16 20:04:22 +00:00