Hi, I have defined a new hypercall in Xen hypervisor. It is similar to do_domctl() in that I pass a single argument and use XEN_GUEST_HANDLE() to retrieve the arguments. Its currently working fine under Xen-4.3-unstable. Now I want to invoke this hypercall via Linux-3.7.5 Guest. How do I go about doing this. Thanks, Yathi
On 2/21/2013 1:37 AM, Yathindra wrote:> Hi, > > I have defined a new hypercall in Xen hypervisor. It is similar to > do_domctl() > in that I pass a single argument and use XEN_GUEST_HANDLE() to > retrieve the > arguments. Its currently working fine under Xen-4.3-unstable. > > Now I want to invoke this hypercall via Linux-3.7.5 Guest. How do I go > about > doing this. > > Thanks, > YathiHi, I followed a approach similar to do_physdev_op in Linux-3.7.5. I have a similar set of files under include/xen/interface/ directory. After plumbing everything when I execute my hypercall via Linux, I get -14 (EFAULT) as the return value. I added printk''s on the Xen side to see if the hypercall is reaching Xen but it does not. Any general direction regarding this would be very helpful. Thanks, Yathi
On Sat, 2013-02-23 at 04:20 +0000, Yathindra wrote:> On 2/21/2013 1:37 AM, Yathindra wrote: > > Hi, > > > > I have defined a new hypercall in Xen hypervisor. It is similar to > > do_domctl() > > in that I pass a single argument and use XEN_GUEST_HANDLE() to > > retrieve the > > arguments. Its currently working fine under Xen-4.3-unstable. > > > > Now I want to invoke this hypercall via Linux-3.7.5 Guest. How do I go > > about > > doing this. > > > > Thanks, > > Yathi > Hi, > > I followed a approach similar to do_physdev_op in Linux-3.7.5. > I have a similar set of files under include/xen/interface/ directory. > After plumbing everything when I execute my hypercall via Linux, > I get -14 (EFAULT) as the return value. I added printk''s on the Xen > side to see if the hypercall is reaching Xen but it does not. > > Any general direction regarding this would be very helpful.EFAULT usually means that one of the pointers which you passed to the hypercall was not to correctly mapped memory. It might be useful to post your code for both sides of the equation (Linux & Xen). Ian.
On 2/25/2013 2:23 AM, Ian Campbell wrote:> On Sat, 2013-02-23 at 04:20 +0000, Yathindra wrote: >> On 2/21/2013 1:37 AM, Yathindra wrote: >>> Hi, >>> >>> I have defined a new hypercall in Xen hypervisor. It is similar to >>> do_domctl() >>> in that I pass a single argument and use XEN_GUEST_HANDLE() to >>> retrieve the >>> arguments. Its currently working fine under Xen-4.3-unstable. >>> >>> Now I want to invoke this hypercall via Linux-3.7.5 Guest. How do I go >>> about >>> doing this. >>> >>> Thanks, >>> Yathi >> Hi, >> >> I followed a approach similar to do_physdev_op in Linux-3.7.5. >> I have a similar set of files under include/xen/interface/ directory. >> After plumbing everything when I execute my hypercall via Linux, >> I get -14 (EFAULT) as the return value. I added printk''s on the Xen >> side to see if the hypercall is reaching Xen but it does not. >> >> Any general direction regarding this would be very helpful. > EFAULT usually means that one of the pointers which you passed to the > hypercall was not to correctly mapped memory. > > It might be useful to post your code for both sides of the equation > (Linux & Xen). > > Ian.I was passing incorrect arguments and hence the copy_from_guest() failed with -EFAULT. Sorry about spamming, it was a silly mistake. Thanks for the reply Ian. - Yathi