All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Baozi <cbz@baozis.org>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Keir Fraser <keir@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Tim Deegan <tim@xen.org>, Julien Grall <julien.grall@citrix.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH V6 08/10] xen: Add arch_domain_preinit to initialise vGIC before evtchn_init
Date: Thu, 11 Jun 2015 19:16:20 +0800	[thread overview]
Message-ID: <20150611111620.GA18855@cbz-thinkpad> (raw)
In-Reply-To: <1434015425.30003.134.camel@citrix.com>

On Thu, Jun 11, 2015 at 10:37:05AM +0100, Ian Campbell wrote:
> On Thu, 2015-06-11 at 17:20 +0800, Chen Baozi wrote:
> > On Fri, Jun 05, 2015 at 05:22:56PM +0100, Ian Campbell wrote:
> > > On Mon, 2015-06-01 at 20:56 +0800, Chen Baozi wrote:
> > > > From: Chen Baozi <baozich@gmail.com>
> > > > 
> > > > evtchn_init will call domain_max_vcpus to allocate poll_mask. On
> > > > arm/arm64 platform, this number is determined by the vGIC the guest
> > > > is going to use, which won't be initialised until arch_domain_create
> > > > is called in current implementation. However, moving arch_domain_create
> > > > means that we will allocate memory before checking the XSM policy,
> > > > which seems not to be acceptable because if the domain is not allowed
> > > > to boot by XSM policy the expensive execution of arch_domain_create
> > > > is wasteful. Thus, we create the arch_domain_preinit to make vgic_ops
> > > > initialisation be done earlier.
> > > 
> > > I don't have a fundamental objection to this refactoring, but I'm
> > > curious under what circumstances something would belong in preinit
> > > rather than create, i.e. what is the expected semantics of this new hook
> > > vs the old one.
> > 
> > Hmmm, I didn't think about it at this level, :P. Instead, I just brought
> > the code which must be executed before evtchn_init in advance without
> > further consideration on semantics etc...
> > 
> > In fact, the current arch_domain_preinit on arm is all about vgic. I
> > was about to use the name vgic_preinit, but that would be an arm-specific
> > name which I thought was not suitable to add in the common codes...
> > 
> > Or will it be clearer to call a subfunction called vgic_preinit in the
> > arch_domain_preinit (for arm) and put the current main contents of
> > arch_domain_preinit to vgic_preinit?
> 
> The main question which needs answering is: given some new bit of
> functionality which needs initialising when should it be done in preinit
> and when should it be in init?
> 

The resource that would be used (either directly or indirectly) by
xsm_domain_create, evtchn_init or grant_table_create, should be initialised
in preinit? otherwise, it should be put into init?

I am not sure, for it doesn't look like a(n) good/exact semantic
definition...

Cheers,

Baozi.

  reply	other threads:[~2015-06-11 11:16 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 12:56 [PATCH V6 00/10] Support more than 8 vcpus on arm64 with GICv3 Chen Baozi
2015-06-01 12:56 ` [PATCH V6 01/10] xen/arm: gic-v3: Increase the size of GICR in address space for guest Chen Baozi
2015-06-05 15:49   ` Ian Campbell
2015-06-05 16:04     ` Julien Grall
2015-06-05 16:31       ` Ian Campbell
2015-06-05 18:07         ` Julien Grall
2015-06-01 12:56 ` [PATCH V6 02/10] xen/arm: Add functions of mapping between vCPUID and virtual affinity Chen Baozi
2015-06-05 15:54   ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 03/10] xen/arm: Use the new functions for vCPUID/vaffinity transformation Chen Baozi
2015-06-05 15:56   ` Ian Campbell
2015-06-05 18:18     ` Julien Grall
2015-06-08 10:05       ` Ian Campbell
2015-06-08 13:00         ` Julien Grall
2015-06-01 12:56 ` [PATCH V6 04/10] xen/arm: Use cpumask_t type for vcpu_mask in vgic_to_sgi Chen Baozi
2015-06-05 16:05   ` Ian Campbell
2015-06-10 10:21     ` Chen Baozi
2015-06-10 10:27       ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 05/10] xen/arm64: gicv3: Use AFF1 when translating ICC_SGI1R_EL1 to cpumask Chen Baozi
2015-06-05 16:09   ` Ian Campbell
2015-06-05 18:25     ` Julien Grall
2015-06-08 10:06       ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 06/10] tools/libxl: Set 'reg' of cpu node equal to MPIDR affinity for domU Chen Baozi
2015-06-05 16:11   ` Ian Campbell
2015-06-05 16:12   ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 07/10] xen/arm: Set 'reg' of cpu node for dom0 to match MPIDR's affinity Chen Baozi
2015-06-05 16:13   ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 08/10] xen: Add arch_domain_preinit to initialise vGIC before evtchn_init Chen Baozi
2015-06-05 16:22   ` Ian Campbell
2015-06-11  9:20     ` Chen Baozi
2015-06-11  9:37       ` Ian Campbell
2015-06-11 11:16         ` Chen Baozi [this message]
2015-06-11 11:47           ` Julien Grall
2015-06-11 12:45             ` Chen Baozi
2015-06-01 12:56 ` [PATCH V6 09/10] xen/arm: make domain_max_vcpus return value from vgic_ops Chen Baozi
2015-06-05 16:26   ` Ian Campbell
2015-06-05 16:39     ` Julien Grall
2015-06-01 12:56 ` [PATCH V6 10/10] xen/arm64: increase MAX_VIRT_CPUS to 128 on arm64 Chen Baozi
2015-06-05 16:27   ` Ian Campbell
2015-06-05 14:08 ` [PATCH V6 00/10] Support more than 8 vcpus on arm64 with GICv3 Ian Campbell
2015-06-05 14:37   ` Julien Grall
2015-06-05 15:15     ` Ian Campbell
2015-06-05 14:23 ` 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=20150611111620.GA18855@cbz-thinkpad \
    --to=cbz@baozis.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.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.