]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Trap WFI executed in userspace
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 1 Oct 2018 11:19:43 +0000 (12:19 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 1 Oct 2018 15:52:24 +0000 (16:52 +0100)
commit94e698cc74611582181ed7e0449d274f96694613
treebf2043211dbd9423e10005d6872d348065fb40cb
parent204891274558c99941cd8517d925ac29f6d854c4
arm64: Trap WFI executed in userspace

It recently came to light that userspace can execute WFI, and that
the arm64 kernel doesn't trap this event. This sounds rather benign,
but the kernel should decide when it wants to wait for an interrupt,
and not userspace.

Let's trap WFI and immediately return after having skipped the
instruction. This effectively makes WFI a rather expensive NOP.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/esr.h
arch/arm64/include/asm/sysreg.h
arch/arm64/kernel/entry.S
arch/arm64/kernel/traps.c