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:   Tue, 15 Aug 2023 10:05:58 +0800
From:   Baolu Lu <baolu.lu@...ux.intel.com>
To:     Jie Ji <jijie.ji@...ux.alibaba.com>, dwmw2@...radead.org,
        joro@...tes.org, will@...nel.org, robin.murphy@....com,
        Kevin Tian <kevin.tian@...el.com>,
        Alex Williamson <alex.williamson@...hat.com>
Cc:     baolu.lu@...ux.intel.com, iommu@...ts.linux.dev,
        linux-kernel@...r.kernel.org, xianting.tian@...ux.alibaba.com,
        kaijieguo@...ux.alibaba.com, daishengdong@...h.net
Subject: Re: [PATCH] iommu/vt-d: Atomic breakdown of IOPT into finer
 granularity

[Please allow me to include Kevin and Alex in this thread.]

On 2023/8/14 20:10, Jie Ji wrote:
> With the addition of IOMMU support for IO page fault, it's now possible
> to unpin the memory which DMA remapping. However, the lack of support
> for unmapping a subrange of the I/O page table (IOPT) in IOMMU can lead
> to some issues.

Is this the right contract about how iommu_map/unmap() should be used?
If I remember it correctly, IOVA ranges should be mapped in pairs. That
means, if a range is mapped by iommu_map(), the same range should be
unmapped with iommu_unmap().

Any misunderstanding or anything changed?

> 
> For instance, a virtual machine can establish IOPT of 2M/1G for better
> performance, while the host system enable swap and attempts to swap out
> some 4K pages. Unfortunately, unmap subrange of the large-page mapping
> will make IOMMU page walk to error level, and finally cause kernel crash.

Sorry that I can't fully understand this use case. Are you talking about
the nested translation where user spaces manage their own IO page
tables? But how can those pages been swapped out?

> This patch support splitting the page table to a finer granularity and
> atomic switch to it when unmap subrange of the large-page mapping. It
> is much better than the unmap then map method to change IOPT, because
> during interval time, all unmapped address space could trigger IO page
> fault, which is unacceptable.
> 
> Signed-off-by: Jie Ji<jijie.ji@...ux.alibaba.com>
> Reviewed-by: Kaijie Guo<kaijieguo@...ux.alibaba.com>
> ---
>   drivers/iommu/intel/iommu.c | 97 +++++++++++++++++++++++++++++--------
>   drivers/iommu/intel/iommu.h |  1 +
>   2 files changed, 78 insertions(+), 20 deletions(-)

Best regards,
baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ