]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: arm64: Define constant value for ICC_SRE_EL2
authorMarc Zyngier <maz@kernel.org>
Mon, 14 Jul 2025 12:26:26 +0000 (13:26 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 16 Jul 2025 03:24:29 +0000 (20:24 -0700)
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>
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/vgic/vgic.h

index dceb4f8f242a793808a75ba380226fa81a27ecd9..6981c1b34c2c443d5a81fd446956c63db60144da 100644 (file)
@@ -532,8 +532,7 @@ static bool access_gic_sre(struct kvm_vcpu *vcpu,
                return ignore_write(vcpu, p);
 
        if (p->Op1 == 4) {      /* ICC_SRE_EL2 */
-               p->regval = (ICC_SRE_EL2_ENABLE | ICC_SRE_EL2_SRE |
-                            ICC_SRE_EL1_DIB | ICC_SRE_EL1_DFB);
+               p->regval = KVM_ICC_SRE_EL2;
        } else {                /* ICC_SRE_EL1 */
                p->regval = vcpu->arch.vgic_cpu.vgic_v3.vgic_sre;
        }
index 4349084cb9a6c891d122b624c8898391531115ba..af4bf80b785c36ba7ba683c3ef8d523c59173942 100644 (file)
@@ -64,6 +64,9 @@
                                      KVM_REG_ARM_VGIC_SYSREG_CRM_MASK | \
                                      KVM_REG_ARM_VGIC_SYSREG_OP2_MASK)
 
+#define KVM_ICC_SRE_EL2                (ICC_SRE_EL2_ENABLE | ICC_SRE_EL2_SRE | \
+                                ICC_SRE_EL1_DIB | ICC_SRE_EL1_DFB)
+
 /*
  * As per Documentation/virt/kvm/devices/arm-vgic-its.rst,
  * below macros are defined for ITS table entry encoding.