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] Is it possible to make hypercall from user application d

To: weiming <zephyr.zhao@xxxxxxxxx>
Subject: Re: [Xen-devel] Is it possible to make hypercall from user application directly?
From: Daniel Stodden <stodden@xxxxxxxxxx>
Date: Wed, 12 Mar 2008 10:16:57 +0100
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 13 Mar 2008 04:18:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <add59a3f0803111942w5f29bfe3v3a2ad0744a061523@xxxxxxxxxxxxxx>
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: <add59a3f0803111013n754c2e86v24eefd6b9042acc3@xxxxxxxxxxxxxx> <1205265056.6230.6.camel@xxxxxxxxxxxxxxxxxxxx> <add59a3f0803111942w5f29bfe3v3a2ad0744a061523@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2008-03-11 at 21:42 -0500, weiming wrote:
> After some study, I got the following understanding. Please correct me
> if I'm wrong; otherwise, you can just say "correct".
> 
> 1. In x86_64 mode, xen sets the LSTAR (the EIP of syscall target), and
> this value keeps constant. This value is code of "syscall_enter"
> defined in xen/arch/x86/x86_64/entry.S

correct.

> 2. 
> In ENTRY(syscall_enter)
> ...
> ...
> testb $TF_kernel_mode, VCPU_thread_flag(%rbx)
> jz switch_to_kernel
> 
> /*hypercall*/
> ...
> 
> so whenever a syscall is issued, "syscall_enter" checks the context.
> If it decides that the context is "kernel mode", it will treat the
> syscall as a  plain "system call" from user applications. So it goes
> to "jz switch_to_kernel". Otherwise, it will think it's a hypercall
> issued from guest domains.

correct. PT switching is then done in
create_bounce_frame/toggle_guest_mode. 

> 3. So an application can't make "hypercalls" directly because it's
> context is "kernel mode", so it will always be treated as a system
> call to the guest OS.

believe you mean "user mode", but otherwise correct.

best,
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

<Prev in Thread] Current Thread [Next in Thread>