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

Re: [Xen-devel] [V8 PATCH 7/8] pvh dom0: add check for pvh in vioapic_range



>>> On 01.04.14 at 16:40, <george.dunlap@xxxxxxxxxxxxx> wrote:
> On 03/24/2014 09:34 AM, Jan Beulich wrote:
>>>>> On 22.03.14 at 02:39, <mukesh.rathor@xxxxxxxxxx> wrote:
>>> --- a/xen/arch/x86/hvm/vioapic.c
>>> +++ b/xen/arch/x86/hvm/vioapic.c
>>> @@ -238,8 +238,13 @@ static int vioapic_write(
>>>
>>>   static int vioapic_range(struct vcpu *v, unsigned long addr)
>>>   {
>>> -    struct hvm_hw_vioapic *vioapic = domain_vioapic(v->domain);
>>> +    struct hvm_hw_vioapic *vioapic;
>>> +
>>> +    /* pvh uses event channel callback */
>>> +    if ( is_pvh_vcpu(v) )
>>> +        return 0;
>>>
>>> +    vioapic = domain_vioapic(v->domain);
>>
>> I can see why the extra check is needed, but I can't see why you
>> convert the initializer to an assignment: Afaict domain_vioapic() is
>> safe even if d->arch.hvm_domain.vioapic == NULL.
> 
> Or better yet, just make it something like:
> 
> return vioapic && ((addr >= [...original range check]))
> 
> That way we don't have to have a PVH-specific hook at all.  If a domain 
> doesn't have a vioapic for any reason, return 0.

No, vioapic isn't going to be NULL for PVH:

#define domain_vioapic(d) (&(d)->arch.hvm_domain.vioapic->hvm_hw_vioapic)

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