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: <aWA4GKp5ld92sY6e@devgpu015.cco6.facebook.com>
Date: Thu, 8 Jan 2026 15:04:56 -0800
From: Alex Mastro <amastro@...com>
To: Jason Gunthorpe <jgg@...pe.ca>
CC: David Matlack <dmatlack@...gle.com>, Alex Williamson <alex@...zbot.org>,
        Shuah Khan <shuah@...nel.org>, Peter Xu <peterx@...hat.com>,
        <linux-kernel@...r.kernel.org>, <kvm@...r.kernel.org>,
        <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH] vfio: selftests: Add vfio_dma_mapping_mmio_test

On Thu, Jan 08, 2026 at 08:25:19AM -0800, Alex Mastro wrote:
> On Thu, Jan 08, 2026 at 10:38:04AM -0400, Jason Gunthorpe wrote:
> > On Wed, Jan 07, 2026 at 07:36:44PM -0800, Alex Mastro wrote:
> > > The intent of QEMU's mmap alignment code is imperfect in the SPARE_MMAP case?
> > > After a hole, the next mmap'able range could be some arbitrary page-aligned
> > > offset into the region. It's not helpful mmap some region offset which is
> > > maximally 4K-aligned at a 1G-aligned vaddr.
> > > 
> > > I think to be optimal, QEMU should be attempting to align the vaddr for bar
> > > mmaps such that
> > > 
> > > vaddr % {2M,1G} == region_offset % {2M,1G}
> > > 
> > > Would love someone to sanity check me on this. Kind of a diversion.
> > 
> > What you write is correct. Ankit recently discovered this bug in
> > qemu. It happens not just with SPARSE_MMAP but also when mmmaping
> > around the MSI-X hole..
> 
> Is my mental model broken? I thought MSI-X holes in a VFIO-exposed BAR region
> implied SPARSE_MMAP? I didn't think there was another way for the uapi to
> express hole-yness.

Yes, it was broken. Creating MSI-X table holes with SPARSE_MMAP ended back
in 2017 and was superseded by VFIO_REGION_INFO_CAP_MSIX_MAPPABLE [1].

[1] https://lore.kernel.org/all/20171213023131.41233-1-aik@ozlabs.ru/

Only nvgrace-gpu and some i915 reference SPARSE_MMAP today.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ