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

Re: [Xen-devel] Declaring new Xen Hypercall

To: "Nimgaonkar, Satyajeet" <SatyajeetNimgaonkar@xxxxxxxxxx>, Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Declaring new Xen Hypercall
From: Keir Fraser <keir@xxxxxxx>
Date: Tue, 28 Sep 2010 21:40:18 +0100
Cc:
Delivery-date: Tue, 28 Sep 2010 13:41:03 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:user-agent:date :subject:from:to:message-id:thread-topic:thread-index:in-reply-to :mime-version:content-type:content-transfer-encoding; bh=lATwYVqcDwSoOSVKp5rBChgybaNUj2kajRzn26ZgEUE=; b=wu+z9OKduFMKuqeEkepb3Ed8taP/YhqYrITwIPujAxMMPS37XsrpZeely5EIWTjI/3 iM8q+mZFVDMQTgseMQ8BFweq3rKQJbzImRP6WR81lJfln3syk0rjF9O0GkkeShGV6awn DKT7nR2zB9dOHzcrLzM9eDZQSznIHTcSE2Eac=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=c6hL+hKCJ/WMvg31mJaOuy5M6P9xXolDA6+EaGb8jA/nHUwIztKRwNFtkh1KA4bgGm Ewk1GH7qpub3nF3uBrhv0pbEcHo4bXoHk5WoVRW1E4vPQ+jgD8vx9uNV6qCk68cjiFq+ OlIjGEQp8N+yN0+IrUxdgxssdR6AWGqO4v7MQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <12871952FC0E29439F861FA745BCDD8503EB03E3@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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
Thread-index: AQHLX0vrm7GY4Tvtc0CkFxQmh/4kGpMn2ozngAABlRc=
Thread-topic: [Xen-devel] Declaring new Xen Hypercall
User-agent: Microsoft-Entourage/12.26.0.100708
Open /proc/xen/privcmd and perform ioctl(IOCTL_PRIVCMD_HYPERCALL) on the
file handle you get back. See many examples in tools/libxc.

 -- Keir

On 28/09/2010 21:34, "Nimgaonkar, Satyajeet"
<SatyajeetNimgaonkar@xxxxxxxxxx> wrote:

> Hi Dan,
>             So is there an alternate route to call a hypercall from userspace
> programs. Can you please advice?
> 
> ________________________________________
> From: Dan Magenheimer [dan.magenheimer@xxxxxxxxxx]
> Sent: Tuesday, September 28, 2010 2:29 PM
> To: Nimgaonkar, Satyajeet; xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: RE: [Xen-devel] Declaring new Xen Hypercall
> 
> If I recall correctly, the assembly language code in Xen
> that is executed first when a hypercall enters into Xen
> checks if the hypercall is done from userpace and disallows
> the call (returning -1) if it is.
> 
>> -----Original Message-----
>> From: Nimgaonkar, Satyajeet [mailto:SatyajeetNimgaonkar@xxxxxxxxxx]
>> Sent: Tuesday, September 28, 2010 2:07 PM
>> To: xen-devel@xxxxxxxxxxxxxxxxxxx
>> Subject: [Xen-devel] Declaring new Xen Hypercall
>> 
>> Hi All,
>>          I am currently working on declaring a new hypercall in Xen.
>> For this i have declared my hypercall in xen.h -
>> #define __HYPERVISOR_jeet1                56
>> 
>> Then I modified the xcom_privcmd.c to accomodate my hypercall -
>>         case __HYPERVISOR_jeet1:
>>                 printk("Successfull Hypercall made to
>> __HYPERVISOR_jeet1");
>> 
>> And then I am calling this Hypercall through an user level program-
>> 
>> #include </home/satyajeet/Important_Softwares/xen-
>> 3.4.3/tools/libxc/xc_private.h>
>> #include <xenctrl.h>
>> #include <stdio.h>
>> 
>> int main(){
>> 
>>        printf("Attempt to invoke the hypercall: __HYPERVISOR_jeet1\n");
>>        int handle, rc;
>> 
>>          /* Acquire Hypervisor Interface Handle.
>>             This handle goes as the first argument for the function
>> do_xen_hypercall()
>>          */
>> 
>>        handle = xc_interface_open();
>>        printf ("Acquired handle to Xen Hypervisor:%d\n",handle);
>> 
>>        /* Hypercall definitions */
>> 
>>        DECLARE_HYPERCALL;
>>        hypercall.op     = __HYPERVISOR_jeet1;
>>        rc = do_xen_hypercall(handle, &hypercall);
>>        printf ("Hypercall Details: %d\n", rc);
>> 
>>        xc_interface_close(handle);
>> 
>>        return 0;
>> 
>> }
>> 
>> The program compiles properly but gives me -1 error for rc. Can anyone
>> please tell me what I am doing wrong here. Also please tell me where
>> should I view the output of printk in xen.
>> 
>> Thanks in advance.
>> 
>> Regards,
>> Satyajeet Nimgaonkar
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-devel
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

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