WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] 2.6.32 PV Xen donU guest panic on nested call to arch_en

To: Chuck Anderson <chuck.anderson@xxxxxxxxxx>
Subject: Re: [Xen-devel] 2.6.32 PV Xen donU guest panic on nested call to arch_enter_lazy_mmu_mode()
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 08 Dec 2010 14:28:51 -0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
Delivery-date: Wed, 08 Dec 2010 14:29:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CFED74D.1040304@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4CFED74D.1040304@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.6
On 12/07/2010 04:54 PM, Chuck Anderson wrote:
> 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().

Disabling interrupts would cause too much latency.  I think we may have
done this at one point, but it is very antisocial.

Since lazy mode is effectively disabled in interrupt handlers anyway, it
should just be enough to ignore enter/leave requests.  Does this work
for you?

From: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
Date: Wed, 8 Dec 2010 14:21:16 -0800
Subject: [PATCH] x86/paravirt: don't enter/leave lazy mode in interrupts.

We already ignore the current state of lazy mode in interrupts, but we
should also ignore any attempt to enter/leave lazy mode within
an interrupt context.

enter_lazy() will BUG if it sees an attempt at a nested entry to lazy
mode, which is generally an error.  However, it's possible that an
interrupt handler may do something that would trigger a batched MMU
update, for example, and that could interrupt an existing batched update.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
Reported-by: Chuck Anderson <chuck.anderson@xxxxxxxxxx>
Cc: Jan Beulich <JBeulich@xxxxxxxxxx>
Cc: Stable Kernel <stable@xxxxxxxxxx>

diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index c5b2500..a2ad10d 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -231,6 +231,9 @@ static DEFINE_PER_CPU(enum paravirt_lazy_mode, 
paravirt_lazy_mode) = PARAVIRT_LA
 
 static inline void enter_lazy(enum paravirt_lazy_mode mode)
 {
+       if (in_interrupt())
+               return;
+
        BUG_ON(percpu_read(paravirt_lazy_mode) != PARAVIRT_LAZY_NONE);
 
        percpu_write(paravirt_lazy_mode, mode);
@@ -238,6 +241,9 @@ static inline void enter_lazy(enum paravirt_lazy_mode mode)
 
 static void leave_lazy(enum paravirt_lazy_mode mode)
 {
+       if (in_interrupt())
+               return;
+
        BUG_ON(percpu_read(paravirt_lazy_mode) != mode);
 
        percpu_write(paravirt_lazy_mode, PARAVIRT_LAZY_NONE);


Thanks,
        J


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel