All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Julien Grall <julien.grall@linaro.org>,
	Xen-devel <xen-devel@lists.xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH] tools/libxc: Don't leave scratch_pfn uninitialised if the domain has no memory
Date: Fri, 30 Jan 2015 00:17:07 +0000	[thread overview]
Message-ID: <54CACD83.80700@citrix.com> (raw)
In-Reply-To: <54CA7D88.5050702@linaro.org>

On 29/01/2015 18:35, Julien Grall wrote:
> Hi Andrew,
>
> On 28/01/15 15:52, Andrew Cooper wrote:
>> c/s 5b5c40c0d1 "libxc: introduce a per architecture scratch pfn for temporary
>> grant mapping" accidentally an issue whereby there were two paths out of
>> xc_core_arch_get_scratch_gpfn() which returned 0, but only one of which
>> assigned a value to the gpfn parameter.
>> xc_domain_maximum_gpfn() can validly return 0, at which point gpfn 1 is a
>> valid scratch page to use.
> The original version was considering rc = 0 as an error. Should not we
> keep the same behavior?
>
> Regards,

The difference between this code and the original is that the original
returned two bits of information in its return value, whereas this has
return value and a parameter it fills in.

Independent of whether 0 should be a success or failure, the existing
caller used 0 as a success case and used an uninitialised piece of stack
as a scratch pfn.

As stated in the commit message, I believe that if 0 is the max memory
so far, 1 is a valid scratch pfn to use, making 0 from the hypercall a
valid success case.

~Andrew

  reply	other threads:[~2015-01-30  0:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 13:25 [PATCH v2] libxc: introduce a per architecture scratch pfn for temporary grant mapping Julien Grall
2015-01-21 16:42 ` Andrew Cooper
2015-01-27 17:18   ` Ian Campbell
2015-01-27 18:22     ` Ian Jackson
2015-02-16 14:49       ` Ian Jackson
2015-01-28 15:52         ` [PATCH] tools/libxc: Don't leave scratch_pfn uninitialised if the domain has no memory Andrew Cooper
2015-01-29 18:35           ` Julien Grall
2015-01-30  0:17             ` Andrew Cooper [this message]
2015-02-02 15:26           ` Ian Campbell
2015-02-16 14:57         ` [PATCH v2] libxc: introduce a per architecture scratch pfn for temporary grant mapping Andrew Cooper
2015-03-03 17:41           ` [PATCH] tools/libxc: Don't leave scratch_pfn uninitialised if the domain has no memory [and 3 more messages] Ian Jackson

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=54CACD83.80700@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=julien.grall@linaro.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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.