From: Julien Grall Date: Mon, 16 Feb 2015 14:50:50 +0000 (+0000) Subject: xen/arm: vgic-v2: Correctly set GICD_TYPER.CPUNumber X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3738 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fed3569c648f6a13d4dc1ed03d885e9339b85dea;p=xen.git xen/arm: vgic-v2: Correctly set GICD_TYPER.CPUNumber The number of implemented CPU interfaces is one more than the value of this field. Also avoid hardcoding the shift and remove useless mask. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c index 3b87f54012..0cf82efeba 100644 --- a/xen/arch/arm/vgic-v2.c +++ b/xen/arch/arm/vgic-v2.c @@ -55,7 +55,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info) if ( dabt.size != DABT_WORD ) goto bad_width; /* No secure world support for guests. */ vgic_lock(v); - *r = ( (v->domain->max_vcpus << 5) & GICD_TYPE_CPUS ) + *r = ( ((v->domain->max_vcpus - 1) << GICD_TYPE_CPUS_SHIFT) ) |( ((v->domain->arch.vgic.nr_spis / 32)) & GICD_TYPE_LINES ); vgic_unlock(v); return 1;