From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Jan Beulich <JBeulich@suse.com>
Cc: wei.liu2@citrix.com, Ian Campbell <ian.campbell@citrix.com>,
ian.jackson@eu.citrix.com, mpohlack@amazon.de,
xen-devel@lists.xenproject.org, dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v1 2/4] xen-version: Add third parameter (len) to the do_version hypercall.
Date: Wed, 28 Oct 2015 18:34:37 +0000 [thread overview]
Message-ID: <5631153D.5090007@citrix.com> (raw)
In-Reply-To: <20151028175540.GA11004@l.oracle.com>
On 28/10/15 17:55, Konrad Rzeszutek Wilk wrote:
> On Fri, Oct 09, 2015 at 08:38:34AM -0600, Jan Beulich wrote:
>>>>> On 09.10.15 at 14:46, <ian.campbell@citrix.com> wrote:
>>> On Fri, 2015-10-09 at 13:29 +0100, Andrew Cooper wrote:
>>>> On 09/10/15 09:25, Jan Beulich wrote:
>>>>>>>> On 09.10.15 at 04:56, <konrad.wilk@oracle.com> wrote:
>>>>>> All existing commands ignore the parameter so this does
>>>>>> not break the ABI.
>>>>> Does it not? What about the debug mode clobbering of hypercall
>>>>> argument registers?
>>>> That is an implementation detail of the hypervisor. It is irrelevant to
>>>> guests whether Xen chooses to clobber the spare registers or not.
>>> Or in other words the effect here is to clobber one _less_ register, and
>>> the guest cannot have been relying on a register getting so clobbered (if
>>> nothing else it doesn't happen in debug=n builds).
>> No, the one less register clobbered is in the first clobbering phase,
>> where _unused_ inputs get clobbered (for hypervisor internal
>> consumption). The second clobbering phase destroys all _used_
>> input registers' contents (the guest visible values), and _this_ is
>> what results in ABI breakage (because callers assuming the
>> hypercall to take two arguments assume that the 3rd argument
>> register will retain its contents.
> Thanks for explaining it! I see my patch missed the change to
> hypercall_table and along with compiling with debug=y it all worked
> so I didn't get the 'len' parameter to be clobbered.
>
> Ugh.
>
> Then the right way to make this work would be to only clobber
> the third argument if the XENVER_buildid command was used? And
> preserve the third argument only if XENVER_buildid command was used.
>
> And not clobber third argument in all other cases. That would
> require some nasty tweaking of entry.S.
>
> Ugh. I think going to the original idea of just having an
> xen_build_id_t[1024] would be the easiest.
>
> Or I can do a structure:
>
> struct xen_build_id_t {
> uint32_t len; /* IN: size of the buffer. */
> uint32_t _pad; /* IN: MUST be zero. */
> XEN_GUEST_HANDLE_64(char) buf; /* OUT: Buffer with build_id. */
> }
>
> Any preference? The 'xen_build_id_t[1024]' looks nicer.
The current interface the xen_version hypercall is mad. It has the same
shortcoming as the C library function gets().
It is unfortunate that our current debug register-clobbering strategy
prevents altering the number of parameters in a forwards compatible.
There are two options to move forwards:
1) Introduce a new hypercall and relegate the existing one to being a
_compat.
2) Change our debug clobbering strategy.
We definitely dont any further contritions to the school of "pass a
pointer without a length and trust the other side".
I think it might be prudent to follow option 1), as that also allows to
fix other issues such as the arbitrary (and unreasonable IMO) 1k
restriction on the length of the hypervisor command line.
~Andrew
next prev parent reply other threads:[~2015-10-28 18:41 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 2:56 [PATCH v1] Add build-id to XENVER hypercall Konrad Rzeszutek Wilk
2015-10-09 2:56 ` [PATCH v1 1/4] xsm/libxl/xen_version: Add XSM for some of the xen_version commands Konrad Rzeszutek Wilk
2015-10-09 9:31 ` Ian Campbell
2015-10-30 10:24 ` Martin Pohlack
2015-10-09 12:20 ` Andrew Cooper
2015-10-30 10:24 ` Martin Pohlack
2015-10-09 2:56 ` [PATCH v1 2/4] xen-version: Add third parameter (len) to the do_version hypercall Konrad Rzeszutek Wilk
2015-10-09 8:25 ` Jan Beulich
2015-10-09 12:29 ` Andrew Cooper
2015-10-09 12:46 ` Ian Campbell
2015-10-09 12:58 ` Andrew Cooper
2015-10-09 14:38 ` Jan Beulich
2015-10-09 14:48 ` Ian Campbell
2015-10-28 17:55 ` Konrad Rzeszutek Wilk
2015-10-28 18:34 ` Andrew Cooper [this message]
2015-10-28 18:58 ` Konrad Rzeszutek Wilk
2015-10-29 9:06 ` Jan Beulich
2015-10-09 2:56 ` [PATCH v1 3/4] XENVER_build_id: Provide ld-embedded build-ids Konrad Rzeszutek Wilk
2015-10-09 9:35 ` Ian Campbell
2015-10-09 11:40 ` Martin Pohlack
2015-10-09 12:47 ` Andrew Cooper
2015-10-09 15:18 ` Jan Beulich
2016-01-06 18:07 ` Konrad Rzeszutek Wilk
2015-10-09 2:56 ` [PATCH v1 4/4] libxl: info: Display build_id of the hypervisor Konrad Rzeszutek Wilk
2015-10-09 9:36 ` Ian Campbell
2015-10-09 12:59 ` Andrew Cooper
2015-10-09 13:06 ` Ian Campbell
2015-10-09 13:11 ` Andrew Cooper
2015-10-09 13:14 ` Ian Campbell
2015-10-09 13:16 ` Ian Campbell
2015-10-09 8:17 ` [PATCH v1] Add build-id to XENVER hypercall Jan Beulich
2015-10-09 12:15 ` Andrew Cooper
2015-10-09 13:25 ` Konrad Rzeszutek Wilk
2015-10-09 15:14 ` Jan Beulich
2015-10-28 15:42 ` Konrad Rzeszutek Wilk
2015-10-28 19:00 ` Konrad Rzeszutek Wilk
2015-10-29 8:55 ` Jan Beulich
2015-10-29 19:47 ` Konrad Rzeszutek Wilk
2015-10-30 8:11 ` Jan Beulich
2015-10-09 14:32 ` Jan Beulich
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=5631153D.5090007@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=mpohlack@amazon.de \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).