]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: kprobe: Always blacklist the KVM world-switch code
authorJames Morse <james.morse@arm.com>
Thu, 24 Jan 2019 16:32:55 +0000 (16:32 +0000)
committerWill Deacon <will.deacon@arm.com>
Fri, 1 Feb 2019 14:09:50 +0000 (14:09 +0000)
commit670299bd5e419116381f0d28692b7b4eb889d2f3
tree4fd6ee9ba48833900b33b1214a4aea8b584caf81
parentc4fcae9da05ab6f3a926bbf65bcad1ee6ca894f4
arm64: kprobe: Always blacklist the KVM world-switch code

On systems with VHE the kernel and KVM's world-switch code run at the
same exception level. Code that is only used on a VHE system does not
need to be annotated as __hyp_text as it can reside anywhere in the
 kernel text.

__hyp_text was also used to prevent kprobes from patching breakpoint
instructions into this region, as this code runs at a different
exception level. While this is no longer true with VHE, KVM still
switches VBAR_EL1, meaning a kprobe's breakpoint executed in the
world-switch code will cause a hyp-panic.

Move the __hyp_text check in the kprobes blacklist so it applies on
VHE systems too, to cover the common code and guest enter/exit
assembly.

Fixes: 3ea0b70a02f9 ("arm64: Treat all entry code as non-kprobe-able")
Reviewed-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/probes/kprobes.c