All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Julien Grall <julien.grall@linaro.org>,
	Jaeyong Yoo <jaeyong.yoo@samsung.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Bug report and patch about IRQ freezing after gic_restore_state
Date: Thu, 23 May 2013 14:24:09 +0100	[thread overview]
Message-ID: <1369315449.17830.59.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1305221754470.4799@kaball.uk.xensource.com>

On Wed, 2013-05-22 at 17:55 +0100, Stefano Stabellini wrote:
> On Wed, 22 May 2013, Jaeyong Yoo wrote:
> > I got it.
> > Here goes the updated patch:

Please can you include the (updated as necessary) changelog when
reposting variants on patches. I have written one for you this time.

> > 
> > Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
> 
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

I applied this but I had to workaround the fact that the patch had DOS
line endings.

Jaeyong, please can you try and fix this for next time.

The wiki page http://wiki.xen.org/wiki/Submitting_Xen_Patches might help
with some advice for tooling, in particular it has advice on using git
as well as a link to
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/email-clients.txt;hb=HEAD which has lots of useful advice on convincing your MUA not to mangle things...

What I have committed is below, please check that it is correct.

Cheers,
Ian.

commit 9f5179a4ecafd9a15e0a066e0f935ded681bf997
Author: Jaeyong Yoo <jaeyong.yoo@samsung.com>
Date:   Wed May 22 02:34:18 2013 +0000

    xen/arm: Disable interrupts for the entire duration of the context switch
    
    Not just while saving state. Otherwise there is a race between interrupts
    arriving and updating the LR state and gic_restore_state overwriting them with
    the saved state.
    
    With this change we no longer need to disable interrupts in gic_restore_state.
    
    Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    [ ijc -- rewrote commit message ]

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 9ca44ea..ee12b5f 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -226,10 +226,10 @@ static void schedule_tail(struct vcpu *prev)
 {
     ctxt_switch_from(prev);
 
-    local_irq_enable();
-
     ctxt_switch_to(current);
 
+    local_irq_enable();
+
     if ( prev != current )
         update_runstate_area(current);
 }
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 30bf8d1..d9940ea 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -93,11 +93,9 @@ void gic_restore_state(struct vcpu *v)
     if ( is_idle_vcpu(v) )
         return;
 
-    spin_lock_irq(&gic.lock);
     this_cpu(lr_mask) = v->arch.lr_mask;
     for ( i=0; i<nr_lrs; i++)
         GICH[GICH_LR + i] = v->arch.gic_lr[i];
-    spin_unlock_irq(&gic.lock);
     GICH[GICH_APR] = v->arch.gic_apr;
     GICH[GICH_HCR] = GICH_HCR_EN;
     isb();

  reply	other threads:[~2013-05-23 13:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  2:34 Bug report and patch about IRQ freezing after gic_restore_state Jaeyong Yoo
2013-05-22 16:55 ` Stefano Stabellini
2013-05-23 13:24   ` Ian Campbell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-05-23 23:57 Jaeyong Yoo
2013-05-21 11:13 유재용
2013-05-21 13:00 ` Ian Campbell
2013-05-20  0:41 Jaeyong Yoo
2013-05-20 13:11 ` Julien Grall
2013-05-21 12:00   ` Stefano Stabellini

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=1369315449.17830.59.camel@zakaz.uk.xensource.com \
    --to=ian.campbell@citrix.com \
    --cc=jaeyong.yoo@samsung.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.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.