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] Using SYSCALL/SYSRET with a minios kernel

To: Goswin von Brederlow <goswin-v-b@xxxxxx>
Subject: Re: [Xen-devel] Using SYSCALL/SYSRET with a minios kernel
From: Daniel Stodden <stodden@xxxxxxxxxx>
Date: Mon, 25 Feb 2008 01:01:54 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 24 Feb 2008 16:02:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <87k5kuym6k.fsf@xxxxxx>
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>
Organization: Fakultät für Informatik I10, Technische Universität München
References: <87k5kuym6k.fsf@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi.

On Mon, 2008-02-25 at 00:22 +0100, Goswin von Brederlow wrote: 
> Hi,
> 
> I'm trying to use the SYSCALL/SYSRET opcodes with a minios kernel
> without much success.
> 
> Going by the manuals (and linux sources) I first have to setup the
> STAR and LSTAR registers to define the segment and instruction pointer
> to be used for SYSCALL:
> 
>       /* 
>          * LSTAR and STAR live in a bit strange symbiosis.
>          * They both write to the same internal register. STAR allows to set
>          * CS/DS but only a 32bit target. LSTAR sets the 64bit rip.
>          */ 
>         wrmsrl(MSR_STAR,  ((uint64_t)__USER_CS)<<48  | 
> ((uint64_t)__KERNEL_CS)<<32); 
>         wrmsrl(MSR_LSTAR, system_call); 
> 
> 
> But all that does is give a message on the xen console:
> 
> (XEN) traps.c:1467:d137 Domain attempted WRMSR 00000000c0000081 from 
> e023e010:00000000 to e033e033:00000000.
> (XEN) traps.c:1467:d137 Domain attempted WRMSR 00000000c0000082 from 
> ffff8300:001e0800 to 00000000:001054c0.

The PV interface simply does not support STAR/LSTAR. It's that
simple. :) I suppose you want to implement system calls? Check the
HYPERVISOR_set_callbacks() call. The syscall_address parameter presently
remains entirely unused in mini-os. But as far as I could tell
immediately from the source, syscall/sysret appears to be supported by
the general callback mechanism the same way sysenter/sysleave presently
is.

regards,
daniel


-- 
Daniel Stodden
LRR     -      Lehrstuhl für Rechnertechnik und Rechnerorganisation
Institut für Informatik der TU München             D-85748 Garching
http://www.lrr.in.tum.de/~stodden         mailto:stodden@xxxxxxxxxx
PGP Fingerprint: F5A4 1575 4C56 E26A 0B33  3D80 457E 82AE B0D8 735B



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