From: Ian Campbell Subject: Re: [PATCH v2 08/21] xen/arm: Initialize the virtual GIC later Date: Fri, 12 Sep 2014 11:14:50 +0100 Message-ID: <1410516890.567.49.camel@kazak.uk.xensource.com> References: <1406818852-31856-1-git-send-email-julien.grall@linaro.org> <1406818852-31856-9-git-send-email-julien.grall@linaro.org> <541229D9.6070502@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XSNsV-0003ly-7n for xen-devel@lists.xenproject.org; Fri, 12 Sep 2014 10:14:55 +0000 In-Reply-To: <541229D9.6070502@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Stefano Stabellini , Ian Jackson , tim@xen.org, stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On Thu, 2014-09-11 at 16:01 -0700, Julien Grall wrote: > >> diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c > >> index 45974e7..bab92b2 100644 > >> --- a/xen/arch/arm/domctl.c > >> +++ b/xen/arch/arm/domctl.c > >> @@ -30,6 +30,17 @@ long arch_do_domctl(struct xen_domctl *domctl, struct domain *d, > >> > >> return p2m_cache_flush(d, s, e); > >> } > >> + case XEN_DOMCTL_configure_domain: > >> + { > >> + if ( domain_vgic_is_initialized(d) ) > >> + return -EBUSY; > > > > Given that XEN_DOMCTL_configure_domain should be called exactly once at > > domain creation, instead of introducing domain_vgic_is_initialized, I > > would make sure that XEN_DOMCTL_configure_domain hasn't been called for > > this domain before. In other words, I would make this check more > > generic, rather than vgic specific. > > The VGIC initialization may have fail because there is not enough > memory. So it would be valid, even if it's stupid, to call this DOMCTL > twice. I think there was an implied "successfully" in what Stefano said. That said it's hard to imagine that a toolstack would retry on failure of such a hypercall, rather than aborting the build entirely (and perhaps trying again at that level) > domain_vgic_is_initialized is also used in vcpu_initialise to check that > the VGIC has effectively been initialized > > I would keep this check for now. >