Skip to content

Commit c6ef468

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: Define constant value for ICC_SRE_EL2
Move the bag of bits defining the value of ICC_SRE_EL2 to a common spot so that it can be reused by the save/restore code. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20250714122634.3334816-4-maz@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent c70a402 commit c6ef468

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,7 @@ static bool access_gic_sre(struct kvm_vcpu *vcpu,
532532
return ignore_write(vcpu, p);
533533

534534
if (p->Op1 == 4) { /* ICC_SRE_EL2 */
535-
p->regval = (ICC_SRE_EL2_ENABLE | ICC_SRE_EL2_SRE |
536-
ICC_SRE_EL1_DIB | ICC_SRE_EL1_DFB);
535+
p->regval = KVM_ICC_SRE_EL2;
537536
} else { /* ICC_SRE_EL1 */
538537
p->regval = vcpu->arch.vgic_cpu.vgic_v3.vgic_sre;
539538
}

arch/arm64/kvm/vgic/vgic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
KVM_REG_ARM_VGIC_SYSREG_CRM_MASK | \
6565
KVM_REG_ARM_VGIC_SYSREG_OP2_MASK)
6666

67+
#define KVM_ICC_SRE_EL2 (ICC_SRE_EL2_ENABLE | ICC_SRE_EL2_SRE | \
68+
ICC_SRE_EL1_DIB | ICC_SRE_EL1_DFB)
69+
6770
/*
6871
* As per Documentation/virt/kvm/devices/arm-vgic-its.rst,
6972
* below macros are defined for ITS table entry encoding.

0 commit comments

Comments
 (0)