[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] HVM hypercalls


  • To: Ruslan Nikolaev <nruslan_devel@xxxxxxxxx>
  • From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
  • Date: Thu, 29 Jul 2010 09:30:29 +0200
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 29 Jul 2010 00:31:25 -0700
  • Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=h4YZ7wW8aIDFPa0myZzgPnwPC6YnngXc6aZW1YbYw8T1mdesqoYHLATN 2c8qHx3nJZ0+3cYbAX0EKmBPA/qeS6M+Ymmluu12OeqO0uEuei8MzYOYu u7Gy/o+TmIXWtSCeJmK8jIxTK+Seks2lIfhhUwdFeoMASYb3pao+LsQV6 WwC6/LmC5PJWsBFJugbdKJhr8eBJWSORwd4d/TsKyvoYJKii3zSmLG0FU +lCUOvOeRb8nm4EJQ3C3iMirMjsBc;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

On 07/28/2010 09:22 PM, Ruslan Nikolaev wrote:
Hi

I need to use hypercalls from HVM domain (e.g. HYPERVISOR_add_to_physmap). 
However, it does not work when I am trying to invoke it from HVM Linux guest. 
Basically, I don't see that anything happens on hypervisor's side. I also 
grep'ed the guest code for 'vmmcall'/'vmcall' and did not find anything. Is it 
possible to do it at all? Is it possible to make hypercalls from HVM domains or 
are they simply used for tools responsible to load HVM domain? Also, are they 
allowed (if allowed at all) from stubdom, ioemu, or both configurations?

I am using latest Xen version (xen-4.0.1-rc). I also tried both official Linux 
distribution as an HVM domain and the version from Xen repositary. The computer 
has Nehalem processor with VMX.

This should work.
We are using hypercalls from HVM domains without any problem on xen 3.3 and
4.0, one of them being HYPERVISOR_add_to_physmap. There must be something
you are doing wrong.

The following steps are required:

- use the cpuid instruction to search for Xen signature. You should begin with
  index 0x40000000 and look for the text "XenVMMXenVMM" in the returned
  registers ebx, ecx and edx. Increment the index by 0x100 up to 0x40001000 if
  necessary.
- get the xen msr register number via cpuid with index 0x40000x002 (x from
  step 1). The msr register number will be in register ebx.
- write the physical address of a 4k page to the obtained msr register via
  wrmsr. This page will be used by the hypervisor to write the appropriate
  code for the hypercalls to.
- each entry in that page occupies 32 bytes. You can do a specific hypercall
  by calling the function at the specific entry with the hypercall number as
  index


Juergen

--
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@xxxxxxxxxxxxxx
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.