From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Carl Patenaude Poulin <carl.patenaudepoulin@mail.mcgill.ca>,
xen-devel@lists.xen.org
Subject: Re: Hypercalls: ignored output registers?
Date: Sun, 27 Dec 2015 11:22:35 +0000 [thread overview]
Message-ID: <567FC9FB.7080700@citrix.com> (raw)
In-Reply-To: <CA+v+Np+RFoPihfqmSyx7NsVBCbSQLvurfxVXmwivsL+9JN22ZA@mail.gmail.com>
[-- 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
prev parent reply other threads:[~2015-12-27 11:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-27 3:42 Hypercalls: ignored output registers? Carl Patenaude Poulin
2015-12-27 11:22 ` Andrew Cooper [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=567FC9FB.7080700@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=carl.patenaudepoulin@mail.mcgill.ca \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.