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] accessing xen headers from dom0 kernel module

To: david <david_n@xxxxxx>
Subject: Re: [Xen-devel] accessing xen headers from dom0 kernel module
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Tue, 21 Dec 2010 10:02:18 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 21 Dec 2010 02:04:06 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D0F9100.8020003@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/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: <4D0F9100.8020003@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, 2010-12-20 at 17:23 +0000, david wrote:
> hi there,
> 
> I'm not very familiar with programming kernel modules, so I have a short 
> question about it.
> Is it possible to use functions defined the in xen/include/ header files 
> of the xen hypervisor in a dom0 kernel-module?
> I think my dom0 kernel does not export the required symbols to use this 
> functions, so it will not work, right?

The interfaces defined in xen/include are internal to the hypervisor and
are not available to guests. In particular a guest can never call a
hypervisor symbol directly as you seem to be asking.

The exception to this is xen/include/public which contains the guest
(including dom0) hypercall interface (and some other shared-memory data
structures). A hypercall is a trap somewhat analogous to a system call
except it is from guest->hypervisor rather than userspace->kernel. They
are invoked by calling into an offset within the hypercall page (a
special page populated with the correct trap instruction for the
architecture).

Most (all?) guests do not build directly against the headers in the Xen
source tree but instead import a copy into their own source, adjusting
for local coding style etc. In Linux these interface headers are in
include/xen/interface. Linux also defines it's own higher level
interfaces to hypercalls (convenience functions and the like), these are
generally in include/xen or arch/x86/include/asm/xen.

Ian.


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

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