From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jan Beulich <JBeulich@novell.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Chuck Anderson <chuck.anderson@oracle.com>
Subject: Re: 2.6.32 PV Xen donU guest panic on nested call to arch_enter_lazy_mmu_mode()
Date: Wed, 08 Dec 2010 13:21:20 -0800 [thread overview]
Message-ID: <4CFFF6D0.80603@goop.org> (raw)
In-Reply-To: <4CFF54560200007800026A7C@vpn.id2.novell.com>
On 12/08/2010 12:48 AM, Jan Beulich wrote:
>>>> On 08.12.10 at 01:54, Chuck Anderson <chuck.anderson@oracle.com> wrote:
>> I'm posting this because I am writing a patch to fix a 2.6.32 based PV
>> Xen domU panic due to a nested call to arch/x86/include/asm/paravirt.h
>> arch_enter_lazy_mmu_mode() (see details below). The following BUG_ON()
>> was triggered:
>>
>> arch/x86/kernel/paravirt.c
>>
>> static inline void enter_lazy(enum paravirt_lazy_mode mode)
>> {
>> BUG_ON(percpu_read(paravirt_lazy_mode) != PARAVIRT_LAZY_NONE);
>>
>> percpu_write(paravirt_lazy_mode, mode);
>> }
>>
>> because enter_lazy() was called twice, once through mm/memory.c
>> copy_pte_range() and a second time through an interrupt path.
>>
>> The easy fix is to disable interrupts in copy_pte_range() before calling
>> arch_enter_lazy_mmu_mode() and re-enable them after the call to
>> arch_leave_lazy_mmu_mode() but I'm asking if there is a better way to
>> handle this. If disabling interrupts is best, there are other calls to
>> arch_enter_lazy_mmu_mode() that appear to have the same interruption
>> issue. It may be best then to disable interrupts in
>> arch_enter_lazy_mmu_mode() or paravirt_enter_lazy_mmu().
> I don't think this is an option, as the period of time for which you
> would disable interrupts could be pretty much unbounded.
>
> Instead (being a performance optimization only anyway)
> the BUG_ON() could be removed (accepting that the
> interrupted sequence would not batch any further
> hypercalls, and provided all of this stuff can actually be
> used in a nested way), the flag could be converted to a
> counter (again provided nesting is okay here in the first
> place), or a filter could be applied when actually checking
> whether to batch (which is what we do in our non-pvops
> kernels: in IRQ context, no batching happens).
That's what happens in pvops kernels too - batching is disabled in
interrupt context so that (for example) vmalloc pagefault pte updates
aren't deferred.
Looks like enter/leave lazy should just be no-op in interrupt context too.
Though I'm surprised it has taken so long for this to appear.
J
next prev parent reply other threads:[~2010-12-08 21:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-08 0:54 2.6.32 PV Xen donU guest panic on nested call to arch_enter_lazy_mmu_mode() Chuck Anderson
2010-12-08 8:48 ` Jan Beulich
2010-12-08 21:21 ` Jeremy Fitzhardinge [this message]
2010-12-08 22:28 ` Jeremy Fitzhardinge
2010-12-09 1:21 ` Chuck Anderson
2010-12-09 6:50 ` Chuck Anderson
2010-12-09 17:43 ` Jeremy Fitzhardinge
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=4CFFF6D0.80603@goop.org \
--to=jeremy@goop.org \
--cc=JBeulich@novell.com \
--cc=chuck.anderson@oracle.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.