* Hypercalls: ignored output registers?
@ 2015-12-27 3:42 Carl Patenaude Poulin
2015-12-27 11:22 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Carl Patenaude Poulin @ 2015-12-27 3:42 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 476 bytes --]
Hi all,
I'm looking at how hypercalls are implemented in Mini-OS and Andrew
Cooper's xen-test-framework. In both cases, several registers are
defined as outputs, they're bound by input registers, and their
outputs are ignored. Is there any reason for doing this instead of
just declaring directly the input registers?
Is it because the registers are callee-saved? If that's the case,
why not just put them in the clobber list?
Best
Carl Patenaude Poulin
McGill University
[-- Attachment #1.2: Type: text/html, Size: 681 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Hypercalls: ignored output registers?
2015-12-27 3:42 Hypercalls: ignored output registers? Carl Patenaude Poulin
@ 2015-12-27 11:22 ` Andrew Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2015-12-27 11:22 UTC (permalink / raw)
To: Carl Patenaude Poulin, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1149 bytes --]
On 27/12/2015 03:42, Carl Patenaude Poulin wrote:
> Hi all,
>
> I'm looking at how hypercalls are implemented in Mini-OS and Andrew
> Cooper's xen-test-framework. In both cases, several registers are
> defined as outputs, they're bound by input registers, and their
> outputs are ignored. Is there any reason for doing this instead of
> just declaring directly the input registers?
>
> Is it because the registers are callee-saved? If that's the case,
> why not just put them in the clobber list?
This is because of some of the restrictions when constructing asm
statements.
The clobber list must be mutually exclusive with any of the named
inputs/ouputs. Anything listed in the inputs alone is expected to
retain its value across the asm statement.
As the values in the registers are modified by the hypercall, we need a
separate way to indicate that they are clobbered.
This is done by listing them as an output as well (which indicates that
their value is now different to the value they had as an input), being
directed at a variable which is never referenced again (i.e. we don't
care what the eventual value actually is).
~Andrew
[-- Attachment #1.2: Type: text/html, Size: 1983 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-27 11:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-27 3:42 Hypercalls: ignored output registers? Carl Patenaude Poulin
2015-12-27 11:22 ` Andrew Cooper
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.