On 14/11/2018 18:59, Julien Grall wrote: > Hi Andrew, > > On 12/11/2018 16:16, Andrew Cooper wrote: >> The ARM code has a chicken-and-egg problem. One of the vGIC_v3 >> emulations > > NIT: s/vGIC_v3/vGICv3/
Will fix. > >> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c >> index 5a4f082..892445e 100644 >> --- a/xen/arch/arm/vgic.c >> +++ b/xen/arch/arm/vgic.c >> @@ -667,9 +667,27 @@ void vgic_free_virq(struct domain *d, unsigned >> int virq) >> clear_bit(virq, d->arch.vgic.allocated_irqs); >> } >> -unsigned int vgic_max_vcpus(const struct domain *d) >> +unsigned int vgic_max_vcpus(unsigned int domctl_vgic_version) >> { >> - return min_t(unsigned int, MAX_VIRT_CPUS, >> d->arch.vgic.handler->max_vcpus); >> + unsigned int max_vcpus; >> + >> + switch ( domctl_vgic_version ) >> + { >> + case XEN_DOMCTL_CONFIG_GIC_V2: >> + max_vcpus = 8; >> + break; >> + >> +#ifdef CONFIG_GICV3 >> + case XEN_DOMCTL_CONFIG_GIC_V3: >> + max_vcpus = 4092; > > The previous case was using 4096. Also, can you move the comment to > keep the rationale for the number? Please see the posted v3. This was a straight typo. > >> + break; >> +#endif >> + >> + default: >> + return 0; >> + } >> + >> + return min_t(unsigned int, MAX_VIRT_CPUS, max_vcpus); > > How about moving this check in the common code? Can do. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel