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/
Home Products Support Community News


Re: [Xen-devel] HVM hypercalls

To: Ruslan Nikolaev <nruslan_devel@xxxxxxxxx>
Subject: Re: [Xen-devel] HVM hypercalls
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
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=juergen.gross@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1280388627; x=1311924627; h=message-id:date:from:mime-version:to:cc:subject: references:in-reply-to:content-transfer-encoding; z=Message-ID:=20<4C512E15.60909@xxxxxxxxxxxxxx>|Date:=20Th u,=2029=20Jul=202010=2009:30:29=20+0200|From:=20Juergen =20Gross=20<juergen.gross@xxxxxxxxxxxxxx>|MIME-Version: =201.0|To:=20Ruslan=20Nikolaev=20<nruslan_devel@xxxxxxxxx >|CC:=20xen-devel@xxxxxxxxxxxxxxxxxxx|Subject:=20Re:=20[X en-devel]=20HVM=20hypercalls|References:=20<706335.39543. qm@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>|In-Reply-To:=20<706335.3 9543.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> |Content-Transfer-Encoding:=207bit; bh=MCQCshkVoorjnhoYYX34+NjYgOlAcXAIX4bJlUb5o8Q=; b=Ry51ZR4lr3T55PlvC+WUHM3aBFJaOb5ZuKG0ttCqp1YUpGASkj08lcUi Y3qciSk1zk0jA0/wi31H+eWtNIecneuXgvdQulYqTROYADEWqI5h7S3lv TT60aWzCbn6l0LRDo1a4ci92xTYxLdN60OMLEcgMNWuena9KN8lBjdeLo UP+LSO9GwvRfZNZS3lmfsn14n4hEm6ib4WySsP6KdSdhRoj04zlZdHqZh X2PUtjD7c0f3qQ8RftpMQh0/0cChZ;
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;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <706335.39543.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: Fujitsu Technology Solutions
References: <706335.39543.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100620 Iceowl/1.0b1 Icedove/3.0.5
On 07/28/2010 09:22 PM, Ruslan Nikolaev wrote:

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
- 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


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

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