[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] OCaml-TLS directly on Xen

On 18 Nov 2014, at 11:18, Thomas Leonard <talex5@xxxxxxxxx> wrote:
> One important factor when choosing between these options is whether
> it's even safe to share OCaml code between Unix and Xen/Mini-OS (as we
> do currently).
> The AMD64 ABI [1] says "The 128-byte area beyond the location pointed
> to by %rsp is considered to be reserved and shall not be modified by
> signal or interrupt handlers. Therefore, functions may use this area
> for temporary data that is not needed across function calls.".
> This suggests to me that ocamlopt is free to use this area (the "red
> zone") in the code it generates. However, the red zone is not
> available in Mini-OS (apparently the CPU assumes it can use this area
> when handling interrupts, so it can't be used in kernel code, which is
> all code in a unikernel). If so, our current approach only works
> because (hopefully) ocamlopt doesn't yet take advantage of this, and
> we should really recompile everything for Xen, in a separate OPAM
> switch.

That's a very good point to keep in mind.  I read through the asmcomp
directory of the sources when I did the first MiniOS port and couldn't
find any use of the redzone.  For now, it's probably sufficient to
keep an eye on future revisions of the compiler as patches go in and
make sure that the amd64 backend doesn't start to make use of it.


MirageOS-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.