[PATCH v1 10/26] KVM: arm64: Fix set_oslsr_el1 to write to OSLAR_EL1

Oliver Upton oupton at kernel.org
Mon Jun 1 15:21:33 PDT 2026


Hi,

On Fri, May 29, 2026 at 05:55:43PM +0200, Steffen Eiden wrote:
> From: Andreas Grapentin <gra at linux.ibm.com>
> 
> The set_oslsr_el1() function was incorrectly writing directly to the
> OSLSR_EL1 register, which is architecturally a read-only status register
> that reflects the state of the OS Lock.
> 
> Fix this by extracting the OSLK bit from the user-provided value and
> writing it to OSLAR_EL1 (OS Lock Access Register) instead, which is the
> proper control register for managing the OS Lock state. OSLSR_EL1 will
> then reflect this state when read.
> 
> This ensures the implementation follows the ARM architecture
> specification where OSLAR_EL1 controls the lock and OSLSR_EL1 provides
> status information.
> 
> Signed-off-by: Andreas Grapentin <gra at linux.ibm.com>
> Signed-off-by: Steffen Eiden <seiden at linux.ibm.com>

The current behavior of KVM is correct. KVM treats OSLSR_EL1 as the
stateful representation of the OS lock and is RO from the guest POV.

We keep the UAPI straightforward by making this register RW from
userspace, such that the VMM can directly write back the value returned
from KVM_GET_ONE_REG.

Do you have another reason for using OSLAR_EL1 as the canonical
representation?

Thanks,
Oliver



More information about the linux-arm-kernel mailing list