OSDN Git Service

arm64: unify native/compat instruction skipping
authorDave Martin <Dave.Martin@arm.com>
Mon, 16 Mar 2020 16:50:49 +0000 (16:50 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 16 Mar 2020 17:19:49 +0000 (17:19 +0000)
commit172a797661d95873c4af528c497cb5e1dfa8b91f
tree4bfa289a1fe252534aed192c9303aeaef8aa353e
parentec94a46ee7ac999b0f10f7772c40aed3f604831b
arm64: unify native/compat instruction skipping

Skipping of an instruction on AArch32 works a bit differently from
AArch64, mainly due to the different CPSR/PSTATE semantics.

Currently arm64_skip_faulting_instruction() is only suitable for
AArch64, and arm64_compat_skip_faulting_instruction() handles the IT
state machine but is local to traps.c.

Since manual instruction skipping implies a trap, it's a relatively
slow path.

So, make arm64_skip_faulting_instruction() handle both compat and
native, and get rid of the arm64_compat_skip_faulting_instruction()
special case.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/traps.c