freebsd-dev/sys/arm
Svatopluk Kraus 3d69163ace Don't use atomic operations for page table entries and handle access
and R/W emulation aborts under pmap lock.

There were two reasons for using of atomic operations:
(1) the pmap code is based on i386 one where they are used,
(2) there was an idea that access and R/W emulation aborts should be
    handled as quick as possible, without pmap locking.

However, the atomic operations in i386 pmap code are used only because
page table entries may be modified by hardware. At the beginning, we
were not sure that it's the only reason. So even if arm hardware does
not modify them, we did not risk to not use them at that time. Further,
it turns out after some testing that using of pmap lock for access and
R/W emulation aborts does not bring any extra cost and there was no
measurable difference. Thus, we have decided finally to use pmap lock
for all operations on page table entries and so, there is no reason for
atomic operations on them. This makes the code cleaner and safer.

This decision introduce a question if it's safe to use pmap lock for
access and R/W emulation aborts. Anyhow, there may happen two cases in
general:
(A) Aborts while the pmap lock is locked already - this should not
happen as pmap lock is not recursive. However, under pmap lock only
internal kernel data should be accessed and such data should be mapped
with A bit set and NM bit cleared. If double abort happens, then
a mapping of data which has caused it must be fixed.
(B) Aborts while another lock(s) is/are locked - this already can
happen. There is no difference here if it's either access or R/W
emulation abort, or if it's some other abort.

Reviewed by:	kib
2016-04-22 06:32:27 +00:00
..
allwinner Replace the A20 kernel config with a generic ALLWINNER kernel config that 2016-04-21 16:49:04 +00:00
altera/socfpga Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
amlogic/aml8726 Use our nitems() macro when param.h is available. 2016-04-20 15:45:55 +00:00
annapurna/alpine Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
arm Don't use atomic operations for page table entries and handle access 2016-04-22 06:32:27 +00:00
at91 sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00
broadcom/bcm2835 Use proper type of tag in bcm2835_mbox_fb_init 2016-04-21 18:58:06 +00:00
cavium/cns11xx sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00
conf Replace the A20 kernel config with a generic ALLWINNER kernel config that 2016-04-21 16:49:04 +00:00
freescale Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
include Don't use atomic operations for page table entries and handle access 2016-04-22 06:32:27 +00:00
lpc Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
mv sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00
nvidia Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
qemu Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
rockchip Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
samsung/exynos Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
ti Use our nitems() macro when param.h is available. 2016-04-20 15:45:55 +00:00
versatile Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
xilinx Rename ARM_INTRNG and MIPS_INTRNG to INTRNG. This will help with machine 2016-04-15 16:05:41 +00:00
xscale sys: use our roundup2/rounddown2() macros when param.h is available. 2016-04-21 19:57:40 +00:00