[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V6 08/10] xen: Add arch_domain_preinit to initialise vGIC before evtchn_init



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@xxxxxxxxx>
> > 
> > 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?

Cheers,

Baozi.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.