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]
Date:   Thu, 7 Jul 2022 15:58:38 +0100
From:   Robin Murphy <robin.murphy@....com>
To:     Matthew Rosato <mjrosato@...ux.ibm.com>, joro@...tes.org
Cc:     will@...nel.org, iommu@...ts.linux.dev,
        linux-arm-kernel@...ts.infradead.org, baolu.lu@...ux.intel.com,
        suravee.suthikulpanit@....com, vasant.hegde@....com,
        gerald.schaefer@...ux.ibm.com, schnelle@...ux.ibm.com,
        linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 15/15] iommu: Clean up bus_set_iommu()

On 2022-07-07 13:54, Matthew Rosato wrote:
> On 7/7/22 8:49 AM, Matthew Rosato wrote:
>> On 7/5/22 1:08 PM, Robin Murphy wrote:
>>> Clean up the remaining trivial bus_set_iommu() callsites along
>>> with the implementation. Now drivers only have to know and care
>>> about iommu_device instances, phew!
>>>
>>> Signed-off-by: Robin Murphy <robin.murphy@....com>
>>> ---
>>>
>>> v3: Also catch Intel's cheeky open-coded assignment
>>>
>>
>> ...
>>
>>> diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c
>>> index c898bcbbce11..dd957145fb81 100644
>>> --- a/drivers/iommu/s390-iommu.c
>>> +++ b/drivers/iommu/s390-iommu.c
>>> @@ -385,9 +385,3 @@ static const struct iommu_ops s390_iommu_ops = {
>>>           .free        = s390_domain_free,
>>>       }
>>>   };
>>> -
>>> -static int __init s390_iommu_init(void)
>>> -{
>>> -    return bus_set_iommu(&pci_bus_type, &s390_iommu_ops);
>>> -}
>>> -subsys_initcall(s390_iommu_init);
>>
>> Previously s390_iommu_ops was only being set for pci_bus_type, but 
>> with this series it will now also be set for platform_bus_type.

Ah, indeed I hadn't got as far as fully appreciating that to_zpci_dev() 
isn't robust enough on its own. Thanks for the patch, I've pulled it in 
and will include it in v4. Do I take it that all else works OK with this 
fixed?

Cheers,
Robin.

>>
>> To tolerate that, this series needs a change along the lines of:
>>
> 
> ...  Sorry, let's try that again without a mangled diff:
> 
> From: Matthew Rosato <mjrosato@...ux.ibm.com>
> Date: Thu, 7 Jul 2022 08:45:44 -0400
> Subject: [PATCH] iommu/s390: fail probe for non-pci device
> 
> 
> s390-iommu only supports pci_bus_type today
> 
> 
> Signed-off-by: Matthew Rosato <mjrosato@...ux.ibm.com>
> ---
>   drivers/iommu/s390-iommu.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/drivers/iommu/s390-iommu.c b/drivers/iommu/s390-iommu.c
> index dd957145fb81..762f892b4ec3 100644
> --- a/drivers/iommu/s390-iommu.c
> +++ b/drivers/iommu/s390-iommu.c
> @@ -185,7 +185,12 @@ static void s390_iommu_detach_device(struct 
> iommu_domain *domain,
> 
> 
>   static struct iommu_device *s390_iommu_probe_device(struct device *dev)
>   {
> -       struct zpci_dev *zdev = to_zpci_dev(dev);
> +       struct zpci_dev *zdev;
> +
> +       if (!dev_is_pci(dev))
> +               return ERR_PTR(-ENODEV);
> +
> +       zdev = to_zpci_dev(dev);
> 
> 
>          return &zdev->iommu_dev;
>   }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ