xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* accessing xen headers from dom0 kernel module
@ 2010-12-20 17:23 david
  2010-12-21 10:02 ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: david @ 2010-12-20 17:23 UTC (permalink / raw)
  To: xen-devel

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?

thanks for your hints,

david

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: accessing xen headers from dom0 kernel module
  2010-12-20 17:23 accessing xen headers from dom0 kernel module david
@ 2010-12-21 10:02 ` Ian Campbell
  2010-12-29 18:44   ` david
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2010-12-21 10:02 UTC (permalink / raw)
  To: david; +Cc: xen-devel@lists.xensource.com

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: accessing xen headers from dom0 kernel module
  2010-12-21 10:02 ` Ian Campbell
@ 2010-12-29 18:44   ` david
  2011-01-04 14:19     ` accessing hvm-domU memory from dom0 david
  0 siblings, 1 reply; 4+ messages in thread
From: david @ 2010-12-29 18:44 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel


On 12/21/2010 11:02 AM, Ian Campbell wrote:
> 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.
>
>

That's exactly what I wanted to know. Thanks for your fast response.

david

^ permalink raw reply	[flat|nested] 4+ messages in thread

* accessing hvm-domU memory from dom0
  2010-12-29 18:44   ` david
@ 2011-01-04 14:19     ` david
  0 siblings, 0 replies; 4+ messages in thread
From: david @ 2011-01-04 14:19 UTC (permalink / raw)
  To: xen-devel

hi,

I have an additional question: Is it possible to access the pseudo 
physical memory of a hvm-domU in dom0 "out of the box", to read/write 
from/into it? If not, what would be the "easiest" way to implement this 
possibility in dom0? Implement a new hypercall which offers this access?
I found intresting functions in the public xen-headers (linux 2.6.32.26) 
like HYPERVISOR_memory_op in include/asm/xen/hypercall.h and the 
structures xen_memory_exchange or xen_memory_map in memory.h. I'm 
currently trying to figure out if this is the functionality I'm looking 
for. Have you any hints for me?

thanks,

best regards,
david

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-04 14:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-20 17:23 accessing xen headers from dom0 kernel module david
2010-12-21 10:02 ` Ian Campbell
2010-12-29 18:44   ` david
2011-01-04 14:19     ` accessing hvm-domU memory from dom0 david

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).