]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Fix debug register indexing
authorMarc Zyngier <maz@kernel.org>
Fri, 14 May 2021 08:05:41 +0000 (09:05 +0100)
committerMarc Zyngier <maz@kernel.org>
Sat, 15 May 2021 09:27:59 +0000 (10:27 +0100)
commitfaaf2117c44c44da063178b0c5dab9af1acf58fd
tree943c3870dc6e9ea53e33ba00457c48fd07255f37
parent26e0aabb38a683ebfd1db1d51b3e116624e049b7
KVM: arm64: Fix debug register indexing

Commit f9196de60c0d5 ("KVM: arm64: Don't write junk to sysregs on
reset") flipped the register number to 0 for all the debug registers
in the sysreg table, hereby indicating that these registers live
in a separate shadow structure.

However, the author of this patch failed to realise that all the
accessors are using that particular index instead of the register
encoding, resulting in all the registers hitting index 0. Not quite
a valid implementation of the architecture...

Address the issue by fixing all the accessors to use the CRm field
of the encoding, which contains the debug register index.

Fixes: f9196de60c0d5 ("KVM: arm64: Don't write junk to sysregs on reset")
Reported-by: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
arch/arm64/kvm/sys_regs.c