lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bb4aaa0e-f38a-9f6a-85a9-34be0a855741@redhat.com>
Date:   Thu, 2 Mar 2017 14:12:13 +0100
From:   Auger Eric <eric.auger@...hat.com>
To:     Mian Yousaf Kaukab <yousaf.kaukab@...e.com>,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        marc.zyngier@....com, alex.williamson@...hat.com
Cc:     will.deacon@....com
Subject: Re: [PATCH 1/2] irqdomain: add empty irq_domain_check_msi_remap

Hi Yousaf,

On 02/03/2017 13:23, Mian Yousaf Kaukab wrote:
> On 03/02/2017 11:24 AM, Auger Eric wrote:
>> Hi Mian Yousaf,
>>
>> On 02/03/2017 11:01, Mian Yousaf Kaukab wrote:
>>> Fix following build error for s390:
>>> drivers/vfio/vfio_iommu_type1.c: In function
>>> 'vfio_iommu_type1_attach_group':
>>> drivers/vfio/vfio_iommu_type1.c:1290:25: error: implicit declaration
>>> of function 'irq_domain_check_msi_remap'
>>>
>>> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@...e.com>
>>> ---
>>>   include/linux/irqdomain.h | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
>>> index 188eced6813e..137817b08cdc 100644
>>> --- a/include/linux/irqdomain.h
>>> +++ b/include/linux/irqdomain.h
>>> @@ -524,6 +524,10 @@ static inline struct irq_domain
>>> *irq_find_matching_fwnode(
>>>   {
>>>       return NULL;
>>>   }
>>> +static inline bool irq_domain_check_msi_remap(void)
>>> +{
>>> +    return true;
>> By default you should rather return false, reporting there is no MSI
>> remapping capability on irq domain side. Besides thank you for the fix.
> I choose to return true based on the function header comments of
> irq_domain_check_msi_remap. It says
> 
> "Return: false if any MSI irq domain does not support IRQ remapping,
> true otherwise (including if there is no MSI irq domain)"
> 
> So function should return true in case of no MSI irq domain. Have I miss
> understood this?
This behavior is indeed mandated on ARM - where MSI are translated by
the smmu - to allow safe device assignment if there is no MSI domain,
ie. in this situation there is no risk an assigned device writes into an
MSI doorbell.

As the function is not implemented at all in your case, personally I
would rather be defensive though and return false. You were not able to
check the capability.

Thanks

Eric
> 
> BR,
> Yousaf

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ