All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	tim@xen.org, stefano.stabellini@citrix.com,
	xen-devel@lists.xenproject.org, parth.dixit@linaro.org,
	christoffer.dall@linaro.org
Subject: Re: [PATCH for-4.6 4/4] xen/arm: Find automatically a PPI for the DOM0 event channel interrupt
Date: Tue, 13 Jan 2015 15:58:39 +0000	[thread overview]
Message-ID: <1421164719.19103.134.camel@citrix.com> (raw)
In-Reply-To: <548F07B5.5020601@linaro.org>

On Mon, 2014-12-15 at 16:09 +0000, Julien Grall wrote:
> Hi Stefano,
> 
> On 15/12/14 15:35, Stefano Stabellini wrote:
> > On Fri, 12 Dec 2014, Julien Grall wrote:
> >> Use the new vgic interface to know which virtual PPI is free and use it
> >> for the event channel code.
> >>
> >> At the DOM0 creation time, Xen still don't know which vIRQ will be free.
> >> All the vIRQ will be reserved when we parse the device tree. So allocate
> >> when the hypervisor node is created.
> >>
> >> It's safe to defer the allocation because no vIRQ can be injected as
> >> long as the vCPU is not online.
> >>
> >> Also correct the check in arch_domain_create to use is_hardware_domain.
> >>
> >> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> >> ---
> >>  xen/arch/arm/domain.c                | 13 ++++++++++---
> >>  xen/arch/arm/domain_build.c          | 10 ++++++++++
> >>  xen/arch/arm/platform.c              |  7 -------
> >>  xen/arch/arm/platforms/xgene-storm.c |  1 -
> >>  xen/include/asm-arm/platform.h       |  4 ----
> >>  5 files changed, 20 insertions(+), 15 deletions(-)
> >>
> >> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> >> index 7221bc8..7d14377 100644
> >> --- a/xen/arch/arm/domain.c
> >> +++ b/xen/arch/arm/domain.c
> >> @@ -543,10 +543,17 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
> >>      if ( (rc = domain_vtimer_init(d)) != 0 )
> >>          goto fail;
> >>  
> >> -    if ( d->domain_id )
> >> +    /*
> >> +     * The hardware domain will get a PPI later in
> >> +     * arch/arm/domain_build.c  depending on the
> >> +     * interrupt map of the hardware.
> >> +     */
> >> +    if ( !is_hardware_domain(d) )
> >> +    {
> >>          d->arch.evtchn_irq = GUEST_EVTCHN_PPI;
> >> -    else
> >> -        d->arch.evtchn_irq = platform_dom0_evtchn_ppi();
> >> +        /* At this stage vgic_reserve_virq should never fail */
> >> +        BUG_ON(vgic_reserve_virq(d, GUEST_EVTCHN_PPI));
> >> +    }
> > 
> > Why do we still need this, if we have another vgic_allocate_virq call in
> > make_hypervisor_node? Wouldn't that work for DomUs too?
> 
> Because make_hypervisor_node is only used for DOM0.

Yeah.

> Futhermore, DOMUs
> are using a specific hardcoded layout (see xen/include/public/arch-arm.h).

They don't actually have to be, but exposing vgic_allocate_virq to the
tools would be overkill, so hardcoding is the pragmatic choice.

We could e.g. randomise the PPI in the tools, to stop people making
assumptions. (If we were feeling mean of course...)

Ian.

  reply	other threads:[~2015-01-13 16:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12 14:43 [PATCH for-4.6 0/4] Find automatically a PPI for the DOM0 even channel IRQ Julien Grall
2014-12-12 14:43 ` [PATCH for-4.6 1/4] xen/arm: vgic: Rename nr_lines into nr_spis Julien Grall
2015-01-13 15:38   ` Ian Campbell
2015-01-13 15:52     ` Julien Grall
2015-01-13 15:59       ` Ian Campbell
2014-12-12 14:43 ` [PATCH for-4.6 2/4] xen/arm: vgic: Keep track of vIRQ used by a domain Julien Grall
2014-12-15 15:32   ` Stefano Stabellini
2014-12-15 16:07     ` Julien Grall
2014-12-17 15:23       ` Julien Grall
2015-01-13 15:51   ` Ian Campbell
2015-01-13 16:27     ` Julien Grall
2015-01-13 16:46       ` Ian Campbell
2015-01-13 16:57         ` Julien Grall
2015-01-13 17:18           ` Ian Campbell
2015-01-13 17:35             ` Julien Grall
2015-01-13 17:22           ` Julien Grall
2015-01-13 17:34         ` Julien Grall
2014-12-12 14:43 ` [PATCH for-4.6 3/4] xen/arm: vgic: notice if the vIRQ is not allocated when the guest enable it Julien Grall
2015-01-13 15:55   ` Ian Campbell
2015-01-13 20:33     ` Julien Grall
2015-01-14 12:28       ` Ian Campbell
2015-01-14 12:42         ` Julien Grall
2015-01-15 13:27           ` Julien Grall
2015-01-15 13:31             ` Ian Campbell
2014-12-12 14:43 ` [PATCH for-4.6 4/4] xen/arm: Find automatically a PPI for the DOM0 event channel interrupt Julien Grall
2014-12-12 17:00   ` Julien Grall
2014-12-15 15:35   ` Stefano Stabellini
2014-12-15 16:09     ` Julien Grall
2015-01-13 15:58       ` Ian Campbell [this message]
2015-01-14 12:24         ` Julien Grall
2015-01-14 12:30           ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421164719.19103.134.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=christoffer.dall@linaro.org \
    --cc=julien.grall@linaro.org \
    --cc=parth.dixit@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.