Skip to contentSkip to conversation

[Fwd: Re: Hypercall from HVM guest]

Fwd: Re: Hypercall from HVM guest Steve Ofsthun 2 participants 2 messages Sep 25, 2008 – Sep 26, 2008

lore
Share & tools
lore
#0 lore raw

Forgot to cc the list ...

-------- Original Message --------
Subject: Re: [Xen-devel] Hypercall from HVM guest
Date: Thu, 25 Sep 2008 17:37:22 -0400
From: Steve Ofsthun <[email protected]>
To: Emre Can Sezer <[email protected]>
References: <[email protected]> <[email protected]> <[email protected]>

Quoted 20 lines · Emre Can Sezer
Quoted 20 lines
Quoted 7 lines · Emre Can Sezer

Hi,

I'm trying to communicate some information from an HVM guest to Xen. Passing a pointer to a buffer would suffice and the communication will be
single sided. What is the best way to do this?

Quoted 5 lines

I've looked into making a hypercall from an HVM guest and came across this
post on this mailing list by Steve Ofsthun:

http://lists.xensource.com/archives/html/xen-devel/2006-04/msg00526.html

This code is quite old and much has changed since then. You should probably use the pv on hvm driver code as an example these days (xen/unmodified_drivers/linux-2.6/platform-pci).

What hypercalls are you trying to use? Note that HVM guests are restricted to a subset of the normal PV guest hypercalls.

Quoted 7 lines
Quoted 2 lines

Steve

I'm trying to pass some information about the guest kernel to the VMM and thought that passing a single pointer to a buffer would suffice. I plan on introducing a new hypercall for my purposes and update vmx.c in Xen. If there is a better way of doing it please let me know.

You could probably just add an HVM_PARAM_ for use by get/set_hvm_param interfaces (see for example, set_callback_via() in platform-pci.c). You could avoid adding a brand new hypercall and making it available to HVM guests. This would be handled in the generic HVM code do_hvm_op() in xen/xen/arch/x86/hvm/hvm.c (not the intel specific vmx.c).

Quoted 11 lines

I put together some code, mainly from platform-pci.c and your previous posts and I was able to capture the hypercall from Xen. I've attached the code below. My problem was the xen related header files in the new linux distributions from kernel.org. So instead of including them, I copied the relevant information to the source. I've attached the code below.

I wonder if this is a bug or if 64-bit systems aren't supported or if they don't support xen anymore. The __HYPERCALL_ definitions for example are lacking what you have in xen.h in linux-2.6.18-xen. Although they've come up with 2.6.26-5, the changelogs don't mention anything about xen header files.

The initial Xen support pushed upstream did only support 32-bit. I'm not sure, off the top of my head, what version incorporates the 64-bit stuff. You might want to check the last Xen summit presentations.

Quoted 2 lines

It would be great if there was a skeleton code that people could use. Perhaps someone would like to take this code and pretty it up? :)

Perhaps ...

Steve

Quoted 44 lines

Cheers,

John

Quoted 39 lines
Quoted 38 lines

However, I'm unable to get this code to work. I'm running a 64-bit system
with the linux-2.6.26 kernel downloaded from kernel.org on top of xen-3.2.2. When I compile, I get compilation errors resulting from hypercall.h. I believe this code is intended for 32 bit guests only as the structure definitions are different fot the pte_t type.

The error was:
In file included from include/asm/xen/hypervisor.h:53,
from /home/ecsezer/kernels/vmcall/./features.c:11:
include/asm/xen/hypercall.h: In function 'HYPERVISOR_update_va_mapping':
include/asm/xen/hypercall.h:230: error: 'pte_t' has no member named 'pte_low'

I tried to modify this code to get rid of compilation errors but a final warning still persists and loading the module causes a seg fault. The warning I get is:
CC [M] /home/ecsezer/kernels/hyper/./hypercall.o
{standard input}: Assembler messages:
{standard input}:149: Warning: indirect call without `*'

So I tried to compile with mercurial repository version linux-2.6.18-xen and that compiles fine. However, due to being a different version, I can't use the resulting module.

I would appreciate any insight as to how to proceed. What could be the problem? Perhaps there is an easier way of passing the information I want
without a full blown hypercall interface?

Thanks,

John

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 42 lines

Forgot to cc the list ...

-------- Original Message --------
Subject: Re: [Xen-devel] Hypercall from HVM guest
Date: Thu, 25 Sep 2008 17:37:22 -0400
From: Steve Ofsthun <[email protected]>
To: Emre Can Sezer <[email protected]>
References: <[email protected]> <[email protected]> <[email protected]>

Quoted 23 lines · Emre Can Sezer
Quoted 13 lines
Quoted 7 lines · Emre Can Sezer

Hi,

I'm trying to communicate some information from an HVM guest to Xen. Passing a pointer to a buffer would suffice and the communication will be
single sided. What is the best way to do this?

Quoted 5 lines

I've looked into making a hypercall from an HVM guest and came across this
post on this mailing list by Steve Ofsthun:

http://lists.xensource.com/archives/html/xen-devel/2006-04/msg00526.html

Quoted 9 lines

This code is quite old and much has changed since then. You should probably use the pv on hvm driver code as an example these days (xen/unmodified_drivers/linux-2.6/platform-pci).

What hypercalls are you trying to use? Note that HVM guests are restricted to a subset of the normal PV guest hypercalls.

Steve

Quoted 6 lines

I'm trying to pass some information about the guest kernel to the VMM and
thought that passing a single pointer to a buffer would suffice. I plan on introducing a new hypercall for my purposes and update vmx.c in Xen. If
there is a better way of doing it please let me know.

Quoted 5 lines

You could probably just add an HVM_PARAM_ for use by get/set_hvm_param interfaces (see for example, set_callback_via() in platform-pci.c). You could avoid adding a brand new hypercall and making it available to HVM guests. This would be handled in the generic HVM code do_hvm_op() in xen/xen/arch/x86/hvm/hvm.c (not the intel specific vmx.c).

That sounds very promising, I'll look into that. Thanks for your help.

John

Quoted 85 lines
Quoted 10 lines

I put together some code, mainly from platform-pci.c and your previous posts and I was able to capture the hypercall from Xen. I've attached the
code below. My problem was the xen related header files in the new linux
distributions from kernel.org. So instead of including them, I copied the
relevant information to the source. I've attached the code below.

Quoted 7 lines

I wonder if this is a bug or if 64-bit systems aren't supported or if they
don't support xen anymore. The __HYPERCALL_ definitions for example are lacking what you have in xen.h in linux-2.6.18-xen. Although they've come
up with 2.6.26-5, the changelogs don't mention anything about xen header files.

The initial Xen support pushed upstream did only support 32-bit. I'm not sure, off the top of my head, what version incorporates the 64-bit stuff. You might want to check the last Xen summit presentations.

Quoted 2 lines

It would be great if there was a skeleton code that people could use. Perhaps someone would like to take this code and pretty it up? :)

Perhaps ...

Steve

Quoted 49 lines

Cheers,

John

Quoted 44 lines
Quoted 43 lines

However, I'm unable to get this code to work. I'm running a 64-bit system
with the linux-2.6.26 kernel downloaded from kernel.org on top of xen-3.2.2. When I compile, I get compilation errors resulting from hypercall.h. I believe this code is intended for 32 bit guests only as
the structure definitions are different fot the pte_t type.

The error was:
In file included from include/asm/xen/hypervisor.h:53,
from /home/ecsezer/kernels/vmcall/./features.c:11:
include/asm/xen/hypercall.h: In function 'HYPERVISOR_update_va_mapping':
include/asm/xen/hypercall.h:230: error: 'pte_t' has no member named 'pte_low'

I tried to modify this code to get rid of compilation errors but a final
warning still persists and loading the module causes a seg fault. The warning I get is:
CC [M] /home/ecsezer/kernels/hyper/./hypercall.o
{standard input}: Assembler messages:
{standard input}:149: Warning: indirect call without `*'

So I tried to compile with mercurial repository version linux-2.6.18-xen
and that compiles fine. However, due to being a different version, I can't use the resulting module.

I would appreciate any insight as to how to proceed. What could be the
problem? Perhaps there is an easier way of passing the information I want
without a full blown hypercall interface?

Thanks,

John

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel