xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Christopher Clark <christopher.w.clark@gmail.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Ross Philipson" <ross.philipson@gmail.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"George Dunlap" <George.Dunlap@eu.citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Jason Andryuk" <jandryuk@gmail.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"James McKenzie" <voreekf@madingley.org>,
	"Tim Deegan" <tim@xen.org>,
	"Daniel Smith" <dpsmith@apertussolutions.com>,
	"Rich Persaud" <persaur@gmail.com>,
	"Paul Durrant" <paul.durrant@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	nd@arm.com, "eric chanudet" <eric.chanudet@gmail.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 13/25] argo: implement the register op
Date: Tue, 11 Dec 2018 13:51:58 +0000	[thread overview]
Message-ID: <8771a56d-42c0-e6ce-3543-82fba610621a@arm.com> (raw)
In-Reply-To: <CACMJ4Gby+0nV+45w9397Qbgn2xUF8sZ-j44GgZ0_VFFGuD3rmw@mail.gmail.com>

Hi Christoffer,

On 05/12/2018 22:35, Christopher Clark wrote:
> On Wed, Dec 5, 2018 at 9:20 AM Julien Grall <julien.grall@arm.com> wrote:
>> On 04/12/2018 09:08, Christopher Clark wrote:
>>> On Sun, Dec 2, 2018 at 12:11 PM Julien Grall <Julien.Grall@arm.com> wrote:
>>>> On 01/12/2018 01:32, Christopher Clark wrote:
>>>>> diff --git a/xen/include/public/argo.h b/xen/include/public/argo.h
>>>>> ...
>>>>> +/* pfn type: 64-bit on all architectures to aid avoiding a compat ABI */
>>>>> +typedef uint64_t argo_pfn_t;
>>>>
>>>> As you always use 64-bit, can we just use an address? This would make
>>>> the ABI agnostic to the hypervisor page granularity.
>>
>> By address I meant guest physical address (and not guest virtual address).
>>
>> Arm processors may support multiple page granularity (4KB, 16KB, 64KB). The
>> software is allowed to use different granularity at different level. This means
>> that the hypervisor could use 4KB page while the guest kernel would use 64KB
>> page (and vice versa). Some distros made the choice to only support one type of
>> page granularity (i.e 64KB for REHL, 4KB for Debian...).
>>
>> At the moment the hypercall interface is based on the hypervisor page
>> granularity. Because Xen has always supported 4KB page-granularity, this
>> assumption was also hardcoded in the kernel.
>>
>> What prevent us to get 64KB page support in Xen (and therefore support for
>> 52-bit address) is the hypercall ABI. If you upgrade Xen to 64KB then the
>> hypercall interface would defact use 64KB frame. This would break any current
>> guest. It is also not possible to keep 4KB pages everywhere because you can only
>> map 64KB in Xen. So you may map a bit too much from another guest.
>>
>> This makes me think that the frame is probably not the best in that situation.
>> Instead a pair of address/size would be more suitable.
>>
>> The problem is much larger than this series. But I thought I would attempt to
>> convince the community using guest physical address over guest frame address
>> whenever it is possible.
> 
> Thanks, Julien -- that explanation is very helpful and your request makes sense.
> 
> So in concrete terms, with the change that you're advocating for to
> this patch, the 64-bit value that is supplied by the guest in the
> array passed as an argument to register_ring would encode the same
> guest physical frame number as it currently does in the patch version
> presented in this thread, but it would be bit-shifted to the position
> used in a physical address.
> 
> In addition to that change, a page size indicator would be supplied
> too -- for every page address supplied in the call.
> 
> Is there a method currently used within Xen (or relevant places
> elsewhere) for encoding both the page address and size (ie. 4KB, 16KB
> or 64KB) within the same 64-bits?
> ie. Knowing that the smallest granularity of page is 4KB, and that all
> pages are aligned to at least a 4KB boundary, there are low bits in
> the address that are known to be zero, and those could be used to
> indicate the page size when supplied to this call. It seems like such
> an encoding would allow for avoiding doubling the size of the argument
> array, but I'm not sure how inconvenient it would be to work with in
> practice.
> 
> If so, such an interface change looks manageable and hopefully it
> would be acceptable to only support 4KB pages in the current
> implementation behind that new ABI for the time being. Let me know
> what you think.

If you let the user the choice of the granularity, then, I believe, you will 
prevent the hypervisor to do some optimization.

For instance, if the guest supplies only 4KB page but the hypervisor is 64KB. 
There are no way to easily map them contiguously in the hypervisor (e.g using vmap).

Is there a particular reason to allow the ring buffer to be non-contiguous in 
the guest physical address?

Depending on the answer, there are different way to handle that:
	1) Request the guest to allocate memory using 64KB (on Arm) chunk and pass the 
base address for each chunk
	2) Request the guest to allocate contiguously the buffer and pass the base 
address and size

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-12-11 13:52 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-01  1:32 [PATCH 00/25] Argo: hypervisor-mediated interdomain communication Christopher Clark
2018-12-01  1:32 ` [PATCH 01/25] xen/evtchn: expose evtchn_bind_ipi_vcpu0_domain for use within Xen Christopher Clark
2018-12-03 16:20   ` Jan Beulich
2018-12-04  9:17     ` Christopher Clark
2018-12-01  1:32 ` [PATCH 02/25] argo: Introduce the Kconfig option to govern inclusion of Argo Christopher Clark
2018-12-03 15:51   ` Jan Beulich
2018-12-04  9:12     ` Christopher Clark
2018-12-01  1:32 ` [PATCH 03/25] argo: introduce the argo_message_op hypercall boilerplate Christopher Clark
2018-12-04  9:44   ` Paul Durrant
2018-12-20  5:13     ` Christopher Clark
2018-12-01  1:32 ` [PATCH 04/25] argo: define argo_dprintk for subsystem debugging Christopher Clark
2018-12-03 15:59   ` Jan Beulich
2018-12-01  1:32 ` [PATCH 05/25] argo: Add initial argo_init and argo_destroy Christopher Clark
2018-12-04  9:12   ` Paul Durrant
2018-12-13 13:16   ` Jan Beulich
2018-12-01  1:32 ` [PATCH 06/25] argo: Xen command line parameter 'argo': bool to enable/disable Christopher Clark
2018-12-04  9:18   ` Paul Durrant
2018-12-04 11:35   ` Jan Beulich
2018-12-01  1:32 ` [PATCH 07/25] xen (ARM, x86): add errno-returning functions for copy Christopher Clark
2018-12-04  9:35   ` Paul Durrant
2018-12-12 16:01   ` Roger Pau Monné
2018-12-20  5:16     ` Christopher Clark
2018-12-20  8:45       ` Jan Beulich
2018-12-20 12:57       ` Roger Pau Monné
2018-12-01  1:32 ` [PATCH 08/25] xen: define XEN_GUEST_HANDLE_NULL as null XEN_GUEST_HANDLE Christopher Clark
2018-12-04 11:39   ` Jan Beulich
2018-12-01  1:32 ` [PATCH 09/25] errno: add POSIX error codes EMSGSIZE, ECONNREFUSED to the ABI Christopher Clark
2018-12-03 15:42   ` Jan Beulich
2018-12-04  9:10     ` Christopher Clark
2018-12-04 10:04       ` Jan Beulich
2018-12-01  1:32 ` [PATCH 10/25] arm: introduce guest_handle_for_field() Christopher Clark
2018-12-04  9:46   ` Paul Durrant
2018-12-01  1:32 ` [PATCH 11/25] xsm, argo: XSM control for argo register operation, argo_mac bootparam Christopher Clark
2018-12-04  9:52   ` Paul Durrant
2018-12-20  5:19     ` Christopher Clark
2018-12-01  1:32 ` [PATCH 12/25] xsm, argo: XSM control for argo message send operation Christopher Clark
2018-12-04  9:53   ` Paul Durrant
2018-12-01  1:32 ` [PATCH 13/25] argo: implement the register op Christopher Clark
2018-12-02 20:10   ` Julien Grall
2018-12-04  9:08     ` Christopher Clark
2018-12-05 17:20       ` Julien Grall
2018-12-05 22:35         ` Christopher Clark
2018-12-11 13:51           ` Julien Grall [this message]
2018-12-04 10:57   ` Paul Durrant
2018-12-12  9:48   ` Jan Beulich
2018-12-20  5:29     ` Christopher Clark
2018-12-20  8:29       ` Jan Beulich
2018-12-21  1:25         ` Christopher Clark
2018-12-21  7:28           ` Jan Beulich
2018-12-21  8:16             ` Christopher Clark
2018-12-21  8:53               ` Jan Beulich
2018-12-21 23:28                 ` Christopher Clark
2018-12-12 16:47   ` Roger Pau Monné
2018-12-20  5:41     ` Christopher Clark
2018-12-20  8:51       ` Jan Beulich
2018-12-20 12:52       ` Roger Pau Monné
2018-12-21 23:05         ` Christopher Clark
2019-01-04  8:57           ` Roger Pau Monné
2019-01-04 13:22             ` Jan Beulich
2019-01-04 15:35               ` Roger Pau Monné
2019-01-04 15:47                 ` Jan Beulich
2019-01-07  9:00                   ` Roger Pau Monné
2019-01-09 16:15                     ` Tamas K Lengyel
2019-01-09 16:23                       ` Razvan Cojocaru
2019-01-09 16:34                       ` Roger Pau Monné
2019-01-09 16:48                         ` Razvan Cojocaru
2019-01-09 16:50                           ` Tamas K Lengyel
2019-01-09 16:59                             ` Roger Pau Monné
2019-01-09 17:03                               ` Fwd: " Roger Pau Monné
2019-01-09 17:03                             ` Razvan Cojocaru
2018-12-01  1:32 ` [PATCH 14/25] argo: implement the unregister op Christopher Clark
2018-12-04 11:10   ` Paul Durrant
2018-12-12  9:51   ` Jan Beulich
2018-12-01  1:32 ` [PATCH 15/25] argo: implement the sendv op Christopher Clark
2018-12-04 11:22   ` Paul Durrant
2018-12-12 11:52   ` Jan Beulich
2018-12-20  5:58     ` Christopher Clark
2018-12-20  8:33       ` Jan Beulich
2019-01-04  8:13         ` Christopher Clark
2019-01-04  8:43           ` Roger Pau Monné
2019-01-04 13:37           ` Jan Beulich
2019-01-07 20:54             ` Christopher Clark
2018-12-01  1:32 ` [PATCH 16/25] argo: implement the notify op Christopher Clark
2018-12-13 14:06   ` Jan Beulich
2018-12-20  6:12     ` Christopher Clark
2018-12-20  8:39       ` Jan Beulich
2018-12-01  1:32 ` [PATCH 17/25] xsm, argo: XSM control for any access to argo by a domain Christopher Clark
2018-12-01  1:32 ` [PATCH 18/25] argo: limit the max number of rings that a domain may register Christopher Clark
2018-12-13 14:08   ` Jan Beulich
2018-12-01  1:32 ` [PATCH 19/25] argo: limit the max number of notify requests in a single operation Christopher Clark
2018-12-01  1:32 ` [PATCH 20/25] argo, xsm: notify: don't describe rings that cannot be sent to Christopher Clark
2018-12-01  1:33 ` [PATCH 21/25] argo: add array_index_nospec to guard the result of the hash func Christopher Clark
2018-12-13 14:10   ` Jan Beulich
2018-12-01  1:33 ` [PATCH 22/25] xen/evtchn: expose send_guest_global_virq for use within Xen Christopher Clark
2018-12-13 14:12   ` Jan Beulich
2018-12-01  1:33 ` [PATCH 23/25] argo: signal x86 HVM and ARM via VIRQ Christopher Clark
2018-12-02 19:55   ` Julien Grall
2018-12-04  9:03     ` Christopher Clark
2018-12-04  9:16       ` Paul Durrant
2018-12-12 14:49         ` James
2018-12-11 14:15       ` Julien Grall
2018-12-13 14:16   ` Jan Beulich
2018-12-20  6:20     ` Christopher Clark
2018-12-01  1:33 ` [PATCH 24/25] argo: unmap rings on suspend and send signal to ring-owners on resume Christopher Clark
2018-12-13 14:26   ` Jan Beulich
2018-12-20  6:25     ` Christopher Clark
2018-12-01  1:33 ` [PATCH 25/25] argo: implement the get_config op to query notification config Christopher Clark
2018-12-13 14:32   ` Jan Beulich
2018-12-03 16:49 ` [PATCH 00/25] Argo: hypervisor-mediated interdomain communication Chris Patterson
2018-12-04  9:00   ` Christopher Clark
2018-12-11 22:13     ` Chris Patterson

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=8771a56d-42c0-e6ce-3543-82fba610621a@arm.com \
    --to=julien.grall@arm.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=christopher.w.clark@gmail.com \
    --cc=dpsmith@apertussolutions.com \
    --cc=eric.chanudet@gmail.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jandryuk@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=nd@arm.com \
    --cc=paul.durrant@citrix.com \
    --cc=persaur@gmail.com \
    --cc=roger.pau@citrix.com \
    --cc=ross.philipson@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=voreekf@madingley.org \
    --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).