On 15/08/18 14:17, Julien Grall wrote:
>>> diff --git a/xen/arch/arm/vgic/vgic.c b/xen/arch/arm/vgic/vgic.c
>>> index 832632a..4124817 100644
>>> --- a/xen/arch/arm/vgic/vgic.c
>>> +++ b/xen/arch/arm/vgic/vgic.c
>>> @@ -951,27 +951,7 @@ void vgic_sync_hardware_irq(struct domain *d,
>>> unsigned int vgic_max_vcpus(const struct domain *d)
>>> {
>>> - unsigned int vgic_vcpu_limit;
>>> -
>>> - switch ( d->arch.vgic.version )
>>> - {
>>> - case GIC_INVALID:
>>> - /*
>>> - * Since evtchn_init would call domain_max_vcpus for poll_mask
>>> - * allocation before the VGIC has been initialised, we need to
>>> - * return some safe value in this case. As this is for
>>> allocation
>>> - * purposes, go with the maximum value.
>>> - */
>>> - vgic_vcpu_limit = MAX_VIRT_CPUS;
>>> - break;
>>> - case GIC_V2:
>>> - vgic_vcpu_limit = VGIC_V2_MAX_CPUS;
>>> - break;
>>> - default:
>>> - BUG();
>>> - }
>>> -
>>> - return min_t(unsigned int, MAX_VIRT_CPUS, vgic_vcpu_limit);
>>> + return min_t(unsigned int, MAX_VIRT_CPUS,
>>> d->arch.vgic.handler->max_vcpus);
>>> }
>>
>> Since both implementations are equal now, can you place this in vgic.h
>> as a static inline function?
>
> vgic/vgic.c is part of the new vGIC implementation (selectable at th e
> compilation time) and using a different layout for the vgic_dist
> structure. The structure is described in asm/new_vgic.h and does not
> store the max vcpus anymore.
>
> Instead, the switch should be retained and only the case GIC_INVALID
> should be dropped.
What about GIC_V3? VGIC_V3_MAX_CPUS seems to be 255 at the moment.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel