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

[Xen-devel] Re: [RFC PATCH 16/33] Add support for Xen to entry.S.

To: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [RFC PATCH 16/33] Add support for Xen to entry.S.
From: Chris Wright <chrisw@xxxxxxxxxxxx>
Date: Tue, 18 Jul 2006 13:43:33 -0700
Cc: Andrew Morton <akpm@xxxxxxxx>, Zachary Amsden <zach@xxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Andi Kleen <ak@xxxxxxx>, Chris Wright <chrisw@xxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
Delivery-date: Tue, 18 Jul 2006 13:43:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1153250220.5467.38.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: <20060718091807.467468000@xxxxxxxxxxxx> <20060718091952.505770000@xxxxxxxxxxxx> <1153250220.5467.38.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
* Rusty Russell (rusty@xxxxxxxxxxxxxxx) wrote:
> On Tue, 2006-07-18 at 00:00 -0700, Chris Wright wrote:
> > plain text document attachment (i386-entry.S)
> > - change cli/sti
> > - change test for user mode return to work for kernel mode in ring1
> > - check hypervisor saved event mask on return from exception
> > - add entry points for the hypervisor upcall handlers
> > - avoid math emulation check when running on Xen
> > - add nmi handler for running on Xen
> > 
> > Signed-off-by: Ian Pratt <ian.pratt@xxxxxxxxxxxxx>
> > Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
> > Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>
> > Signed-off-by: Chris Wright <chrisw@xxxxxxxxxxxx>
> > 
> > ---
> >  arch/i386/kernel/asm-offsets.c |   26 +++++++
> >  arch/i386/kernel/entry.S       |  141 
> > ++++++++++++++++++++++++++++++++++++-----
> >  arch/i386/mach-xen/setup-xen.c |   19 +++++
> >  drivers/xen/core/features.c    |    2
> >  4 files changed, 169 insertions(+), 19 deletions(-)
> > 
> > diff -r 5cca1805b8a7 arch/i386/kernel/entry.S
> > --- a/arch/i386/kernel/entry.S      Tue Jul 18 02:20:39 2006 -0400
> > +++ b/arch/i386/kernel/entry.S      Tue Jul 18 02:22:56 2006 -0400
> > @@ -76,8 +76,39 @@ NT_MASK          = 0x00004000
> >  NT_MASK            = 0x00004000
> >  VM_MASK            = 0x00020000
> >  
> > +#ifndef CONFIG_XEN
> > +#define DISABLE_INTERRUPTS cli
> > +#define ENABLE_INTERRUPTS  sti
> > +#else
> > +#include <xen/interface/xen.h>
> > +
> > +EVENT_MASK = 0x2E
> > +
> > +/* Offsets into shared_info_t. */
> > +#define evtchn_upcall_pending              /* 0 */
> > +#define evtchn_upcall_mask         1
> 
> Erk... Can we get these into asm-offsets?

Hmm, we put the vcpu shift in, guess we missed that.  Thanks for noticing.

> > +
> > +#ifdef CONFIG_SMP
> > +/* Set %esi to point to the appropriate vcpu structure */
> > +#define GET_VCPU_INFO              movl TI_cpu(%ebp),%esi                  
> > ; \
> > +                           shl  $SIZEOF_VCPU_INFO_SHIFT,%esi       ; \
> > +                           addl HYPERVISOR_shared_info,%esi
> > +#else
> > +#define GET_VCPU_INFO              movl HYPERVISOR_shared_info,%esi
> > +#endif
> > +
> > +/* The following end up using/clobbering %esi, because of GET_VCPU_INFO */
> > +#define __DISABLE_INTERRUPTS       movb $1,evtchn_upcall_mask(%esi)
> > +#define DISABLE_INTERRUPTS GET_VCPU_INFO                           ; \
> > +                           __DISABLE_INTERRUPTS
> > +#define ENABLE_INTERRUPTS  GET_VCPU_INFO                           ; \
> > +                           movb $0,evtchn_upcall_mask(%esi)
> > +#define __TEST_PENDING             testb $0xFF,evtchn_upcall_pending(%esi)
> > +#endif
> 
> Actually, is it possible to move these to a header somewhere?  In the
> paravirt_ops patches I used the names CLI and STI (copied from the VMI
> patches), but didn't allow them to clobber any regs.  They're defined in
> asm-i386/paravirt.h.

Sure, although it's only used here.  Got a preference?

> If we want to allow them to clobber %esi, then your names are probably
> better, but we should clobber %esi in the !CONFIG_XEN case too if
> CONFIG_DEBUG_KERNEL.

That makes sense to me, just to catch those bugs.

thanks,
-chris

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

<Prev in Thread] Current Thread [Next in Thread>