[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] docs: Document some more hypercalls



Ian Campbell writes ("Re: [Xen-devel] [PATCH] docs: Document some more 
hypercalls"):
> On Mon, 2012-03-26 at 18:06 +0100, Ian Jackson wrote:
> > + * ` unsigned long
> > + * ` HYPERVISOR_get_debugreg(int regno);
> > + * For 0<=reg<=7, returns the debug register value.
> 
> Specifically these are the 8 architectural x86 debug registers %db0-7,
> this is an x86 only hypercall
> 
> > + * For other values of reg, returns ((unsigned long)-EINVAL).
> > + * (Unfortunately, this interface is defective.)
> 
> I guess you say this because you can't distinguish -EINVAL from a valid
> value.
> 
> Since these are architectural registers this isn't as bad as it could be
> I suppose, you would never expect to probe for these registers using the
> EINVAL return code.

Well, my point is that a function which returns either -EINVAL, or a
bit pattern from a register, is definitely wrong.

If the point of this is to catch broken guests, who are accessing
registers that do not exist and never will, it won't work, and should
be replaced by some kind of crash or log or something.

If the point is to allow probing by hypothetical future guests, there
needs to be a new mechanism since there is no reserved value.

If the point is to allow compatibility by hypothetical future guests,
the "no such register" value should probably have been all-bits-zero
in the hope that that would be a sensible value for for any registers
introduced in the future.

But in a documentation patch, I don't want to fix the API !

> > + * ` enum neg_errnoval
> > + * ` HYPERVISOR_set_callbacks(unsigned long event_selector,
> > + * `                          unsigned long event_address,
> > + * `                          unsigned long failsafe_selector,
> > + * `                          unsigned long failsafe_address);
> > + * `
> > + * Register for callbacks on events.  When an event (from an event
> > + * channel) occurs, event_address is used as the value of eip.
> 
> I think this interface is somewhat deprecated in favour of
> __HYPERVISOR_callback_op.

Interesting.  Should we write that it's deprecated ?

> > + *
> > + * A similar callback occurs if the segment selectors are invalid.
> > + * failsafe_address is used as the value of eip.
> > + *
> > + * On x86_64, event_selector and failsafe_selector are ignored (???).
> 
> Right, x86_64 doesn't really have selectors, just a vestigial remnant of
> selectors.

Good :-).  I'm glad I actually managed to find some facts.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.