All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>, Jann Horn <jannh@google.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Julien Grall <julien.grall@arm.com>
Subject: Re: [PATCH 1/2] memory: exit early from memory_exchange() upon write-back error
Date: Tue, 4 Apr 2017 19:45:23 +0100	[thread overview]
Message-ID: <7d10322a-88c9-285a-0c75-3cf3424af753@citrix.com> (raw)
In-Reply-To: <58E3B826020000780014CA6A@prv-mh.provo.novell.com>

On 04/04/17 14:13, Jan Beulich wrote:
> There's no point in continuing if in the end we'll return -EFAULT
> anyway. It also seems wrong to report a chunk for which at least one
> write-back failed as successfully exchanged (albeit the indication of
> an error is also not fully correct, as the exchange happened in that
> case at least partially - retrieving the GFN to assign the memory to
> and/or handing back the information on the replacement memory didn't
> work). In any case limiting the amount of damage done to the guest
> can't be all that bad an idea.
>
> Reported-by: Jann Horn <jannh@google.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

> ---
> I'm additionally surprised we don't require input GFNs to be order
> aligned for both IN- and OUT-chunks (similarly for populate-physmap
> and decrease-reservation).

This sounds like a bug, rather than being intentional.

>
> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c

As an observation, I find it amusing that there is a comment just above
this which states

/*
 * Success! Beyond this point we cannot fail for this chunk.
 */

> @@ -639,6 +639,9 @@ static long memory_exchange(XEN_GUEST_HA
>              }
>          }
>          BUG_ON( !(d->is_dying) && (j != (1UL << out_chunk_order)) );
> +
> +        if ( rc )
> +            goto fail;
>      }
>  
>      exch.nr_exchanged = exch.in.nr_extents;
>
>
>


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

  reply	other threads:[~2017-04-04 18:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 12:53 [PATCH 0/2] memory: XSA-212 follow-up Jan Beulich
2017-04-04 13:13 ` [PATCH 1/2] memory: exit early from memory_exchange() upon write-back error Jan Beulich
2017-04-04 18:45   ` Andrew Cooper [this message]
2017-04-05  6:58     ` Jan Beulich
2017-04-05  7:00     ` Jan Beulich
2017-04-04 13:14 ` [PATCH 2/2] memory: don't hand MFN info to translated guests Jan Beulich
2017-04-04 19:04   ` Andrew Cooper
2017-06-18 19:19     ` Tamas K Lengyel
2017-06-19  8:15       ` Jan Beulich
2017-06-19  9:09         ` Julien Grall
2017-06-19 14:39           ` Tamas K Lengyel
2017-06-19 14:52             ` Julien Grall
2017-06-19 14:57               ` Tamas K Lengyel
2017-06-19 15:34                 ` Julien Grall
2017-06-19 16:38                   ` Tamas K Lengyel
2017-06-19 16:57                     ` Tamas K Lengyel
2017-06-19  9:11         ` George Dunlap
2017-06-19 10:52           ` Jan Beulich
2017-06-19 14:48           ` Tamas K Lengyel
2017-06-19 14:54             ` George Dunlap
2017-06-19 14:56               ` Tamas K Lengyel
2017-04-05 13:12 ` [PATCH 0/2] memory: XSA-212 follow-up 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=7d10322a-88c9-285a-0c75-3cf3424af753@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=jannh@google.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.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 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.