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)
if (copy_to_guest(ptr, &tmp, 1) != 0)
}
But in this case copy_to_guest() does not return 0, so this fails as well. I call the hyper call from this Linux system call:
asmlinkage long sys_dummy(void)
{
uint64_t p = 0;
int rc = 0;
rc = HYPERVISOR_dummy(&p);
if (rc != 0)
printk("ERROR, hypercall returned: %d\n", rc);
return 0;
}
I am sure I am missing something super easy, but I canât see what.
Thank you for your help,
Emmanuel
|