]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Emulate the OS Lock
authorOliver Upton <oupton@google.com>
Thu, 3 Feb 2022 17:41:57 +0000 (17:41 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 8 Feb 2022 14:23:41 +0000 (14:23 +0000)
commit67331b92d6e7aed9977b69e550fb4c6f0a095788
tree1051af3f34505cffca6918de7024352ca7d7c9b4
parent5ec987271e1db91ac58fcde7a858a9207672c021
KVM: arm64: Emulate the OS Lock

The OS lock blocks all debug exceptions at every EL. To date, KVM has
not implemented the OS lock for its guests, despite the fact that it is
mandatory per the architecture. Simple context switching between the
guest and host is not appropriate, as its effects are not constrained to
the guest context.

Emulate the OS Lock by clearing MDE and SS in MDSCR_EL1, thereby
blocking all but software breakpoint instructions.

Signed-off-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220203174159.2887882-5-oupton@google.com
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/debug.c
arch/arm64/kvm/sys_regs.c