All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Riku Voipio <riku.voipio@linaro.org>, Tim Deegan <tim@xen.org>,
	stefano.stabellini@citrix.com, Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org,
	Tamas K Lengyel <tklengyel@sec.in.tum.de>
Subject: Re: [PATCH] xen/arm: Make local_events_need_delivery working with idle VPCU
Date: Tue, 5 May 2015 12:40:35 +0100	[thread overview]
Message-ID: <1430826035.2660.52.camel@citrix.com> (raw)
In-Reply-To: <553E6489.30300@citrix.com>

On Mon, 2015-04-27 at 17:32 +0100, Julien Grall wrote:
> >> diff --git a/xen/include/asm-arm/event.h b/xen/include/asm-arm/event.h
> >> index 5330dfe..0149d06 100644
> >> --- a/xen/include/asm-arm/event.h
> >> +++ b/xen/include/asm-arm/event.h
> >> @@ -39,7 +39,12 @@ static inline int local_events_need_delivery_nomask(void)
> >>  
> >>  static inline int local_events_need_delivery(void)
> >>  {
> >> -    if ( !vcpu_event_delivery_is_enabled(current) )
> >> +    struct vcpu *v = current;
> >> +
> >> +    if ( unlikely(is_idle_vcpu(v)) )
> >> +        return 0;
> >> +
> >> +    if ( !vcpu_event_delivery_is_enabled(v) )
> >>          return 0;
> >>      return local_events_need_delivery_nomask();
> >>  }
> > 
> > Is it actually considered correct in Xen to call hypercall_preempt_check
> > and/or local_events_need_delivery on the idle vcpu?
> 
> It seems that the x86 version of hypercall_preempt_check is able to cope
> with idle VCPU. 

AFAICT that's just a coincidence, since an idle vcpu won't ever have a
pending up call.

> Although, I'm not sure if there is path where
> hypercall_preempt_check can be called on an idle VCPU (cc x86
> maintainers for this purpose).
> 
> > Shouldn't it be avoided and maybe a BUG_ON added here instead?
> 
> This patch was the simple way to fix the bug. I have other ideas in mind
> which require some rework in apply_p2m_changes.
> 
> I'll wait to see what x86 maintainers think.

I'm inclined to just go with this patch for now, unless Stefano is
nacking it.

One question first: What aspect of local_events_need_delivery relies on
the vcpu not being an idle one? I suppose something is not initialised,
but what.

Ian.

  parent reply	other threads:[~2015-05-05 11:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 14:39 [PATCH] xen/arm: Make local_events_need_delivery working with idle VPCU Julien Grall
2015-04-27 15:36 ` Stefano Stabellini
2015-04-27 16:32   ` Julien Grall
2015-05-04 11:44     ` Riku Voipio
2015-05-04 11:50       ` Julien Grall
2015-05-05 11:40     ` Ian Campbell [this message]
2015-05-05 11:48       ` Stefano Stabellini
2015-05-05 12:00       ` Julien Grall
2015-05-05 12:29         ` Ian Campbell
2015-05-05 14:37           ` Julien Grall
2015-04-27 15:40 ` Tamas K Lengyel
2015-04-27 16:13   ` Julien Grall
2015-04-27 16:25     ` Tamas K Lengyel

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=1430826035.2660.52.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@citrix.com \
    --cc=riku.voipio@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=tklengyel@sec.in.tum.de \
    --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.