Skip to contentSkip to conversation

Explicit return type for Hypercall

DISCUSSION Tej 2 participants 4 messages Apr 9, 2009

lore
Share & tools
lore

Tej

author
#0 lore raw

Hi All

Some basic doubts about Hypercall return type.
If kernel issue a hypercall, and there is no corresponding entry in entry.S in Hypervisor, it gives weired return type and Kernel interpret it in completely different manner.

eg in GCOV case, I issued hypercall, when there is no corresponding entry in Hypervisor, it gives -38<3> as return type. and Kernel Send a message to userspace (in case of kernel module) as Kernel does not have module support, which is total misleading.

1. Is this return type is intended?
2. Why there is no interpretation of hypercall return type in kernel?

Hope i am not missing any obvious thing

thanks
-tej

#1 lore raw
Quoted 4 lines · Tej

eg in GCOV case, I issued hypercall, when there is no corresponding entry in Hypervisor, it gives -38<3> as return type. and Kernel Send a message to userspace (in case of kernel module) as Kernel does not have module support, which is total misleading.

The return code is ENOSYS, which is appropriate for an unimplemented hypercall.

-- Keir

author
#2 lore raw
Quoted 9 lines · Keir Fraser
Quoted 4 lines · Tej

eg in GCOV case, I issued hypercall, when there is no corresponding entry in Hypervisor, it gives -38<3> as return type. and Kernel Send a message to userspace (in case of kernel module) as Kernel does not have module support, which is total misleading.

The return code is ENOSYS, which is appropriate for an unimplemented hypercall.

Still it could be misleading, because in case of kernel modules "module-uti"l packages overrides ENOSYS with message as "Kernel does not have module support"

an explicit return type could be useful here.

Quoted 5 lines

 -- Keir

#3 lore raw
Quoted 8 lines · Tej
Quoted 2 lines

The return code is ENOSYS, which is appropriate for an unimplemented hypercall.

Still it could be misleading, because in case of kernel modules "module-uti"l packages overrides ENOSYS with message as "Kernel does not have module support"

an explicit return type could be useful here.

Separate from the kernel's return code you mean? Yes, you could certainly define a new ioctl that returns the code in the command structure passed to the ioctl, for example. I'd have no problem with that.

-- Keir