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] evtchn_upcall_mask for PV-on-HVM

To: "Tian, Kevin" <kevin.tian@xxxxxxxxx>, Keir Fraser <keir@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] evtchn_upcall_mask for PV-on-HVM
From: Keir Fraser <keir@xxxxxxxxxxxxx>
Date: Thu, 30 Nov 2006 14:50:55 +0000
Cc: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Delivery-date: Thu, 30 Nov 2006 06:51:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <D470B4E54465E3469E2ABBC5AFAC390F051460@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AccUTduru7Rk1b5TSXG5odbpD2pVlgAEVL1sAAnMWAAAAiQIxA==
Thread-topic: [Xen-devel] evtchn_upcall_mask for PV-on-HVM
User-agent: Microsoft-Entourage/11.2.5.060620


On 30/11/06 13:56, "Tian, Kevin" <kevin.tian@xxxxxxxxx> wrote:

>> Local_events_need_delivery() should check for pending APIC/PIC
>> interrupts on
>> HVM. That'll fix the block() wakeup-waiting race too.
>> 
>> -- Keir
> 
> Hi, Keir,
> Sorry that I didn't quite catch you. Did you mean check for
> pending interrupts for same gsi line (used as callback irq)? Whether
> to actually pending an irq instance is decided by APIC/PIC themselves,
> right? Vmx_intr_assit just needs to check status of
> evtchn_upcall_pending which serves as a virtual wire state. BTW,
> what's the block() wakeup-waiting race above? :-)

I mean that the evtchn_upcall_pending flag is not the master flag indicating
whether there are pending interrupts for an HVM guest. So it is not the
correct thing to test in local_events_need_delivery(). The correct thing to
test is whether there are any interrupts pending from the PIC/IOAPIC.

The wakeup-waiting race is that a VCPU may block just when, for example, the
qemu-dm rtl8139 device model is asserting an interrupt. It will try to
vcpu_kick() and send an IPI to the CPU that is running the HVM VCPU.
However, before that IPI is received the other CPU may block the HVM VCPU
(after checking for local_events_need_delivery() which will in this case
return 0). So the rtl8139 interrupt does not prevent the HVM VCPU from
blocking, which is a bug.

 - Keir


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