OSDN Git Service

ARM: 6383/1: Implement phys_mem_access_prot() to avoid attributes aliasing
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 13 Sep 2010 15:01:24 +0000 (16:01 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 19 Sep 2010 11:19:18 +0000 (12:19 +0100)
commitd907387c42e9e39261629890e45a08ef4c3ed3fe
treec25c1c7bde121ccb9ac56a434113c16d24203647
parent79e27dc0677b969e2d53b76fa0fa58467cce946a
ARM: 6383/1: Implement phys_mem_access_prot() to avoid attributes aliasing

ARMv7 onwards requires that there are no aliases to the same physical
location using different memory types (i.e. Normal vs Strongly Ordered).
Access to SO mappings when the unaligned accesses are handled in
hardware is also Unpredictable (pgprot_noncached() mappings in user
space).

The /dev/mem driver requires uncached mappings with O_SYNC. The patch
implements the phys_mem_access_prot() function which generates Strongly
Ordered memory attributes if !pfn_valid() (independent of O_SYNC) and
Normal Noncacheable (writecombine) if O_SYNC.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/pgtable.h
arch/arm/mm/mmu.c