From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
Julien Grall <julien.grall@arm.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH for-4.10 5/5] tools/dombuilder: Prevent failures of xc_dom_gnttab_init()
Date: Fri, 6 Oct 2017 19:04:49 +0100 [thread overview]
Message-ID: <c0d1d957-8210-bad6-6b0c-c56e7b536b3f@citrix.com> (raw)
In-Reply-To: <20171006103057.idexllm76cmtthoo@MacBook-Pro-de-Roger.local>
On 06/10/17 11:30, Roger Pau Monné wrote:
> On Thu, Oct 05, 2017 at 06:23:44PM +0000, Andrew Cooper wrote:
>> Recent changes in grant table configuration have caused calls to
>> xc_dom_gnttab_init() to fail if not proceeded with a call to
>> xc_domain_set_gnttab_limits(). This is backwards from the point of view of
>> 3rd party dombuilder users.
>>
>> Add max_{grant,maptrack}_frames parameters to struct xc_dom_image, and require
>> them to be set by callers using xc_dom_gnttab_init(). Libxl, which uses
>> xc_dom_gnttab_init() itself is updated appropriately.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
>
> Some nits with can be fixed while committing IMHO if required.
>
>> ---
>> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
>> CC: Wei Liu <wei.liu2@citrix.com>
>> CC: Julien Grall <julien.grall@arm.com>
>> ---
>> tools/libxc/include/xc_dom.h | 4 ++++
>> tools/libxc/xc_dom_boot.c | 14 ++++++++++++++
>> tools/libxc/xc_dom_core.c | 3 +++
>> tools/libxl/libxl_dom.c | 12 ++++++------
>> 4 files changed, 27 insertions(+), 6 deletions(-)
>>
>> diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
>> index 790869b..8e673fb 100644
>> --- a/tools/libxc/include/xc_dom.h
>> +++ b/tools/libxc/include/xc_dom.h
>> @@ -116,6 +116,10 @@ struct xc_dom_image {
>> domid_t console_domid;
>> domid_t xenstore_domid;
>>
>> + /* Grant limit configuration; mandatory if calling xc_dom_gnttab_init(). */
>> + unsigned int max_grant_frames;
>> + unsigned int max_maptrack_frames;
>> +
>> /*
>> * initrd parameters as specified in start_info page
>> * Depending on capabilities of the booted kernel this may be a virtual
>> diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c
>> index 8d4fefa..7cb9e40 100644
>> --- a/tools/libxc/xc_dom_boot.c
>> +++ b/tools/libxc/xc_dom_boot.c
>> @@ -419,6 +419,20 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,
>>
>> int xc_dom_gnttab_init(struct xc_dom_image *dom)
>> {
>> + int rc;
>> +
>> + if ( dom->max_grant_frames == -1 || dom->max_maptrack_frames == -1 )
> Not sure if compilers will complain about comparing an unsigned type
> against a signed one. Maybe better to use ~0u?
The conversion of -1 to unsigned int is well defined. I think this is
fine as is. Wei, as maintainer, whats your say?
>
>> + {
>> + xc_dom_panic(dom->xch, XC_INVALID_PARAM,
>> + "%s: Caller didn't set grant limit information", __func__);
> errno = EINVAL;
Done.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-10-06 18:04 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 18:23 [PATCH for-4.10 0/5] tools/dombuilder: Fixes and improvements to grant handling Andrew Cooper
2017-10-05 18:23 ` [PATCH for-4.10 1/5] tools/dombuilder: Drop more PVH v1 leftovers Andrew Cooper
2017-10-06 9:26 ` Roger Pau Monné
2017-10-06 9:33 ` Wei Liu
2017-10-06 9:40 ` Roger Pau Monné
2017-10-06 10:06 ` Wei Liu
2017-10-06 9:33 ` Wei Liu
2017-10-05 18:23 ` [PATCH for-4.10 2/5] tools/dombuilder: Remove clear_page() from xc_dom_boot.c Andrew Cooper
2017-10-06 9:35 ` Roger Pau Monné
2017-10-06 9:51 ` Andrew Cooper
2017-10-06 17:28 ` Wei Liu
2017-10-05 18:23 ` [PATCH for-4.10 3/5] tools/dombuilder: Switch to using gfn terminology for console and xenstore rings Andrew Cooper
2017-10-06 9:57 ` Roger Pau Monné
2017-10-06 10:03 ` Andrew Cooper
2017-10-06 10:36 ` Roger Pau Monné
2017-10-06 14:48 ` Julien Grall
2017-10-06 17:35 ` Roger Pau Monné
2017-10-06 17:34 ` Wei Liu
2017-10-05 18:23 ` [PATCH for-4.10 4/5] tools/dombuilder: Fix asymetry when setting up " Andrew Cooper
2017-10-06 17:36 ` Wei Liu
2017-10-05 18:23 ` [PATCH for-4.10 4/5] tools/dombuilder: Fix asymmetry " Andrew Cooper
2017-10-06 10:17 ` Roger Pau Monné
2017-10-06 10:27 ` Andrew Cooper
2017-10-05 18:23 ` [PATCH for-4.10 5/5] tools/dombuilder: Prevent failures of xc_dom_gnttab_init() Andrew Cooper
2017-10-06 10:30 ` Roger Pau Monné
2017-10-06 18:04 ` Andrew Cooper [this message]
2017-10-09 15:33 ` Wei Liu
2017-10-06 17:39 ` Wei Liu
2017-10-06 18:22 ` Andrew Cooper
2017-10-09 11:03 ` [PATCH for-4.10 0/5] tools/dombuilder: Fixes and improvements to grant handling 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=c0d1d957-8210-bad6-6b0c-c56e7b536b3f@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=julien.grall@arm.com \
--cc=roger.pau@citrix.com \
--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 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).