From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: dario.faggioli@citrix.com, sstabellini@kernel.org,
julien.grall@arm.com, xen-devel@lists.xenproject.org
Subject: Re: CONFIG_SCRUB_DEBUG=y + arm64 + livepatch = Xen BUG at page_alloc.c:738
Date: Wed, 13 Sep 2017 11:32:42 -0400 [thread overview]
Message-ID: <20170913153242.GA11299@char.us.oracle.com> (raw)
In-Reply-To: <3d92481c-bdfb-f46a-cc52-c8d3e820d9b2@oracle.com>
On Tue, Sep 12, 2017 at 09:19:23PM -0400, Boris Ostrovsky wrote:
>
>
> On 09/12/2017 08:01 PM, Konrad Rzeszutek Wilk wrote:
> > On Mon, Sep 11, 2017 at 08:45:02PM -0400, Boris Ostrovsky wrote:
> > >
> > >
> > > On 09/11/2017 07:55 PM, Konrad Rzeszutek Wilk wrote:
> > > > Hey,
> > > >
> > > > I've only been able to reproduce this on ARM64 (trying right now ARM32
> > > > as well), and not on x86.
> > > >
> > > > If I compile Xen without CONFIG_SCRUB_DEBUG it works great. But if
> > > > enable it and try to load a livepatch it blows up in page_alloc.c:738
> > > >
> > > > This is with origin/staging (d0291f3391)
> > >
> > > Can you still reproduce this if you revert 307c3be?
> >
> > Sadly yes - it still crashes. I didn't capture the serial output.
> >
> > I honestly think the issue is that on ARM64 the "sleep" loop does not
> > wake up as often as on x86 (CC-ing Dariof who I believe observed this
> > with Credit2 and the wakeup.. something) - maybe he remembers the
> > details. Anyhow my theory is that the pages are not scrubbed at all
> > when they go in the idle loop as once it goes to sleep - it stays there.
>
>
> There is no (well, should not be) any timing dependencies in how/whether
> pages are scrubbed. If a page doesn't get scrubbed because someone didn't
> wake up then it should be scrubbed in alloc_heap_pages(). So in this case
> the page is thought to be clean (_PGC_need_scrub is not set), but it is not.
>
> Have you tried running a guest (or two), rebooting in a loop?
No. I just cold-booted it and tried to livepatch.
>
> Another thing to try is to set need_scrub to true in free_heap_pages().
Magic!
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index dbad1e1ca0..9303eb4517 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1308,6 +1308,7 @@ static void free_heap_pages(
ASSERT(node >= 0);
spin_lock(&heap_lock);
+ need_scrub = true;
for ( i = 0; i < (1 << order); i++ )
{
Fixes it ! :-)
>
> -boris
>
>
> >
> > Ah, see commit 05c52278a7c92bc753d9fe32017e4961012b9f23
> >
> > Maybe this is related?
> > >
> > >
> > > -boris
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-09-13 17:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 23:55 CONFIG_SCRUB_DEBUG=y + arm64 + livepatch = Xen BUG at page_alloc.c:738 Konrad Rzeszutek Wilk
2017-09-12 0:45 ` Boris Ostrovsky
2017-09-13 0:01 ` Konrad Rzeszutek Wilk
2017-09-13 1:19 ` Boris Ostrovsky
2017-09-13 15:32 ` Konrad Rzeszutek Wilk [this message]
2017-09-13 18:05 ` Boris Ostrovsky
2017-09-13 18:25 ` Julien Grall
2017-09-13 18:49 ` Boris Ostrovsky
2017-09-14 21:26 ` Konrad Rzeszutek Wilk
2017-09-14 21:39 ` Boris Ostrovsky
2017-09-15 18:48 ` Konrad Rzeszutek Wilk
2017-09-15 19:20 ` Boris Ostrovsky
2017-09-15 19:50 ` Konrad Rzeszutek Wilk
2017-09-15 20:28 ` Julien Grall
2017-09-13 7:56 ` Dario Faggioli
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=20170913153242.GA11299@char.us.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=dario.faggioli@citrix.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.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.