xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Clark <christopher.w.clark@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: "Tim Deegan" <tim@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Ross Philipson" <ross.philipson@gmail.com>,
	"Jason Andryuk" <jandryuk@gmail.com>,
	"George Dunlap" <George.Dunlap@eu.citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Ian Jackson" <Ian.Jackson@eu.citrix.com>,
	"Rich Persaud" <persaur@gmail.com>,
	"James McKenzie" <voreekf@madingley.org>,
	"Daniel Smith" <dpsmith@apertussolutions.com>,
	"Julien Grall" <julien.grall@arm.com>,
	"Paul Durrant" <paul.durrant@citrix.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	"eric chanudet" <eric.chanudet@gmail.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 15/25] argo: implement the sendv op
Date: Fri, 4 Jan 2019 00:13:09 -0800	[thread overview]
Message-ID: <CACMJ4GbkBn692QsX9d-Y43YNN6N_foOCqJJQja0exDm7SNO8Aw@mail.gmail.com> (raw)
In-Reply-To: <5C1B53BC0200007800207E73@prv1-mh.provo.novell.com>

On Thu, Dec 20, 2018 at 12:33 AM Jan Beulich <JBeulich@suse.com> wrote:
>
> >>> On 20.12.18 at 06:58, <christopher.w.clark@gmail.com> wrote:
> > On Wed, Dec 12, 2018 at 3:53 AM Jan Beulich <JBeulich@suse.com> wrote:
> >> >>> On 01.12.18 at 02:32, <christopher.w.clark@gmail.com> wrote:
> >> > +static struct argo_ring_info *
> >> > +argo_ring_find_info_by_match(const struct domain *d, uint32_t port,
> >> > +                             domid_t partner_id, uint64_t partner_cookie)
> >> > +{
> >> > +    argo_ring_id_t id;
> >> > +    struct argo_ring_info *ring_info;
> >> > +
> >> > +    ASSERT(rw_is_locked(&d->argo->lock));
> >> > +
> >> > +    id.addr.port = port;
> >> > +    id.addr.domain_id = d->domain_id;
> >> > +    id.partner = partner_id;
> >> > +
> >> > +    ring_info = argo_ring_find_info(d, &id);
> >> > +    if ( ring_info && (partner_cookie == ring_info->partner_cookie) )
> >> > +        return ring_info;
> >>
> >> Such a cookie makes mismatches unlikely, but it doesn't exclude
> >> them. If there are other checks, is the cookie useful at all?
> >
> > Yes, I think so and it's proved useful elsewhere in the second
> > version of the series: it helps avoid sending signals to incorrect
> > domains that may not be argo-enabled.
>
> "It helps avoid" still isn't "it allows to avoid", i.e. it still sounds like
> an approach reducing likelihood instead of one excluding mistakes
> altogether.

ok, I'm at the point where I'm close to having a version three of the
series to post that addresses all the feedback so far, plus some
additional improvements, with the following two items remaining to
discuss:

1) the domain_cookie, with Jan's question about a) its exclusion of
mismatches and b) its utility.

Given the expressed concern that the timer-based cookie initialization
does not necessarily exclude mismatches, I've reimplemented it as a
simple 128-bit counter protected by the L1 lock: this does now exclude
mismatches.

The utility of the cookie follows from this:

domid, despite its name, is not a unique domain identifier; it's a
temporally unique id: Xen will ensure that no two domains that execute
concurrently have the same domid. Domain authentication needs to take
this into account.

With Argo, it affects these points:

* ring registration: when the partner domain domid is specified, argo
finds the currently executing domain with that domid, and needs to
be able to confirm that it is the same domain later when a sendv is
issued.

* sendv: needs to confirm that the domain sending a message is the same
as the single domain authorized to transmit when the ring was first
registered.

* notify: the querying domain asks about free space, and if there's not
enough then a record is kept internal to the hypervisor, and a signal
will be sent to the caller later when sufficient space becomes
available.  Before sending the signal, Xen needs to confirm that the
current domain with the domid it remembered is the same as the one that
issued the query, otherwise Xen is sending spurious signals to domains
that are not expecting it (and unless it checks, may not even be
argo-enabled).

* domain teardown: in the absence of the domain cookie, or an
alternative data structure that achieves the same ability to
distinguish a reincarnated domain, all the rings that are registered
that authorize the dying domid to send need to be torn down with
suitable notification to their owners, and all the pending signals for
that domain about available free space need to be nullified, to prevent
a later domain inheriting these credentials and signals.

Doing so either entails a potentially-expensive walk of all rings of all
domains, plus all the pending notifications on all rings the domain can
access, or additional complexity with new data structures storing
further metadata on the authorized domain on ring registration, etc.
The domain cookie which enables identity confirmation on a domid is
a reasonable alternative solution.

So: if the switch to a simple counter is sufficient to mitigate the
mismatch concern, and the utility of the cookie is potentially
acceptable, I'll post a v3 series for review with that present.


2) the p2m type of the guest-supplied memory for the ring.

Roger raised a query about not pinning the p2m type of memory
used for the ring, and my response on 21st December is here:

https://lists.xenproject.org/archives/html/xen-devel/2018-12/msg02204.html

At the moment, I haven't changed that code. If the p2m type is changed
after ring registration, is it a problem? If not, then I think the code is
OK; but if so then a pointer to what makes it problematic would be
helpful to determine an appropriate next step.

thanks,

Christopher

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

  reply	other threads:[~2019-01-04  8:13 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
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 [this message]
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=CACMJ4GbkBn692QsX9d-Y43YNN6N_foOCqJJQja0exDm7SNO8Aw@mail.gmail.com \
    --to=christopher.w.clark@gmail.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dpsmith@apertussolutions.com \
    --cc=eric.chanudet@gmail.com \
    --cc=jandryuk@gmail.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.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).