summaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2020-03-16 16:50:51 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2020-03-16 17:19:49 +0000
commit0537c4cd71e3c729c278c82f5b088460fb66fc33 (patch)
tree0200b41d14892d1bc98ae1ca6083361c244e8c3a /arch/arm64
parentd2c2ee4cc33bea814eb6739f14d8cb6a4b5265bb (diff)
arm64: BTI: Reset BTYPE when skipping emulated instructions
Since normal execution of any non-branch instruction resets the PSTATE BTYPE field to 0, so do the same thing when emulating a trapped instruction. Branches don't trap directly, so we should never need to assign a non-zero value to BTYPE here. Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/kernel/traps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 3c986c8ca204..10d6451b2776 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -340,6 +340,8 @@ void arm64_skip_faulting_instruction(struct pt_regs *regs, unsigned long size)
if (compat_user_mode(regs))
advance_itstate(regs);
+ else
+ regs->pstate &= ~PSR_BTYPE_MASK;
}
static LIST_HEAD(undef_hook);