]> 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)
commit7cbf954cc2d4d642186b8b10e43351f21f0d8bdb
tree62bba50566f32a4edc7457b9f9ed8b5089d12fe0
parentb7077afe649c22a18b0f3c505c3ecc58583da4d2
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