WARNING - OLD ARCHIVES

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

xen-devel

[Xen-devel] Native hypercall basics using int 82

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Native hypercall basics using int 82
From: "hnrkssn hnrkssn" <hnrkssn@xxxxxxxxx>
Date: Tue, 16 Dec 2008 09:39:09 +0100
Delivery-date: Tue, 16 Dec 2008 00:39:37 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=YLxC7HFeiLNmDf9445sovDDc4Q2GKojBFq80JGv93RY=; b=JJRim0AsqKl9A0Ses8HXpyOBn2E1MrTdn2lPAcGRz64xWoRfuv5IuwJXTEg85SHa0t V6XcSE+EUERLMVz+tLUdqWGUeGn2Bnalb+MnhhE4DX5gw91JyfHR5MrNoDh/ntcIj2/q P/zUFfYqwazhGDmgzteSFESrAvfKsaLILMQDE=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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