|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen: arm: improve VMID allocation.
On Wed, 2013-09-11 at 13:44 +0100, Julien Grall wrote:
> > +
> > +void p2m_vmid_allocator_init(void)
> > +{
> > + /* VMID 0 is reserved */
> > + set_bit(0, vmid_mask);
> > +}
> > +
> > +/* p2m_alloc|free_vmid must both be called with the p2m->lock */
>
> Taking p2m->lock is not enough, this function can be called concurrently
> if the 2 domains are created at the same time.
> In this case, it's possible to have the same vmid for 2 domains.
> How about a global lock?
Brain fart, I forgot this lock was per p2m.
The domain lock is probably OK to use here, in fact we may already hold
it. I'll fix this.
> > @@ -318,25 +359,33 @@ void p2m_teardown(struct domain *d)
> >
> > p2m->first_level = NULL;
> >
> > + p2m_free_vmid(d);
> > +
>
> p2m_teardown is called when the domain is destroyed. If the vmid was not
> correctly set (for instance because VMID pool exhausted), we will clear
> the wrong bit (here 0).
> At the next domain creation, we will assert because nr = 0.
Oops! Will fix.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |