]> 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)
commit62f2ff2f54e3f29ecbbfce65ce1c2db6208a0c1b
tree1051af3f34505cffca6918de7024352ca7d7c9b4
parent525c033cdc316a442cbde9402db2ca2087707f51
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