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

Re: [Xen-devel] [PATCH 3/4] VMX: Add posted interrupt supporting



>>> On 09.04.13 at 10:53, "Zhang, Yang Z" <yang.z.zhang@xxxxxxxxx> wrote:
> Zhang, Yang Z wrote on 2013-04-09:
>> Jan Beulich wrote on 2013-04-09:
>>>>>> On 09.04.13 at 08:01, Yang Zhang <yang.z.zhang@xxxxxxxxx> wrote:
>>>> +    {
>>>> +        val = pi_get_pir(&v->arch.hvm_vmx.pi_desc, group);
>>>> +        offset = APIC_IRR + 0x10 * group;
>>>> +        *((uint32_t *)(&vlapic->regs->data[offset])) |= val;
>>> 
>>> Can't you use vlapic_set_vector() here (even if that means
>>> looping over vectors individually rather than groups), to add the
>>> necessary atomicity (I don't see how you avoid races with other
>>> updates) and to avoid the ugly cast?
> Which races?

vlapic.c also updates the APIC_IRR bit array, and hence (unless
you can guarantee that now and forever such updates only
happen when the subject vCPU is current, which I don't think is
the case) your non-atomic read-modify-write operation here can
discard an update done in vlapic.c. And am I wrong in recalling
that the CPU may actually also on its own update that bit array?

Jan


_______________________________________________
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®.