]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: hw_breakpoint: fix watchpoint matching for tagged pointers
authorKristina Martsenko <kristina.martsenko@arm.com>
Wed, 3 May 2017 15:37:46 +0000 (16:37 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 9 May 2017 16:26:40 +0000 (17:26 +0100)
commitc7467c290bb41eb83ff17cf9ff49ae78d4f42848
tree45bbe17e3f608ba637e25fab2d12e39f1dc95cc8
parentdf5f47d943fa04f8e20509d2a2f4be401ce586b6
arm64: hw_breakpoint: fix watchpoint matching for tagged pointers

When we take a watchpoint exception, the address that triggered the
watchpoint is found in FAR_EL1. We compare it to the address of each
configured watchpoint to see which one was hit.

The configured watchpoint addresses are untagged, while the address in
FAR_EL1 will have an address tag if the data access was done using a
tagged address. The tag needs to be removed to compare the address to
the watchpoints.

Currently we don't remove it, and as a result can report the wrong
watchpoint as being hit (specifically, always either the highest TTBR0
watchpoint or lowest TTBR1 watchpoint). This patch removes the tag.

Fixes: 599a78c76423 ("arm64: mm: permit use of tagged pointers at EL0")
Cc: <stable@vger.kernel.org> # 3.12.x-
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/uaccess.h
arch/arm64/kernel/hw_breakpoint.c