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

Re: [PATCH v2 4/4] xen/pci: solve compilation error on ARM with HAS_PCI enabled.


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Fri, 6 Nov 2020 11:39:02 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IRDW/i0phvQTSU4Q6CHFQWkeO7MHwgx2OhI37mAXgyk=; b=drKT0EadZvRwaUzZ97Bkxa1nfMIChiT288O4ZvCRPwzHowNAbpgHTR77O4uzNAihC3aVCgjuVK2xvuusYLSGqVfgoFpPx+7qt6Fen2vlembsVJbZ50tPshRQVwWzHxWP9/bnlK5P6G7+HCU1VvnXp+4aVRL/tl3dxYYPkP9ot9WSarqVfS9U1flcLFcc56hCz/g0XCzecg/7D0DRBNnvfz+hxtWu3VE9z8bzgcxWsozKq/dM9dSn3ZDA9+JEA4jD2RWEQ8u98AqX9eMB5ARNqUJvJACi0sRkUf5P89D+NNaiUKNY7WAPE3SAPfzakYke4ly6UQ9V3eX1q68FDtoTGA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g9XmDt02WHGOtOyVzNcEXR6+f7QlsKNJxi59yT2FV52ZFUA0Gay2yh/APMEWa7yESAU86EVXmvhzgacPQzpqp6n/mXoPibi+0WADmQ79KVndJ7w/emLu0O7YF835XXcsFyucTjyC2WO6T89jcp/lh17gG0iLfnDsRz0LziHgHahXSL3BvuMrliF44yuWJ7RblDEtk3Ro1iu0FGG44iGVqpxMdKzqUCdQH/XCIAqCkbZXP5wit4GSe6jScsEq4MJa6mQ7pRI58Mgd69bxqfJTa8KO7A3kSnurZItYDl0ohXnVsFHbYMeCaTjGKAMvupdGirraLAsddDzuLh7tRcOgjA==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 06 Nov 2020 11:39:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWsfqN+EzmE5QdE0+RqIeW6dAkbKm62JSAgAAmToA=
  • Thread-topic: [PATCH v2 4/4] xen/pci: solve compilation error on ARM with HAS_PCI enabled.

Hello Jan,

> On 6 Nov 2020, at 9:21 am, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 03.11.2020 16:59, Rahul Singh wrote:
>> If mem-sharing, mem-paging and log-dirty functionality is not enabled
>> for architecture when HAS_PCI is enabled, compiler will throw an error.
> 
> Nit: Is it really "and", not "or”?

Ok yes I will fix in next version.
> 
>> @@ -1418,12 +1417,7 @@ static int assign_device(struct domain *d, u16 seg, 
>> u8 bus, u8 devfn, u32 flag)
>>     if ( !is_iommu_enabled(d) )
>>         return 0;
>> 
>> -    /* Prevent device assign if mem paging or mem sharing have been 
>> -     * enabled for this domain */
>> -    if ( d != dom_io &&
>> -         unlikely(mem_sharing_enabled(d) ||
>> -                  vm_event_check_ring(d->vm_event_paging) ||
>> -                  p2m_get_hostp2m(d)->global_logdirty) )
>> +    if( !arch_iommu_usable(d) )
>>         return -EXDEV;
> 
> While iirc I did suggest this name, seeing it used here leaves me
> somewhat unhappy with the name, albeit I also can't think of any
> better alternative right now. Maybe arch_iommu_use_permitted()?

Ok I will modify as per your suggestion.
> 
>> @@ -315,6 +316,18 @@ int iommu_update_ire_from_msi(
>>            ? iommu_call(&iommu_ops, update_ire_from_msi, msi_desc, msg) : 0;
>> }
>> 
>> +bool_t arch_iommu_usable(struct domain *d)
> 
> Just bool please and I very much hope the parameter can be const.

Ok I will fix in next version.
> 
>> +{
>> +
>> +    /* Prevent device assign if mem paging or mem sharing have been
>> +     * enabled for this domain */
> 
> Please correct comment style as you move it.

Ok. 
> 
>> +    if ( d != dom_io && unlikely(mem_sharing_enabled(d) ||
>> +                        vm_event_check_ring(d->vm_event_paging) ||
>> +                        p2m_get_hostp2m(d)->global_logdirty) )
> 
> You've screwed up indentation, and I don't see why ...

I will fix in next version.

> 
>> +        return false;
>> +    else
>> +        return true;
>> +}
> 
> ... this can't be a simple single return statement anyway:
> 
>    return d == dom_io ||
>           likely(!mem_sharing_enabled(d) &&
>                  !vm_event_check_ring(d->vm_event_paging) &&
>                  !p2m_get_hostp2m(d)->global_logdirty);
> 
> In the course of moving I'd also suggest dropping the use of
> likely() here: The way it's used (on an && expression) isn't
> normally having much effect anyway. If anything it should imo
> be
> 
>    return d == dom_io ||
>           (likely(!mem_sharing_enabled(d)) &&
>            likely(!vm_event_check_ring(d->vm_event_paging)) &&
>            likely(!p2m_get_hostp2m(d)->global_logdirty));
> 
> Any transformation to this effect wants mentioning in the
> description, though.

Ok I will modify as per your suggestion.
> 
> Jan

Regards,
Rahul


 


Rackspace

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