[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 14/16] xen/arm: Add virtual GICv3 support
On 06/02/2014 05:38 PM, Ian Campbell wrote: > On Mon, 2014-06-02 at 17:18 +0100, Julien Grall wrote: >> On 06/02/2014 05:15 PM, Ian Campbell wrote: >>> On Mon, 2014-06-02 at 17:10 +0100, Julien Grall wrote: >>>> >>>>> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c >>>>> index 3fa0857..787c547 100644 >>>>> --- a/xen/arch/arm/vgic.c >>>>> +++ b/xen/arch/arm/vgic.c >>>>> @@ -264,10 +264,19 @@ int domain_vgic_init(struct domain *d) >>>>> else >>>>> d->arch.vgic.nr_lines = 0; /* We don't need SPIs for the guest */ >>>>> >>>>> - if ( gic_hw_version() == GIC_V2 ) >>>>> + switch ( gic_hw_version() ) >>>>> + { >>>>> +#ifdef CONFIG_ARM_64 >>>>> + case GIC_V3: >>>>> + vgic_v3_init(d); >>>>> + break; >>>>> +#endif >>>>> + case GIC_V2: >>>>> vgic_v2_init(d); >>>>> - else >>>>> + break; >>>>> + default: >>>>> panic("No VGIC found\n"); >>>> >>>> I think I've already said in an earlier patch. Please avoid to use panic >>>> when this function is called by a VM. >>> >>> Whether called from a guest or not, gic_hw_version's result is, I think, >>> completely under hypervisor control, if it returns a gic version which >>> we don't support then that is worthy of a panic() I think, or a >>> BUG_ON(), since that is a hypervisor coding issue. >> >> It won't be under hypervisor control if we add an hypercall to choose >> whether we want to use GICv2 or GICv3. > > That (tools only) hypercall should obviously validate that it knows > about the gic that is being asked for at the time. > > If on retrieval it is not something we understand then that is still a > hypervisor bug. Assuming we correctly validated the version given by the toolstack. I'm not very confident with a BUG_ON/panic in hypercall (this function is called during domain creation) when we can just return an error code and safely come back in a valid state (i.e nothing will leak...) Regards, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |