From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: Passing pointers to hypercalls Date: Sun, 9 Nov 2014 19:27:18 +0000 Message-ID: <545FC016.7060509@citrix.com> References: <0D65FE40-5E54-4369-BE06-79EFAF9E3607@gatech.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1126458322294664615==" Return-path: In-Reply-To: <0D65FE40-5E54-4369-BE06-79EFAF9E3607@gatech.edu> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Amaro, Emmanuel" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============1126458322294664615== Content-Type: multipart/alternative; boundary="------------030803050909020807040606" --------------030803050909020807040606 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 09/11/14 19:16, Amaro, Emmanuel wrote: > Hello, > > I am trying to pass a pointer to an hyper call in the simplest > possible way, set it's value, an return it to the guest. > > I have tried 2 different ways: > - Directly with simple pointers (I read somewhere this would work on > x86), but the pointer address is set to 0x0000deadbeef, so > dereferencing it causes a panic. > - With XEN_GUEST_HANDLE: > > long do_dummy(XEN_GUEST_HANDLE(uint64_t) ptr) > > { > It looks like you have introduced a new hypercall called dummy. I presume from this code that you have filled in a new handler in the hypercall_table, but have you set the expected number of args in the hypercall_args_table? The default number of args is 0, which cases a debug Xen to deliberately clobber all the registers to 0xdeadbeef ~Andrew --------------030803050909020807040606 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
On 09/11/14 19:16, Amaro, Emmanuel wrote:
Hello,

I am trying to pass a pointer to an hyper call in the simplest possible way, set it’s value, an return it to the guest.

I have tried 2 different ways:
- Directly with simple pointers (I read somewhere this would work on x86), but the pointer address is set to 0x0000deadbeef, so dereferencing it causes a panic.
- With XEN_GUEST_HANDLE:
long do_dummy(XEN_GUEST_HANDLE(uint64_t) ptr)
{

It looks like you have introduced a new hypercall called dummy.

I presume from this code that you have filled in a new handler in the hypercall_table, but have you set the expected number of args in the hypercall_args_table?

The default number of args is 0, which cases a debug Xen to deliberately clobber all the registers to 0xdeadbeef

~Andrew
--------------030803050909020807040606-- --===============1126458322294664615== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============1126458322294664615==--