]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Stash OSLSR_EL1 in the cpu context
authorOliver Upton <oupton@google.com>
Thu, 3 Feb 2022 17:41:55 +0000 (17:41 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 8 Feb 2022 14:23:41 +0000 (14:23 +0000)
commit6d0f6fb182b8b87404c5975d77ad5f84db966479
tree62bba50566f32a4edc7457b9f9ed8b5089d12fe0
parentfd001b3c94b0fb43cc4aebc825c80eb622072140
KVM: arm64: Stash OSLSR_EL1 in the cpu context

An upcoming change to KVM will emulate the OS Lock from the PoV of the
guest. Add OSLSR_EL1 to the cpu context and handle reads using the
stored value. Define some mnemonics for for handling the OSLM field and
use them to make the reset value of OSLSR_EL1 more readable.

Wire up a custom handler for writes from userspace and prevent any of
the invariant bits from changing. Note that the OSLK bit is not
invariant and will be made writable by the aforementioned change.

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