All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Julien Grall <julien@xen.org>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wl@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Julien Grall" <jgrall@amazon.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	xen-devel@lists.xenproject.org,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 6/7] xen/guest_access: Consolidate guest access helpers in xen/guest_access.h
Date: Thu, 9 Apr 2020 10:06:52 +0200	[thread overview]
Message-ID: <f02f09ec-b643-8321-e235-ce0ee5526ab3@suse.com> (raw)
In-Reply-To: <c8e66108-7ac1-fb51-841f-21886b731f04@xen.org>

On 09.04.2020 10:01, Julien Grall wrote:
> Hi,
> 
> On 09/04/2020 07:30, Jan Beulich wrote:
>> On 09.04.2020 00:05, Julien Grall wrote:
>>> Hi Jan,
>>>
>>> On 07/04/2020 09:14, Jan Beulich wrote:
>>>> On 04.04.2020 15:10, Julien Grall wrote:
>>>>> From: Julien Grall <jgrall@amazon.com>
>>>>>
>>>>> Most of the helpers to access guest memory are implemented the same way
>>>>> on Arm and x86. The only differences are:
>>>>>       - guest_handle_{from, to}_param(): while on x86 XEN_GUEST_HANDLE()
>>>>>         and XEN_GUEST_HANDLE_PARAM() are the same, they are not on Arm. It
>>>>>         is still fine to use the Arm implementation on x86.
>>>>>       - __clear_guest_offset(): Interestingly the prototype does not match
>>>>>         between the x86 and Arm. However, the Arm one is bogus. So the x86
>>>>>         implementation can be used.
>>>>>       - guest_handle{,_subrange}_okay(): They are validly differing
>>>>>         because Arm is only supporting auto-translated guest and therefore
>>>>>         handles are always valid.
>>>>
>>>> While I'm fine in principle with such consolidation, I'm afraid I
>>>> really need to ask for some historical background to be added
>>>> here. It may very well be that there's a reason for the separation
>>>> (likely to be found in the removed ia64 or ppc ports), which may
>>>> then provide a hint at why future ports may want to have these
>>>> separated. If such reasons exist, I'd prefer to avoid the back and
>>>> forth between headers. What we could do in such a case is borrow
>>>> Linux'es asm-generic/ concept, and move the "typical"
>>>> implementation there. (And of course if there were no noticable
>>>> reasons for the split, the change as it is would be fine in
>>>> general; saying so without having looked at the details of it,
>>>> yet).
>>>
>>> Looking at the history, ia64 and ppc used to include a common
>>> header called xen/xencomm.h from asm/guest_access.h.
>>>
>>> This has now disappeared with the removal of the two ports.
>>>
>>> Regarding future arch, the fact arm and x86 gives me some confidence
>>> we are unlikely going to get a new ABI for an arch. Do you see any
>>> reason to?
>>
>> Well, there surely had be a reason for ia64 and ppc to use a
>> different approach. 
> 
> This was introduced way before my time in Xen. AFAICT, you were
> already part of the community when 'xencomm' were alive.

I was, but I was never actively involved in ia64 or ppc work.

> There are not much information about it only nor in the commits.
> So do you mind sharing a bit more what 'xencomm' meant to be
> and why it wasn't introduced on x86?

If I had details, I would have provided at least some hints already.

>> I don't see why a new port may not also want
>> to go that route instead of the x86/Arm one.
> I could accept that someone would want to reinvent a new ABI
> from scratch for just an hypothetical new arch. However it would
> be quite an effort to reinvent XEN_GUEST_HANDLE(). The chance is
> RISC-V is only going to re-use what Arm did as Arm already did
> with x86.
> 
> I would like to avoid to introduce a new directory asm-generic
> with just one header in it. Maybe you have some other headers in
> mind?

I recall having wondered a few times whether we shouldn't use this
concept elsewhere. One case iirc was bitops stuff. Looking over
the Linux ones, some atomic and barrier fallback implementations
may also sensibly live there, and there are likely more.

Jan


  reply	other threads:[~2020-04-09  8:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04 13:10 [PATCH 0/7] xen: Consolidate asm-*/guest_access.h in xen/guest_access.h Julien Grall
2020-04-04 13:10 ` [PATCH 1/7] xen/guest_access: Add missing emacs magics Julien Grall
2020-04-07  8:05   ` Jan Beulich
2020-04-08 21:43     ` Julien Grall
2020-04-04 13:10 ` [PATCH 2/7] xen/arm: kernel: Re-order the includes Julien Grall
2020-04-04 13:10 ` [PATCH 3/7] xen/arm: decode: " Julien Grall
2020-04-04 13:10 ` [PATCH 4/7] xen/arm: guestcopy: " Julien Grall
2020-04-04 13:10 ` [PATCH 5/7] xen: include xen/guest_access.h rather than asm/guest_access.h Julien Grall
2020-04-06  7:40   ` Paul Durrant
2020-04-06  8:51     ` Julien Grall
2020-04-04 13:10 ` [PATCH 6/7] xen/guest_access: Consolidate guest access helpers in xen/guest_access.h Julien Grall
2020-04-07  8:14   ` Jan Beulich
2020-04-08 22:05     ` Julien Grall
2020-04-09  6:30       ` Jan Beulich
2020-04-09  8:01         ` Julien Grall
2020-04-09  8:06           ` Jan Beulich [this message]
2020-04-09  9:28             ` Julien Grall
2020-04-29 14:04               ` Julien Grall
2020-04-29 14:07                 ` Jan Beulich
2020-04-29 14:13                   ` Julien Grall
2020-04-29 14:54                     ` Jan Beulich
2020-04-29 15:03                       ` Julien Grall
2020-05-16 10:25                 ` Julien Grall
2020-05-19 15:05                   ` Ian Jackson
2020-05-29 11:45                     ` Julien Grall
2020-04-04 13:10 ` [PATCH 7/7] xen/guest_access: Fix coding style " Julien Grall
2020-04-07  8:17   ` Jan Beulich
2020-04-07  9:08     ` Julien Grall
2020-04-04 13:13 ` [PATCH 0/7] xen: Consolidate asm-*/guest_access.h " Julien Grall

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=f02f09ec-b643-8321-e235-ce0ee5526ab3@suse.com \
    --to=jbeulich@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgrall@amazon.com \
    --cc=julien@xen.org \
    --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 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.