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

To: Daniel Stodden <stodden@xxxxxxxxxx>
Subject: Re: [Xen-devel] Using SYSCALL/SYSRET with a minios kernel
From: Goswin von Brederlow <goswin-v-b@xxxxxx>
Date: Mon, 25 Feb 2008 02:55:09 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Goswin von Brederlow <goswin-v-b@xxxxxx>
Delivery-date: Sun, 24 Feb 2008 17:55:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1203897714.9103.6.camel@xxxxxxxxxxxxxxxxxxxx> (Daniel Stodden's message of "Mon, 25 Feb 2008 01:01:54 +0100")
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: <87k5kuym6k.fsf@xxxxxx> <1203897714.9103.6.camel@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)
Daniel Stodden <stodden@xxxxxxxxxx> writes:

> 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.
> 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

Ok, here is what I did for the callbacks:

--- x86_64.S ---
        int $80
        zeroentry do_syscall

--- kernel.c ---
  HYPERVISOR_set_callbacks((unsigned long)hypervisor_callback,
                           (unsigned long)failsafe_callback,
                           (unsigned long)syscall_callback);

  __asm__ __volatile__("syscall");

If I understood you right that should set the RIP to syscall_callback
and execute from there. But still, the syscall opcode does nothing.
In case you wonder. The "int $80" is there to crash the domain and
tell me it reached that point.


Xen-devel mailing list