All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com,
	Ian Campbell <ian.campbell@citrix.com>
Subject: Re: REGRESSION [PATCH v2 08/13] libxc: Check xc_domain_maximum_gpfn for negative return values
Date: Fri, 27 Mar 2015 21:17:11 +0000	[thread overview]
Message-ID: <5515C8D7.6060304@citrix.com> (raw)
In-Reply-To: <20150327204146.GB27867@l.oracle.com>

On 27/03/15 20:41, Konrad Rzeszutek Wilk wrote:
> On Fri, Mar 27, 2015 at 08:04:44PM +0000, Andrew Cooper wrote:
>> On 27/03/15 19:42, Konrad Rzeszutek Wilk wrote:
>>> On Thu, Mar 26, 2015 at 09:07:05PM +0000, Andrew Cooper wrote:
>>>> On 20/03/15 17:03, Ian Campbell wrote:
>>>>> On Fri, 2015-03-20 at 11:45 -0400, Konrad Rzeszutek Wilk wrote:
>>>>>> From 45bd7cd377b0b8364757cc2bc0bd8d6a13523a97 Mon Sep 17 00:00:00 2001
>>>>>> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>>>>> Date: Fri, 13 Mar 2015 14:57:44 -0400
>>>>>> Subject: [PATCH] libxc: Check xc_domain_maximum_gpfn for negative return
>>>>>>  values
>>>>>>
>>>>>> Instead of assuming everything is always OK. We stash
>>>>>> the gpfns value as an parameter. Since we use it in three
>>>>>> of places we might as well update xc_domain_maximum_gpfn
>>>>>> to do the right thing.
>>>>>>
>>>>>> Suggested-by: Ian Campbell <ian.campbell@citrix.com>
>>>>>> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>>>> Acked + applied along with the rest of the series, thanks,
>>>> This change as unfortunately causes a regression in migration v2, because
>>>> the fenceposting has changed and the function no longer returns the maximum
>>>> gpfn.  It returns one past the maximum gpfn.
>>>>
>>>> It would appear that migration v2 was the only consumer which actually want
>>>> the max gpfn.
>>>>
>>>> Can we either rename the function to accurately name the value it returns
>>>> (although I am out of ideas as to what this might be), or undo the
>>>> fenceposting change so that it continues to return the value it claims to
>>>> return.
>>> This should do it? (I didn't fix the ';' issue in here).
>>>
>>> From a7206930f867025234966c7b784bead9b174930b Mon Sep 17 00:00:00 2001
>>> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>> Date: Fri, 27 Mar 2015 15:36:02 -0400
>>> Subject: [PATCH] libxc: Re-institute the old xc_maximum_ram_page and add
>>>  xc_maximum_gpfn
>>>
>>> The commit 1781f00ea62edb72bed4fe1b6959eeed427e988f
>>> "libxc: Check xc_maximum_ram_page for negative return values."
>>> broke migrationv2 (out of tree) as it wanted the raw
>>> value instead of the +1 manipulation the rest of the callers do.
>>>
>>> As such we resurrect xc_maximum_ram_page and rename the
>>> version that was added in the above mention commit to
>>> xc_maximum_gpfn.
>>>
>>> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> It is not xc_maximum_ram_page() which was the problem.  It is
>> xc_domain_maximum_gpfn() which had its fenceposting changed.
>>
>> The new xc_maximum_ram_page() is fine, and really does want to keep its
>> new API.  xc_domain_maximum_gpfn() is also fine keeping its new API, but
>> wants to not adjust max_pfn by 1.
>>
> <blushes>
>
> From dbca252c1ad53a83ec5cf0a0d5aa62ca711bd0c0 Mon Sep 17 00:00:00 2001
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Date: Fri, 27 Mar 2015 16:36:36 -0400
> Subject: [PATCH] libxc: Re-institute the old xc_domain_maximum_gpfn and add
>  xc_domain_nr_gpfns
>
> The commit a8f8a590e02d2d2b717257c0bd9a8b396103bdf4
> "libxc: Check xc_domain_maximum_gpfn for negative return values"
> broke migrationv2 (out of tree) as it wanted the raw value instead
> of the +1 value.
>
> Resurrect the old xc_domain_maximum_gpfn and rename the new
> xc_domain_maximum_gpfn to xc_domain_nr_gpfns.
>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
>  tools/libxc/include/xenctrl.h | 4 +++-
>  tools/libxc/xc_core_arm.c     | 2 +-
>  tools/libxc/xc_core_x86.c     | 6 +++---
>  tools/libxc/xc_domain.c       | 6 +++++-
>  tools/libxc/xc_domain_save.c  | 2 +-
>  5 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index 4e9537e..5d7d653 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -1315,7 +1315,9 @@ int xc_domain_get_tsc_info(xc_interface *xch,
>  
>  int xc_domain_disable_migrate(xc_interface *xch, uint32_t domid);
>  
> -int xc_domain_maximum_gpfn(xc_interface *xch, domid_t domid, xen_pfn_t *gpfns);
> +int xc_domain_maximum_gpfn(xc_interface *xch, domid_t domid);

It is perfectly fine for xc_domain_maximum_gpfn() to keep its *gpfn
pointer, as this is a rather more sane interface which doesn't truncate
the hypervisor long in a 64bit toolstack.

~Andrew

  reply	other threads:[~2015-03-27 21:17 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  0:24 [PATCH v2] Fix libxc return -E misusage Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 01/13] libxc: Replaces tabs with spaces in xc_cpupool_freeinfo Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 02/13] libxc: Propagate errno from hypercall instead of anything else Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 03/13] libxc: Fix xc_domain_get_tsc_info to return -1 instead of -Exx Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 04/13] libxc: xc_physdev_map return -1 and populate errno Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 05/13] libxc: Return negative value and propagate errno for xc_offline_page API Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 06/13] libxc: Fix xc_pm API calls to return negative error and stash error in errno Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 07/13] libxc: Fix xc_tmem_control to return proper error Konrad Rzeszutek Wilk
2015-03-19 16:39   ` Ian Campbell
2015-03-19 18:52     ` Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 08/13] libxc: Check xc_domain_maximum_gpfn for negative return values Konrad Rzeszutek Wilk
2015-03-19 16:47   ` Ian Campbell
2015-03-19 18:54     ` Konrad Rzeszutek Wilk
2015-03-20  9:48       ` Ian Campbell
2015-03-20 14:34         ` Konrad Rzeszutek Wilk
2015-03-20 14:49           ` Konrad Rzeszutek Wilk
2015-03-20 15:00             ` Ian Campbell
2015-03-20 15:45               ` Konrad Rzeszutek Wilk
2015-03-20 17:03                 ` Ian Campbell
2015-03-26 21:07                   ` REGRESSION " Andrew Cooper
2015-03-27 10:52                     ` Ian Campbell
2015-03-27 14:14                       ` Konrad Rzeszutek Wilk
2015-03-27 19:42                     ` Konrad Rzeszutek Wilk
2015-03-27 20:04                       ` Andrew Cooper
2015-03-27 20:41                         ` Konrad Rzeszutek Wilk
2015-03-27 21:17                           ` Andrew Cooper [this message]
2015-03-30  8:49                             ` Ian Campbell
2015-03-19 20:04     ` Konrad Rzeszutek Wilk
2015-03-20  0:18       ` Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 09/13] libxc: Check xc_maximum_ram_page " Konrad Rzeszutek Wilk
2015-03-19 16:49   ` Ian Campbell
2015-03-19  0:24 ` [PATCH v2 10/13] libxc: If xc_domain_add_to_physmap fails, include errno value Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 11/13] libxc: Check xc_sharing_* for proper return values Konrad Rzeszutek Wilk
2015-03-19 16:50   ` Ian Campbell
2015-03-19  0:24 ` [PATCH v2 12/13] libxl: Don't assign return value to errno for E820 get/set xc_ calls Konrad Rzeszutek Wilk
2015-03-19  0:24 ` [PATCH v2 13/13] libxc: Fix do_memory_op to return negative value on errors Konrad Rzeszutek Wilk
2015-03-19 16:51   ` Ian Campbell

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=5515C8D7.6060304@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=konrad.wilk@oracle.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.