Skip to content

Commit 54ad68b

Browse files
mrutland-armMarc Zyngier
authored andcommitted
KVM: arm64: Don't log IMP DEF sysreg traps
We don't intend to support IMPLEMENATION DEFINED system registers, but have to trap them (and emulate them as UNDEFINED). These traps aren't interesting to the system administrator or to the KVM developers, so let's not bother logging when we do so. Signed-off-by: Mark Rutland <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bf4b96b commit 54ad68b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/arm64/kvm/sys_regs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,6 +2229,12 @@ int kvm_handle_cp14_32(struct kvm_vcpu *vcpu, struct kvm_run *run)
22292229
NULL, 0);
22302230
}
22312231

2232+
static bool is_imp_def_sys_reg(struct sys_reg_params *params)
2233+
{
2234+
// See ARM DDI 0487E.a, section D12.3.2
2235+
return params->Op0 == 3 && (params->CRn & 0b1011) == 0b1011;
2236+
}
2237+
22322238
static int emulate_sys_reg(struct kvm_vcpu *vcpu,
22332239
struct sys_reg_params *params)
22342240
{
@@ -2244,6 +2250,8 @@ static int emulate_sys_reg(struct kvm_vcpu *vcpu,
22442250

22452251
if (likely(r)) {
22462252
perform_access(vcpu, params, r);
2253+
} else if (is_imp_def_sys_reg(params)) {
2254+
kvm_inject_undefined(vcpu);
22472255
} else {
22482256
print_sys_reg_msg(params,
22492257
"Unsupported guest sys_reg access at: %lx [%08lx]\n",

0 commit comments

Comments
 (0)