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: <36725a11-b74c-da8e-b621-1a4f8055d779@intel.com>
Date:   Tue, 17 Oct 2023 16:55:12 +0800
From:   Yi Liu <yi.l.liu@...el.com>
To:     Nicolin Chen <nicolinc@...dia.com>,
        Jason Gunthorpe <jgg@...dia.com>
CC:     <joro@...tes.org>, <alex.williamson@...hat.com>,
        <kevin.tian@...el.com>, <robin.murphy@....com>,
        <baolu.lu@...ux.intel.com>, <cohuck@...hat.com>,
        <eric.auger@...hat.com>, <kvm@...r.kernel.org>,
        <mjrosato@...ux.ibm.com>, <chao.p.peng@...ux.intel.com>,
        <yi.y.sun@...ux.intel.com>, <peterx@...hat.com>,
        <jasowang@...hat.com>, <shameerali.kolothum.thodi@...wei.com>,
        <lulu@...hat.com>, <suravee.suthikulpanit@....com>,
        <iommu@...ts.linux.dev>, <linux-kernel@...r.kernel.org>,
        <linux-kselftest@...r.kernel.org>, <zhenzhong.duan@...el.com>,
        <joao.m.martins@...cle.com>
Subject: Re: [PATCH v4 10/17] iommufd: Support IOMMU_HWPT_ALLOC allocation
 with user data

On 2023/10/17 02:44, Nicolin Chen wrote:
> On Mon, Oct 16, 2023 at 08:59:07AM -0300, Jason Gunthorpe wrote:
>> On Mon, Oct 16, 2023 at 03:03:04PM +0800, Yi Liu wrote:
>>> Current nesting series actually extends HWPT_ALLOC ioctl to accept user
>>> data for allocating domain with vendor specific data. Nested translation
>>> happens to be the usage of it. But nesting requires invalidation. If we
>>> want to do further split, then this new series would be just "extending
>>> HWPT_ALLOC to accept vendor specific data from userspace". But it will
>>> lack of a user if nesting is separated. Is this acceptable? @Jason
>>
>> I'd still like to include the nesting allocation and attach parts
>> though, even if they are not usable without invalidation ..
> 
> This is the latest series that I reworked (in bottom-up order):
>   iommu: Add a pair of helper to copy struct iommu_user_data{_array}
>   iommufd: Add IOMMU_HWPT_INVALIDATE
>   iommufd: Add a nested HW pagetable object
>   iommufd: Share iommufd_hwpt_alloc with IOMMUFD_OBJ_HWPT_NESTED
>   iommufd: Derive iommufd_hwpt_paging from iommufd_hw_pagetable
>   iommufd: Rename IOMMUFD_OBJ_HW_PAGETABLE to IOMMUFD_OBJ_HWPT_PAGING
>   iommufd/device: Add helpers to enforce/remove device reserved regions
>   iommu: Add IOMMU_DOMAIN_NESTED and cache_invalidate_user op
>   iommu: Pass in parent domain with user_data to domain_alloc_user op

following Jason's comment, it looks like we can just split the cache
invalidation path out. Then the above looks good after removing
"iommufd: Add IOMMU_HWPT_INVALIDATE" and also the cache_invalidate_user
callback in "iommu: Add IOMMU_DOMAIN_NESTED and cache_invalidate_user op".
Is it? @Jason

> Perhaps we can have a preparatory series to merge first:
>   iommufd: Share iommufd_hwpt_alloc with IOMMUFD_OBJ_HWPT_NESTED
>   iommufd: Derive iommufd_hwpt_paging from iommufd_hw_pagetable
>   iommufd: Rename IOMMUFD_OBJ_HW_PAGETABLE to IOMMUFD_OBJ_HWPT_PAGING
>   iommufd/device: Add helpers to enforce/remove device reserved regions
> 
> Then next cycle would be basically 4 patches + selftests:
>   iommufd: Add IOMMU_HWPT_INVALIDATE
>   iommufd: Add a nested HW pagetable object
>   iommu: Add IOMMU_DOMAIN_NESTED and cache_invalidate_user op
>   iommu: Pass in parent domain with user_data to domain_alloc_user op
> 
> The preparatory series doesn't involve functional changes yet have
> a good amount of pieces to simplify the "nested HW pagetable" that
> is basically nested_alloc/abort/destroy.
> >>> BTW. Do we still have unsolved issue on the invalidation path?
>>
>> I'm not sure, there were so many different versions of it we need to
>> go back over it and check the dirver implementations again
> 
> Only this v4 has the latest array-based invalidation design. And
> it should be straightforward for drivers to define entry/request
> structures. It might be a bit rush to review/finalize it at the
> stage of rc6 though.

yes, before v4, the cache invalidation path is simple and vendor
drivers have their own handling.

-- 
Regards,
Yi Liu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ