Skip to content

Commit 8b6958d

Browse files
jingzhangosoupton
authored andcommitted
KVM: arm64: Use guest ID register values for the sake of emulation
Since KVM now supports per-VM ID registers, use per-VM ID register values for the sake of emulation for DBGDIDR and LORegion. Signed-off-by: Jing Zhang <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 6656cda commit 8b6958d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm64/kvm/sys_regs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static bool trap_loregion(struct kvm_vcpu *vcpu,
379379
struct sys_reg_params *p,
380380
const struct sys_reg_desc *r)
381381
{
382-
u64 val = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1);
382+
u64 val = IDREG(vcpu->kvm, SYS_ID_AA64MMFR1_EL1);
383383
u32 sr = reg_to_encoding(r);
384384

385385
if (!(val & (0xfUL << ID_AA64MMFR1_EL1_LO_SHIFT))) {
@@ -2445,8 +2445,8 @@ static bool trap_dbgdidr(struct kvm_vcpu *vcpu,
24452445
if (p->is_write) {
24462446
return ignore_write(vcpu, p);
24472447
} else {
2448-
u64 dfr = read_sanitised_ftr_reg(SYS_ID_AA64DFR0_EL1);
2449-
u64 pfr = read_sanitised_ftr_reg(SYS_ID_AA64PFR0_EL1);
2448+
u64 dfr = IDREG(vcpu->kvm, SYS_ID_AA64DFR0_EL1);
2449+
u64 pfr = IDREG(vcpu->kvm, SYS_ID_AA64PFR0_EL1);
24502450
u32 el3 = !!cpuid_feature_extract_unsigned_field(pfr, ID_AA64PFR0_EL1_EL3_SHIFT);
24512451

24522452
p->regval = ((((dfr >> ID_AA64DFR0_EL1_WRPs_SHIFT) & 0xf) << 28) |

0 commit comments

Comments
 (0)