xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: Ruslan Nikolaev <nruslan_devel@yahoo.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: HVM hypercalls
Date: Thu, 29 Jul 2010 09:30:29 +0200	[thread overview]
Message-ID: <4C512E15.60909@ts.fujitsu.com> (raw)
In-Reply-To: <706335.39543.qm@web113616.mail.gq1.yahoo.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@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

  parent reply	other threads:[~2010-07-29  7:30 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 19:22 HVM hypercalls Ruslan Nikolaev
2010-07-29  1:05 ` Dan Magenheimer
2010-07-29  7:30 ` Juergen Gross [this message]
2010-07-29 18:55   ` Ruslan Nikolaev
2010-07-29 19:47     ` Jeremy Fitzhardinge
2010-07-30 16:06       ` Ruslan Nikolaev
2010-07-31  0:07         ` Jeremy Fitzhardinge
2010-08-03 19:48           ` Ruslan Nikolaev
2010-08-03 21:40             ` Jeremy Fitzhardinge
2010-08-04 17:41               ` Ruslan Nikolaev
2010-08-05  7:25                 ` Christoph Egger
2010-08-05 10:31                 ` Stefano Stabellini
2011-05-23  7:48   ` veeruyours
2011-05-23  8:22     ` Ian Campbell
2011-05-23 13:52       ` veerasena reddy
2011-05-24 12:06         ` Ian Campbell
2011-05-24 13:58           ` veeruyours
2011-05-24 14:09             ` Ian Campbell
2011-05-25  7:38               ` veeruyours
2011-05-25  8:13                 ` Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2010-08-06 21:58 Ruslan Nikolaev
2010-08-09  9:41 ` Stefano Stabellini
2010-08-03 20:30 Ruslan Nikolaev
2010-08-02  0:32 Ruslan Nikolaev
2008-08-19 14:38 HVM Hypercalls Kumar, Venkat
2008-08-19 14:53 ` Keir Fraser
2008-08-20 11:48   ` Kumar, Venkat
2008-08-20 12:11     ` Keir Fraser
2006-12-15 18:46 HVM hypercalls Ky Srinivasan
2006-12-15 19:54 ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C512E15.60909@ts.fujitsu.com \
    --to=juergen.gross@ts.fujitsu.com \
    --cc=nruslan_devel@yahoo.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).