From: Julien Grall <julien.grall@linaro.org>
To: Andrii Tseglytskyi <andrii.tseglytskyi@globallogic.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Ian Campbell <Ian.Campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: Xen 4.5 random freeze question
Date: Wed, 19 Nov 2014 14:05:58 +0000 [thread overview]
Message-ID: <546CA3C6.6010406@linaro.org> (raw)
In-Reply-To: <CAH_mUMOTpKiyn91N5f2hUsZ1TFTMKRLJj795FLK6LdYRNS=h+w@mail.gmail.com>
On 11/19/2014 01:30 PM, Andrii Tseglytskyi wrote:
> On Wed, Nov 19, 2014 at 3:26 PM, Julien Grall <julien.grall@linaro.org> wrote:
>> On 11/19/2014 12:40 PM, Andrii Tseglytskyi wrote:
>>> Hi Julien,
>>>
>>> On Wed, Nov 19, 2014 at 2:23 PM, Julien Grall <julien.grall@linaro.org> wrote:
>>>> On 11/19/2014 12:17 PM, Stefano Stabellini wrote:
>>>>> On Wed, 19 Nov 2014, Ian Campbell wrote:
>>>>>> On Wed, 2014-11-19 at 11:42 +0000, Stefano Stabellini wrote:
>>>>>>> So it looks like there is not actually anything wrong, is just that you
>>>>>>> have too much inflight irqs? It should cause problems because in that
>>>>>>> case GICH_HCR_UIE should be set and you should get a maintenance
>>>>>>> interrupt when LRs become available (actually when "none, or only one,
>>>>>>> of the List register entries is marked as a valid interrupt").
>>>>>>>
>>>>>>> Maybe GICH_HCR_UIE is the one that doesn't work properly.
>>>>>>
>>>>>> How much testing did this aspect get when the no-maint-irq series
>>>>>> originally went in? Did you manage to find a workload which filled all
>>>>>> the LRs or try artificially limiting the number of LRs somehow in order
>>>>>> to provoke it?
>>>>>>
>>>>>> I ask because my intuition is that this won't happen very much, meaning
>>>>>> those code paths may not be as well tested...
>>>>>
>>>>> I did test it by artificially limiting the number of LRs to 1.
>>>>> However there have been many iterations of that series and I didn't run
>>>>> this test at every iteration.
>>>>
>>>> am I the only to think this may not be related to this bug? All the LRs
>>>> are full with IRQ of the same priority. So it's valid.
>>>>
>>>> As gic_restore_pending_irqs is called every time that we return to the
>>>> guest. It could be anything else.
>>>>
>>>> It would be interesting to see why we are trapping all the time in Xen.
>>>>
>>>
>>> I may perform any test if you have some specific scenario.
>>
>> I have no specific scenario in my mind :/.
>>
>> It looks like I'm able to reproduce it on my ARM board by the restricted
>> the number of LRs to 1.
>>
>
> Do you mean that you got a hang with current xen/master branch ?
Yes but I forgot to update another part of the code.
With the patch below to restrict the number of LRs I'm still able to boot.
And don't see any maintenance interrupt.
Stefano, is it valid?
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index faad1ff..c1c0f7ff 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -327,6 +327,7 @@ static void __cpuinit gicv2_hyp_init(void)
vtr = readl_gich(GICH_VTR);
nr_lrs = (vtr & GICH_V2_VTR_NRLRGS) + 1;
gicv2_info.nr_lrs = nr_lrs;
+ gicv2_info.nr_lrs = 1;
writel_gich(GICH_MISR_EOI, GICH_MISR);
}
@@ -488,6 +489,16 @@ static void gicv2_write_lr(int lr, const struct gic_lr *lr_reg)
static void gicv2_hcr_status(uint32_t flag, bool_t status)
{
+ uint32_t lr = readl_gich(GICH_LR + 0);
+
+ if ( status )
+ lr |= GICH_V2_LR_MAINTENANCE_IRQ;
+ else
+ lr &= ~GICH_V2_LR_MAINTENANCE_IRQ;
+
+ writel_gich(lr, GICH_LR + 0);
+
+#if 0
uint32_t hcr = readl_gich(GICH_HCR);
if ( status )
@@ -496,6 +507,7 @@ static void gicv2_hcr_status(uint32_t flag, bool_t status)
hcr &= (~flag);
writel_gich(hcr, GICH_HCR);
+#endif
}
static unsigned int gicv2_read_vmcr_priority(void)
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 70d10d6..c726d7a 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -599,6 +599,7 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
* on return to guest that is going to clear the old LRs and inject
* new interrupts.
*/
+ gdprintk(XENLOG_DEBUG, "\n");
}
void gic_dump_info(struct vcpu *v)
--
Julien Grall
prev parent reply other threads:[~2014-11-19 14:05 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-14 14:25 Xen 4.5 random freeze question Andrii Tseglytskyi
2014-11-14 14:35 ` Stefano Stabellini
2014-11-14 14:43 ` Andrii Tseglytskyi
2014-11-14 15:22 ` Stefano Stabellini
2014-11-14 15:39 ` Andrii Tseglytskyi
2014-11-14 15:49 ` Julien Grall
2014-11-14 15:58 ` Andrii Tseglytskyi
2014-11-14 16:15 ` Stefano Stabellini
2014-11-14 16:22 ` Andrii Tseglytskyi
2014-11-14 16:35 ` Julien Grall
2014-11-14 16:40 ` Andrii Tseglytskyi
2014-11-17 15:47 ` Andrii Tseglytskyi
2014-11-17 16:39 ` Stefano Stabellini
2014-11-17 17:05 ` Andrii Tseglytskyi
2014-11-17 18:02 ` Stefano Stabellini
2014-11-18 10:41 ` Andrii Tseglytskyi
2014-11-18 11:31 ` Andrii Tseglytskyi
2014-11-18 12:35 ` Andrii Tseglytskyi
2014-11-18 15:39 ` Stefano Stabellini
2014-11-18 16:11 ` Andrii Tseglytskyi
2014-11-18 16:14 ` Stefano Stabellini
2014-11-18 16:18 ` Andrii Tseglytskyi
2014-11-18 16:46 ` Andrii Tseglytskyi
2014-11-18 17:51 ` Stefano Stabellini
2014-11-19 9:38 ` Andrii Tseglytskyi
2014-11-19 11:12 ` Stefano Stabellini
2014-11-19 11:16 ` Andrii Tseglytskyi
2014-11-19 11:42 ` Stefano Stabellini
2014-11-19 11:57 ` Andrii Tseglytskyi
2014-11-19 11:59 ` Stefano Stabellini
2014-11-19 12:37 ` Andrii Tseglytskyi
2014-11-19 14:52 ` Stefano Stabellini
2014-11-19 15:27 ` Andrii Tseglytskyi
2014-11-19 15:41 ` Stefano Stabellini
2014-11-19 16:01 ` Andrii Tseglytskyi
2014-11-19 16:09 ` Andrii Tseglytskyi
2014-11-19 16:13 ` Stefano Stabellini
2014-11-19 16:29 ` Andrii Tseglytskyi
2014-11-19 16:32 ` Andrii Tseglytskyi
2014-11-19 16:43 ` Andrii Tseglytskyi
2014-11-19 16:52 ` Stefano Stabellini
2014-11-19 16:50 ` Stefano Stabellini
2014-11-19 17:03 ` Andrii Tseglytskyi
2014-11-19 17:07 ` Stefano Stabellini
2014-11-19 17:37 ` Andrii Tseglytskyi
2014-11-19 17:42 ` Stefano Stabellini
2014-11-19 17:47 ` Andrii Tseglytskyi
2014-11-19 18:06 ` Andrii Tseglytskyi
2014-11-19 18:14 ` Stefano Stabellini
2014-11-19 18:26 ` Julien Grall
2014-11-19 18:31 ` Stefano Stabellini
2014-11-19 19:24 ` Andrii Tseglytskyi
2014-11-20 10:28 ` Stefano Stabellini
2014-11-20 11:15 ` Julien Grall
2014-11-20 16:06 ` Andrii Tseglytskyi
2014-11-20 16:15 ` Stefano Stabellini
2014-11-20 16:43 ` Andrii Tseglytskyi
2014-11-19 17:11 ` Andrii Tseglytskyi
2014-11-19 17:14 ` Stefano Stabellini
2014-11-19 12:13 ` Ian Campbell
2014-11-19 12:17 ` Stefano Stabellini
2014-11-19 12:23 ` Julien Grall
2014-11-19 12:40 ` Andrii Tseglytskyi
2014-11-19 13:26 ` Julien Grall
2014-11-19 13:30 ` Andrii Tseglytskyi
2014-11-19 14:05 ` 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=546CA3C6.6010406@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=andrii.tseglytskyi@globallogic.com \
--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.