From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: tim@xen.org, sstabellini@kernel.org, wei.liu2@citrix.com,
George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
ian.jackson@eu.citrix.com, xen-devel@lists.xen.org,
julien.grall@arm.com, dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v5 6/8] xen: add new domctl hypercall to set grant table resource limits
Date: Mon, 11 Sep 2017 13:31:34 +0200 [thread overview]
Message-ID: <ccb831fc-7baa-35f5-39fe-af9ab5d99f56@suse.com> (raw)
In-Reply-To: <59B68C4902000078001798F9@suse.com>
On 11/09/17 13:14, Jan Beulich wrote:
>>>> On 11.09.17 at 12:48, <jgross@suse.com> wrote:
>> On 08/09/17 17:55, Jan Beulich wrote:
>>>>>> On 08.09.17 at 08:56, <jgross@suse.com> wrote:
>>>> --- a/xen/common/grant_table.c
>>>> +++ b/xen/common/grant_table.c
>>>> @@ -3667,6 +3667,32 @@ void grant_table_init_vcpu(struct vcpu *v)
>>>> v->maptrack_tail = MAPTRACK_TAIL;
>>>> }
>>>>
>>>> +int grant_table_set_limits(struct domain *d, unsigned int grant_frames,
>>>> + unsigned int maptrack_frames)
>>>> +{
>>>> + struct grant_table *gt = d->grant_table;
>>>> + int ret = -EBUSY;
>>>> +
>>>> + if ( !gt )
>>>> + return -EEXIST;
>>>
>>> How does EEXIST represent the error condition?
>>
>> Yes, this was a bad choice. What about ENOENT?
>
> Fine with me. Or ENODEV.
>
>>>> + ret = 0;
>>>> + if ( grant_frames )
>>>> + gt->max_grant_frames = grant_frames;
>>>> + if ( maptrack_frames )
>>>> + gt->max_maptrack_frames = maptrack_frames;
>>>
>>> Together with what I have said regarding making the invocation
>>> of this domctl mandatory, I think these two shouldn't be conditional.
>>> In particular for maptrack I also don't see why a domain couldn't
>>> do with a limit of zero, as long as it's not serving as a backend for
>>> another guest.
>>
>> Okay, then I'd need to specify a "take hypervisor default" value (e.g.
>> ~0) in order to handle the case where no value was specified in the
>> domain's config file.
>
> Well, part of the point I was trying to make in earlier replies on
> other patches of this series is that I think the lack of a guest
> config file setting should not invoke a _hypervisor_ default.
> Instead, the tool stack should establish a sensible one.
Okay, I can add this to the series.
>
>> The question would be then: do we want to set maptrack to 0 as default
>> and require it to be specified for backend domains (driver domains,
>> stubdoms)?
>
> I think so, yes. Question is whether there's a way for the tool stack
> to easily recognize a driver domain when it's being created.
I could think of various mechanisms for driver domains:
1. Add an explicit config item (I guess this could be utilized for other
cases like XSM, too).
2. Do some guess work, e.g. any domain with PCI-passthrough configured
could be regarded as a potential driver domain.
3. Just require the max_maptrack_frames= config item.
Starting with 3. is the easiest solution for now, it can be switched to
1. or 2. later.
Juergen
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-09-11 11:31 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-08 6:56 [PATCH v5 0/8] xen: better grant v2 support Juergen Gross
2017-09-08 6:56 ` [PATCH v5 1/8] xen: move XENMAPSPACE_grant_table code into grant_table.c Juergen Gross
2017-09-08 14:49 ` Jan Beulich
[not found] ` <59B2C9FF0200007800178E24@suse.com>
2017-09-08 15:14 ` Juergen Gross
2017-09-11 11:41 ` George Dunlap
2017-09-08 6:56 ` [PATCH v5 2/8] xen: clean up grant_table.h Juergen Gross
2017-09-08 15:00 ` Jan Beulich
[not found] ` <59B2CC990200007800178E3C@suse.com>
2017-09-11 8:22 ` Juergen Gross
2017-09-08 6:56 ` [PATCH v5 3/8] xen: delay allocation of grant table sub structures Juergen Gross
2017-09-08 15:28 ` Jan Beulich
[not found] ` <59B2D34F0200007800178EBC@suse.com>
2017-09-11 9:03 ` Juergen Gross
2017-09-11 9:23 ` Jan Beulich
[not found] ` <59B6722B0200007800179767@suse.com>
2017-09-11 9:39 ` Juergen Gross
2017-09-11 11:02 ` Jan Beulich
[not found] ` <59B6896302000078001798B7@suse.com>
2017-09-11 11:36 ` Juergen Gross
2017-09-08 6:56 ` [PATCH v5 4/8] xen: make grant resource limits per domain Juergen Gross
2017-09-08 15:44 ` Jan Beulich
[not found] ` <59B2D7180200007800178ED3@suse.com>
2017-09-11 10:40 ` Juergen Gross
2017-09-11 11:07 ` Jan Beulich
2017-09-08 6:56 ` [PATCH v5 5/8] xen: double default grant frame limit for huge hosts Juergen Gross
2017-09-08 15:48 ` Jan Beulich
[not found] ` <59B2D8050200007800178ED6@suse.com>
2017-09-11 10:41 ` Juergen Gross
2017-09-08 6:56 ` [PATCH v5 6/8] xen: add new domctl hypercall to set grant table resource limits Juergen Gross
2017-09-08 15:55 ` Jan Beulich
[not found] ` <59B2D98F0200007800178F19@suse.com>
2017-09-11 10:48 ` Juergen Gross
2017-09-11 11:14 ` Jan Beulich
[not found] ` <59B68C4902000078001798F9@suse.com>
2017-09-11 11:31 ` Juergen Gross [this message]
2017-09-08 6:56 ` [PATCH v5 7/8] libxc: add libxc support for setting " Juergen Gross
2017-09-08 6:56 ` [PATCH v5 8/8] libxl: add libxl " Juergen Gross
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=ccb831fc-7baa-35f5-39fe-af9ab5d99f56@suse.com \
--to=jgross@suse.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=ian.jackson@eu.citrix.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.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 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).