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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e45414d-9463-164e-d57d-4065f8195ee7@redhat.com>
Date:   Thu, 2 Mar 2017 14:46:15 +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 2/2] vfio: type1: conditionally check MSI remapping at irq
 domain level

Hi,

On 02/03/2017 13:38, Mian Yousaf Kaukab wrote:
> On 03/02/2017 11:24 AM, Auger Eric wrote:
>> Hi,
>>
>> On 02/03/2017 11:01, Mian Yousaf Kaukab wrote:
>>> Check only if irq domains are available.
>>>
>>> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@...e.com>
>>> ---
>>>   drivers/vfio/vfio_iommu_type1.c | 5 +++--
>>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/vfio/vfio_iommu_type1.c
>>> b/drivers/vfio/vfio_iommu_type1.c
>>> index bd6f293c4ebd..e3ed50e40ead 100644
>>> --- a/drivers/vfio/vfio_iommu_type1.c
>>> +++ b/drivers/vfio/vfio_iommu_type1.c
>>> @@ -1287,8 +1287,9 @@ static int vfio_iommu_type1_attach_group(void
>>> *iommu_data,
>>>       INIT_LIST_HEAD(&domain->group_list);
>>>       list_add(&group->next, &domain->group_list);
>>>   -    msi_remap = resv_msi ? irq_domain_check_msi_remap() :
>>> -                iommu_capable(bus, IOMMU_CAP_INTR_REMAP);
>>> +    msi_remap = resv_msi && IS_ENABLED(CONFIG_IRQ_DOMAIN) ?
>>> +            irq_domain_check_msi_remap() :
>>> +            iommu_capable(bus, IOMMU_CAP_INTR_REMAP);
>> Is that patch actually needed after [PATCH 1/2] irqdomain: add empty
>> irq_domain_check_msi_remap. irq_domain_check_msi_remap() should be
>> defined and if you follow my suggestion, would return false. Anyway in
>> your case resv_msi should be false.
> I agree its an overkill if resv_msi is guaranteed to be false. What I am
> unsure about is that, if iommu have IOMMU_RESV_MSI regions that would
> mean that irq domains are selected in the build. If this is not
> guaranteed, then we need to add this check.

Currently only ARM SMMUs advertise IOMMU_RESV_MSI regions. If attempting
to do passthrough on an ARM platform not implementing IRQ_DOMAIN the
unsafe IRQ assignment mode would need to be chosen (if
irq_domain_check_msi_remap() returns false as discussed before). Anyway
checking the  interrupt remapping capability on IOMMU side would report
false as well since the capability is not exposed by ARM SMMU anymore.

Thanks

Eric
> 
>>
>> Thanks
>>
>> Eric
> 
> BR,
> Yousaf

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ