]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: arm64: Expose self-hosted debug regs as RAZ/WI for protected guests
authorFuad Tabba <tabba@google.com>
Mon, 30 Mar 2026 14:48:07 +0000 (15:48 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 30 Mar 2026 15:58:07 +0000 (16:58 +0100)
Debug and trace are not currently supported for protected guests, so
trap accesses to the related registers and emulate them as RAZ/WI for
now. Although this isn't strictly compatible with the architecture, it's
sufficient for Linux guests and means that debug support can be added
later on.

Tested-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://patch.msgid.link/20260330144841.26181-7-will@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/sys_regs.c

index 06d28621722eee561df31bc55ca1262a14a4b42a..0a84140afa280b05bfcbfc06277e2c29c1a3e736 100644 (file)
@@ -392,6 +392,14 @@ static const struct sys_reg_desc pvm_sys_reg_descs[] = {
        /* Cache maintenance by set/way operations are restricted. */
 
        /* Debug and Trace Registers are restricted. */
+       RAZ_WI(SYS_DBGBVRn_EL1(0)),
+       RAZ_WI(SYS_DBGBCRn_EL1(0)),
+       RAZ_WI(SYS_DBGWVRn_EL1(0)),
+       RAZ_WI(SYS_DBGWCRn_EL1(0)),
+       RAZ_WI(SYS_MDSCR_EL1),
+       RAZ_WI(SYS_OSLAR_EL1),
+       RAZ_WI(SYS_OSLSR_EL1),
+       RAZ_WI(SYS_OSDLR_EL1),
 
        /* Group 1 ID registers */
        HOST_HANDLED(SYS_REVIDR_EL1),