All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: andre.przywara@arm.com, sstabellini@kernel.org,
	shameerali.kolothum.thodi@huawei.com
Subject: Re: [PATCH 1/3] [not-for-unstable] xen/arm: vgic-v3: Delay the initialization of the domain information
Date: Wed, 5 Sep 2018 14:25:44 +0100	[thread overview]
Message-ID: <9f776054-6d29-9e42-fea1-e7e80430bd7e@arm.com> (raw)
In-Reply-To: <0da3032f-9257-4ee2-7cb5-cabe0d12bdcc@citrix.com>

Hi Andrew,

On 09/04/2018 08:53 PM, Andrew Cooper wrote:
> On 04/09/18 20:35, Julien Grall wrote:
>> Hi,
>>
>> On 09/04/2018 08:21 PM, Julien Grall wrote:
>>> A follow-up patch will require to know the number of vCPUs when
>>> initializating the vGICv3 domain structure. However this information is
>>> not available at domain creation. This is only known once
>>> XEN_DOMCTL_max_vpus is called for that domain.
>>>
>>> In order to get the max vCPUs around, delay the domain part of the vGIC
>>> v3 initialization until the first vCPU of the domain is initialized.
>>>
>>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>>>
>>> ---
>>>
>>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
>>>
>>> This is nasty but I can't find a better way for Xen 4.11 and older. This
>>> is not necessary for unstable as the number of vCPUs is known at domain
>>> creation.
>>>
>>> Andrew, I have CCed you to know whether you have a better idea where to
>>> place this call on Xen 4.11 and older.
>>
>> I just noticed that d->max_vcpus is initialized after
>> arch_domain_create. So without this patch on Xen 4.12, it will not work.
>>
>> This is getting nastier because arch_domain_init is the one initialize
>> the value returned by dom0_max_vcpus. So I am not entirely sure what
>> to do here.
> 
> The positioning after arch_domain_create() is unfortunate, but I
> couldn’t manage better with ARM's current behaviour and Jan's insistence
> that the allocation of d->vcpu was common.  I'd prefer if the dependency
> could be broken and the allocation moved earlier.
> 
> One option might be to have an arch_check_domainconfig() (or similar?)
> which is called very early on and can sanity check the values, including
> cross-checking the vgic and max_vcpus settings?  It could even be
> responsible for mutating XEN_DOMCTL_CONFIG_GIC_NATIVE into the correct
> real value.

I think it is doable without too much trouble on Arm. I can have a look 
at this for Xen 4.12 once this series is merged.

> 
> As for your patch here, its a gross hack, but its probably the best
> which can be done.  I have to admit that I'm surprised/concerned that
> Xen has lasted this long with such a fundamental gap in domain creation.

I am surprised too. Hopefully your rework will make everything easier to 
use.

Cheers,

-- 
Julien Grall

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

  reply	other threads:[~2018-09-05 13:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 19:21 [PATCH 0/3] xen/arm: vgic-v3: Bug fixes Julien Grall
2018-09-04 19:21 ` [PATCH 1/3] [not-for-unstable] xen/arm: vgic-v3: Delay the initialization of the domain information Julien Grall
2018-09-04 19:35   ` Julien Grall
2018-09-04 19:53     ` Andrew Cooper
2018-09-05 13:25       ` Julien Grall [this message]
2018-09-25 20:45       ` Stefano Stabellini
2018-09-26 20:14         ` Julien Grall
2018-09-27 23:11           ` Stefano Stabellini
2018-09-28 20:35             ` Julien Grall
2018-09-28 23:38               ` Andrew Cooper
2018-09-28 23:45                 ` Stefano Stabellini
2018-09-28 23:48                   ` Andrew Cooper
2018-10-01  9:43                     ` Julien Grall
2018-10-01  9:53                       ` Andrew Cooper
2018-10-01 11:31                         ` Julien Grall
2018-09-04 19:21 ` [PATCH 2/3] xen/arm: vgic-v3: Don't create empty re-distributor regions Julien Grall
2018-09-25 20:38   ` Stefano Stabellini
2018-09-26 20:36     ` Julien Grall
2018-09-27 23:34       ` Stefano Stabellini
2018-09-28 20:37         ` Julien Grall
2018-09-28 23:46           ` Stefano Stabellini
2018-09-04 19:21 ` [PATCH 3/3] xen/arm: vgic-v3-its: Make vgic_v3_its_free_domain idempotent Julien Grall
2018-09-25 20:08   ` Stefano Stabellini
2018-09-06 15:49 ` [PATCH 0/3] xen/arm: vgic-v3: Bug fixes Shameerali Kolothum Thodi

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=9f776054-6d29-9e42-fea1-e7e80430bd7e@arm.com \
    --to=julien.grall@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=sstabellini@kernel.org \
    --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.