xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: "Jan Beulich" <jbeulich@suse.com>,
	Xen-devel <xen-devel@lists.xenproject.org>, nd <nd@arm.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>, "Wei Liu" <wl@xen.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v2] xen/arm: Convert runstate address during hypcall
Date: Thu, 20 Aug 2020 11:23:45 +0100	[thread overview]
Message-ID: <3aa2958a-fec7-8a37-bf49-961b34141d9c@xen.org> (raw)
In-Reply-To: <3230CBBC-0C63-44DA-A767-14977890547C@arm.com>

Hi,

Sorry for the late answer.

On 14/08/2020 10:25, Bertrand Marquis wrote:
> 
> 
>> On 1 Aug 2020, at 00:03, Stefano Stabellini <sstabellini@kernel.org> wrote:
>>
>> On Fri, 31 Jul 2020, Bertrand Marquis wrote:
>>>> On 31 Jul 2020, at 12:18, Jan Beulich <jbeulich@suse.com> wrote:
>>>>
>>>> On 31.07.2020 12:12, Julien Grall wrote:
>>>>> On 31/07/2020 07:39, Jan Beulich wrote:
>>>>>> We're fixing other issues without breaking the ABI. Where's the
>>>>>> problem of backporting the kernel side change (which I anticipate
>>>>>> to not be overly involved)?
>>>>> This means you can't take advantage of the runstage on existing Linux
>>>>> without any modification.
>>>>>
>>>>>> If the plan remains to be to make an ABI breaking change,
>>>>>
>>>>> For a theoritical PoV, this is a ABI breakage. However, I fail to see
>>>>> how the restrictions added would affect OSes at least on Arm.
>>>>
>>>> "OSes" covering what? Just Linux?
>>>>
>>>>> In particular, you can't change the VA -> PA on Arm without going
>>>>> through an invalid mapping. So I wouldn't expect this to happen for the
>>>>> runstate.
>>>>>
>>>>> The only part that *may* be an issue is if the guest is registering the
>>>>> runstate with an initially invalid VA. Although, I have yet to see that
>>>>> in practice. Maybe you know?
>>>>
>>>> I'm unaware of any such use, but this means close to nothing.
>>>>
>>>>>> then I
>>>>>> think this will need an explicit vote.
>>>>>
>>>>> I was under the impression that the two Arm maintainers (Stefano and I)
>>>>> already agreed with the approach here. Therefore, given the ABI breakage
>>>>> is only affecting Arm, why would we need a vote?
>>>>
>>>> The problem here is of conceptual nature: You're planning to
>>>> make the behavior of a common hypercall diverge between
>>>> architectures, and in a retroactive fashion. Imo that's nothing
>>>> we should do even for new hypercalls, if _at all_ avoidable. If
>>>> we allow this here, we'll have a precedent that people later
>>>> may (and based on my experience will, sooner or later) reference,
>>>> to get their own change justified.
>>
>> Please let's avoid "slippery slope" arguments
>> (https://en.wikipedia.org/wiki/Slippery_slope)
>>
>> We shouldn't consider this instance as the first in a long series of bad
>> decisions on hypercall compatibility. Each new case, if there will be
>> any, will have to be considered based on its own merits. Also, let's
>> keep in mind that there have been no other cases in the last 8 years. (I
>> would like to repeat my support for hypercall ABI compatibility.)
>>
>>
>> I would also kindly ask not to put the discussion on a "conceptual"
>> level: there is no way to fix all guests and also keep compatibility.
>>  From a conceptual point of view, it is already game over :-)
>>
>>
>>> After a discussion with Jan, he is proposing to have a guest config setting to
>>> turn on or off the translation of the address during the hypercall and add a
>>> global Xen command line parameter to set the global default behaviour.
>>> With this was done on arm could be done on x86 and the current behaviour
>>> would be kept by default but possible to modify by configuration.
>>>
>>> @Jan: please correct me if i said something wrong
>>> @others: what is your view on this solution ?
>>
>> Having options to turn on or off the new behavior could be good-to-have
>> if we find a guest that actually requires the old behavior. Today we
>> don't know of any such cases. We have strong reasons to believe that
>> there aren't any on ARM (see Julien's explanation in regards to the
>> temporary invalid mappings.) In fact, it is one of the factors that led
>> us to think this patch is the right approach.
>>
>> That said, I am also OK with adding such a parameter now, but we need to
>> choose the default value carefully.

I agree with that :).

> 
> This would also mean keeping support in the code for old and new behaviour
> which might make the code bigger and more complex.

I am concerned with that as well. However, this concern is also going to 
be true if we introduce an hypercall using a physical address as 
parameter. Indeed, the old hypercall will not go away.

If we introduce a second hypercall, you will also have to think about 
the interactions between the two. For instance:
     - The firmware may register the runstate using the old hypercall, 
while the OS may register using the new hypercall.
     - Can an OS use a mix of the two hypercalls?

For more details, you can have a look at the original attempt for a new 
hypercall (see [1]).

The approach you discussed with Jan has the advantage to not require any 
change in the guest software stack. So this would be my preference over 
a new hypercall.

>>
>>
>> We need the new behavior as default on ARM because we need the fix to
>> work for all guests. I don't think we want to explain how you always
>> need to set config_foobar otherwise things don't work. It has to work
>> out of the box.
>>
>> It would be nice if we had the same default on x86 too, although I
>> understand if Jan and Andrew don't want to make the same change on x86,
>> at least initially.
> 
> So you mean here adding a parameter but only on Arm ?
> Should it be a command line parameter ? a configuration parameter ? both ?
> 
> It seems that with this patch i touched some kind of sensible area.
> Should i just abandon it and see later to work on adding a new hypercall using
> a physical address as parameter ?

I would suggest to mention the thread in the next community call.

Cheers,

[1] <1558721577-13958-3-git-send-email-andrii.anisov@gmail.com>


-- 
Julien Grall


      reply	other threads:[~2020-08-20 10:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 15:52 [PATCH v2] xen/arm: Convert runstate address during hypcall Bertrand Marquis
2020-07-28 19:04 ` Stefano Stabellini
2020-07-29  6:47   ` Bertrand Marquis
2020-07-28 19:54 ` Jan Beulich
2020-07-29  7:08   ` Bertrand Marquis
2020-07-29 18:41     ` Jan Beulich
2020-07-30  1:30       ` Stefano Stabellini
2020-07-31  6:39         ` Jan Beulich
2020-07-31 10:12           ` Julien Grall
2020-07-31 10:18             ` Jan Beulich
2020-07-31 14:36               ` Bertrand Marquis
2020-07-31 23:03                 ` Stefano Stabellini
2020-08-14  9:25                   ` Bertrand Marquis
2020-08-20 10:23                     ` Julien Grall [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=3aa2958a-fec7-8a37-bf49-961b34141d9c@xen.org \
    --to=julien@xen.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=nd@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --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).