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/
Home Products Support Community News


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: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Wed, 27 Oct 2010 17:24:51 +0100
Cc: Patrick Colp <pjcolp@xxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 27 Oct 2010 09:25:25 -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>
Organization: Citrix Systems, Inc.
References: <AANLkTik-ZoCnvJOKS=RTSj2Y3TrKpm226v-LXOs-CDWO@xxxxxxxxxxxxxx> <19656.20566.195007.346709@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2010-10-27 at 17:16 +0100, 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 ?  But I guess your patch is good in the meantime.

Red-zoning is really only intended to apply for userspace, and the
kernel must take pains to make it so, for example when injecting signals

A kernel (or anything which runs only in ring 0) generally cannot use
red-zoning on itself because there is no stack switch when taking an
exception/interrupt/etc from ring 0 and so the hardware has already
trashed the red-zone before the software would get to do any
fixup/obeying etc.

Xen compiles itself with -mno-red-zone for exactly this reason.


Xen-devel mailing list