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

[Xen-devel] Native hypercall basics using int 82


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "hnrkssn hnrkssn" <hnrkssn@xxxxxxxxx>
  • Date: Tue, 16 Dec 2008 09:39:09 +0100
  • Delivery-date: Tue, 16 Dec 2008 00:39:37 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=eKEJfwkHyHZz7y6dVJicddbrxIZrt5o/aN6Iq/je/hdWLgr1sQyXwHGTVgN2OpHxRK fcUF6vOQdR+zH4jUZOMyxSK2txgrYpQ/tN+uyEPzQ6WIq9TiBFaZUYmgoC9udmZ4GZuE gDtAA6A/cd5q5pM8vWinlKFXVSeo0UBcNBObA=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi,

I'm trying to detect if I'm running as a guest in XEN hypervisor using a simple hypercall like __HYPERVISOR_xen_version with the XENVER_extraversion option.
I cannot use any of the API functions for this so I'm trying to setup the required registers and call int 82 myself.
This is what I do and unfortunately, it generates an exception 0xd when executing INT 82.

Reading the source, I think I've figured out that I should put my arguments in a hypercall struct shown below. I might be wrong then.

Thanks in advance
David

---
char buffer[256];
HYPERCALL hypercall;
PHYPERCALL phypercall = &hypercall;

hypercall.op     = 17;                       // xen_version
hypercall.arg[0] = (unsigned long) 1; // xen_extra_version
hypercall.arg[1] = (unsigned long) Buffer;

memset(Buffer, 0, sizeof(Buffer));

_asm
  {
    PUSH EDI;
    PUSH ESI;
    PUSH EDX;
    PUSH ECX;
    PUSH EBX;
    PUSH EAX;
   
   
    MOV EAX, phypercall;
    INT 82;
   
    POP EAX;
    POP EBX;
    POP ECX
    POP EDX;
    POP ESI;
    POP EDI;
  }

  BufferA[255] = '\0';
 
  Cprintf("Buf: %s\r\n", Buffer);
_______________________________________________
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®.