All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xensource.com
Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH v3 2/2] xen/arm: support irq delivery to vcpu > 0
Date: Wed, 04 Jun 2014 15:46:51 +0100	[thread overview]
Message-ID: <538F315B.2030506@linaro.org> (raw)
In-Reply-To: <1401892553-20150-2-git-send-email-stefano.stabellini@eu.citrix.com>

Hi Stefano,

You removed the bits to make ITARGET read-only. Why? With this patch
series, Xen doesn't validate ITARGET and a malicious guest could crash
Xen...

On 06/04/2014 03:35 PM, Stefano Stabellini wrote:
> Export vgic_get_target_vcpu.
> Use vgic_get_target_vcpu to retrieve the target vcpu from do_IRQ.
> Route guest irqs to vcpu0 initially.
> Remove in-code comments about missing implementation of SGI delivery to
> vcpus other than 0.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> ---
>  xen/arch/arm/gic.c        |    3 +--
>  xen/arch/arm/irq.c        |    7 +++----
>  xen/arch/arm/vgic.c       |    2 +-
>  xen/include/asm-arm/gic.h |    2 ++
>  4 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index 08ae23b..125ff36 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -287,8 +287,7 @@ void gic_route_irq_to_guest(struct domain *d, struct irq_desc *desc,
>      gic_set_irq_properties(desc->irq, level, cpumask_of(smp_processor_id()),
>                             GIC_PRI_IRQ);
>  
> -    /* TODO: do not assume delivery to vcpu0 */
> -    p = irq_to_pending(d->vcpu[0], desc->irq);
> +    p = irq_to_pending(d->vcpu[cpumask_first(cpu_mask)], desc->irq);

Hrmmm... you misused the mask here. cpumask contains a list a physical
CPU not Virtual CPU...

[..]

> @@ -342,8 +341,8 @@ int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
>          goto out;
>  
>      level = dt_irq_is_level_triggered(irq);
> -    gic_route_irq_to_guest(d, desc, level, cpumask_of(smp_processor_id()),
> -                           GIC_PRI_IRQ);
> +    /* route to vcpu0 initially */
> +    gic_route_irq_to_guest(d, desc, level, cpumask_of(0), GIC_PRI_IRQ);

That makes the comment here wrong.

Regards,

-- 
Julien Grall

      reply	other threads:[~2014-06-04 14:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 14:33 [PATCH v3 0/2] vgic emulation and GICD_ITARGETSR Stefano Stabellini
2014-06-04 14:35 ` [PATCH v3 1/2] xen/arm: observe itarget setting in vgic_enable_irqs and vgic_disable_irqs Stefano Stabellini
2014-06-04 14:35 ` [PATCH v3 2/2] xen/arm: support irq delivery to vcpu > 0 Stefano Stabellini
2014-06-04 14:46   ` Julien Grall [this message]

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=538F315B.2030506@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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.