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] do_iret bug in xen

To: "Ian Campbell" <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] do_iret bug in xen
From: "Ashish Bijlani" <ashish.bijlani@xxxxxxxxx>
Date: Tue, 27 Nov 2007 18:30:55 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 27 Nov 2007 15:31:33 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=74zruU3ugDysN0v949eLhzup3WwUvEd1KVqPpF80Cik=; b=r/WIb0u80HFSF6kueCpQtP5bkcDit4vu3pisyesg0UWqh11QltSP+q01FQSk8EuBVxIkKW6h8jlkzF2W3qUWeUEH/196WeIU2F7FuxnBkP0ktQs/UtScOqrr2qtjDOn+S4cAN0ZqE3SSH+Z4bbYutKI30aB6GbfgnSSpoYoPn8M=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=mnkSqATYOJevqmaI3D0ITBzU54DSw3Jkcim6TqQwyuCUPQ3+73DCjD5TpZ5JhU+VvcNJTtHfGEw5G2kCo8OsF0cfHy+tTjenlIBBS2f8WdZ79YIfXNwdwSBt4+rGVB866j7yzdBQrB3EvecD/l8z6IdjX5pKX64XQz2V5gEIUC0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1196205436.29110.26.camel@xxxxxxxxxxxxxxxxxxxxx>
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>
References: <E1Ix7Vw-000810-RL@host-192-168-0-1-bcn-london> <474C912B.2040401@xxxxxxxxxxxxxx> <ec55b17e0711271441l6145399fu963553fceb67694e@xxxxxxxxxxxxxx> <1196205436.29110.26.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
yeah but the do_iret function is done on behalf of a guest, therefore do_iret function forces user cs and user ss

code excerpt
"
    regs->rip    = iret_saved.rip;
    regs->cs     = iret_saved.cs | 3; /* force guest privilege */
    regs->rflags = (iret_saved.rflags & ~(EF_IOPL|EF_VM)) | EF_IE;
    regs->rsp    = iret_saved.rsp;
    regs->ss     = iret_saved.ss | 3; /* force guest privilege */
"
this can cause ret_from_intr go to test_all_events and finally go to __enter_scheduler

-a

On Nov 27, 2007 6:17 PM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:

On Tue, 2007-11-27 at 17:41 -0500, Ashish Bijlani wrote:
> "cpumask_raise_softirq(mask, SCHEDULE_SOFTIRQ)" sends an IPI to the
> target processor, this can cause current to change.

No it can't.

The IPI causes smp_event_check_interrupt() to be called which just ACKs
the IPI and returns via ret_from_intr (in entry.S). It is only if a
guest was interrupted that we go down the test_all_events path which
processes softirqs. If it was Xen which was interrupted then we go to
restore_all_xen which just returns to Xen. In this case Xen will
eventually return to the guest and take the test_all_events path and
process the softirq.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>