]> www.infradead.org Git - users/jedix/linux-maple.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)
commitc219bc4e920518feb025749bdf9623aa57e94b64
treebf2043211dbd9423e10005d6872d348065fb40cb
parentee91176120bd584aa10c564e7e9fdcaf397190a1
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