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] [PATCH] caml-stubdom: fix "red zone" bug

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] caml-stubdom: fix "red zone" bug
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Wed, 27 Oct 2010 17:34:45 +0100
Cc: Patrick Colp <pjcolp@xxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 27 Oct 2010 09:35:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19656.20566.195007.346709@xxxxxxxxxxxxxxxxxxxxxxxx>
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: <AANLkTik-ZoCnvJOKS=RTSj2Y3TrKpm226v-LXOs-CDWO@xxxxxxxxxxxxxx> <19656.20566.195007.346709@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
At 17:16 +0100 on 27 Oct (1288199782), Ian Jackson wrote:
> Patrick Colp writes ("[Xen-devel] [PATCH] caml-stubdom: fix "red zone" bug"):
> > According to the AMD64 ABI, the 128-byte area below %rsp is reserved
> > for scratch space and should not be used by signal, interrupt, or
> > exception handlers. However, Mini-OS does not adhere to this
> > interface. 
> 
> How unpleasant.
> 
> > This patch fixes this issue by passing the -mno-red-zone flag to the
> > ocaml configure script in the stubdom Makefile.
> 
> Perhaps it would be better to make Mini-OS adhere to the specified
> interface?

Hmm.  We would need to have more heavyweight kernel/user separation to
make sure that interrupt delivery &c always happens on safe stacks.  At
the moment, all of Mini-OS runs in kernel mode, on one stack.  It might
be possible to use a different stack change for interrupts and
exceptions only without having a full user/kernel split though, as long
as all the interrupt handlers are compiled with -mno-red-zone...

It's really just part of the confusion of running "application" code in
what's realy a kernel.  The Linux kernel and Xen are both compiled with
-mno-red-zone, to avoid this kind of issue.

Cheers,

Tim.

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

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