hw/intc/arm_gicv3_kvm: Check KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS in reset
KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS needs to be checked before
attempting to read ICC_CTLR_EL1; otherwise kernel versions not
exposing this kvm device group will be incompatible with qemu 2.9.
Fixes: 07a5628  ("hw/intc/arm_gicv3_kvm: Reset GICv3 cpu interface registers")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reported-by: Prakash B <bjsprakash.linux@gmail.com>
Tested-by: Alexander Graf <agraf@suse.de>
Message-id: 1490721640-13052-1-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
			
			
This commit is contained in:
		
							parent
							
								
									05a6f451eb
								
							
						
					
					
						commit
						e7d54416cf
					
				| 
						 | 
				
			
			@ -614,12 +614,6 @@ static void arm_gicv3_icc_reset(CPUARMState *env, const ARMCPRegInfo *ri)
 | 
			
		|||
    s = c->gic;
 | 
			
		||||
    cpu = ARM_CPU(c->cpu);
 | 
			
		||||
 | 
			
		||||
    /* Initialize to actual HW supported configuration */
 | 
			
		||||
    kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS,
 | 
			
		||||
                      KVM_VGIC_ATTR(ICC_CTLR_EL1, cpu->mp_affinity),
 | 
			
		||||
                      &c->icc_ctlr_el1[GICV3_NS], false);
 | 
			
		||||
 | 
			
		||||
    c->icc_ctlr_el1[GICV3_S] = c->icc_ctlr_el1[GICV3_NS];
 | 
			
		||||
    c->icc_pmr_el1 = 0;
 | 
			
		||||
    c->icc_bpr[GICV3_G0] = GIC_MIN_BPR;
 | 
			
		||||
    c->icc_bpr[GICV3_G1] = GIC_MIN_BPR;
 | 
			
		||||
| 
						 | 
				
			
			@ -628,6 +622,17 @@ static void arm_gicv3_icc_reset(CPUARMState *env, const ARMCPRegInfo *ri)
 | 
			
		|||
    c->icc_sre_el1 = 0x7;
 | 
			
		||||
    memset(c->icc_apr, 0, sizeof(c->icc_apr));
 | 
			
		||||
    memset(c->icc_igrpen, 0, sizeof(c->icc_igrpen));
 | 
			
		||||
 | 
			
		||||
    if (s->migration_blocker) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Initialize to actual HW supported configuration */
 | 
			
		||||
    kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS,
 | 
			
		||||
                      KVM_VGIC_ATTR(ICC_CTLR_EL1, cpu->mp_affinity),
 | 
			
		||||
                      &c->icc_ctlr_el1[GICV3_NS], false);
 | 
			
		||||
 | 
			
		||||
    c->icc_ctlr_el1[GICV3_S] = c->icc_ctlr_el1[GICV3_NS];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void kvm_arm_gicv3_reset(DeviceState *dev)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue