On Sat, May 09, 2026 at 01:31:56PM +0800, Xu Yilun wrote:
> > Would you be open to an in-between? The exporter and importer both
> > have information that should not leak into each other's drivers.
> >
> > What if the dmabuf mapping type core code was the only thing that had
> > access to *BOTH*? The exporter provides the address data, the importer
> > provides the iommu_domain. The core code, and only the core code, has
> > both and does the required operation?
>
> I think that may not work for KVM. On IOMMU side, IOMMUFD acts as the
> address space (iova) manager and dma_api/IOMMU driver acts as the
> actual page table mapper. But for KVM, it is both. KVM doesn't allow
> another component to provide an unknown address space (GPA space) and
> say "map it", so doesn't expose to other components about "KVM domain".
>
> Even if we expose "KVM domain", KVM still acts as the importer and the
> mapper, is it wierd to say we trust KVM-the-mapper, but don't trust
> KVM-the-as-manager?
>
> Is it also wierd that we trust IOMMU-the-mapper, but don't trust
> IOMMUFD-the-as-manager? There are more IOMMU drivers than IOMMUFD...
Yeah, it doesn't work well for kvm, and yes it is really weird and
worse that phys in every way..
Jason
On Mon, 11 May 2026 16:30:39 +0100
Matt Evans <mattev(a)meta.com> wrote:
> Hi Alex, Leon,
>
> On 27/04/2026 15:36, Alex Williamson wrote:
> >
> > On Sun, 26 Apr 2026 13:52:15 +0300
> > Leon Romanovsky <leon(a)kernel.org> wrote:
> >
> >> On Fri, Apr 24, 2026 at 03:31:53PM -0300, Jason Gunthorpe wrote:
> >>> On Thu, Apr 16, 2026 at 06:17:52AM -0700, Matt Evans wrote:
> >>>> A new field is reserved in vfio_device_feature_dma_buf.flags to
> >>>> request CPU-facing memory type attributes for mmap()s of the buffer.
> >>>> Add a flag VFIO_DEVICE_FEATURE_DMA_BUF_ATTR_WC, which results in WC
> >>>> PTEs for the DMABUF's BAR region.
> >>>>
> >>>> Signed-off-by: Matt Evans <mattev(a)meta.com>
> >>>> ---
> >>>> drivers/vfio/pci/vfio_pci_dmabuf.c | 15 +++++++++++++--
> >>>> drivers/vfio/pci/vfio_pci_priv.h | 1 +
> >>>> include/uapi/linux/vfio.h | 12 +++++++++---
> >>>> 3 files changed, 23 insertions(+), 5 deletions(-)
> >>>
> >>> Nice and simple
> >>>
> >>> Reviewed-by: Jason Gunthorpe <jgg(a)nvidia.com>
> >>>
> >>>> @@ -1549,8 +1551,12 @@ struct vfio_region_dma_range {
> >>>> struct vfio_device_feature_dma_buf {
> >>>> __u32 region_index;
> >>>> __u32 open_flags;
> >>>> - __u32 flags;
> >>>> - __u32 nr_ranges;
> >>>> + __u32 flags;
> >>>> + /* Flags sub-field reserved for attribute enum */
> >>>> +#define VFIO_DEVICE_FEATURE_DMA_BUF_ATTR_MASK (0xfU << 28)
> >>>> +#define VFIO_DEVICE_FEATURE_DMA_BUF_ATTR_UC (0 << 28)
> >>>> +#define VFIO_DEVICE_FEATURE_DMA_BUF_ATTR_WC (1 << 28)
> >>>> + __u32 nr_ranges;
> >>
> >> Alex,
> >>
> >> The TPH proposal extends the flags field in a similar way, but I suggested
> >> a different approach to conserve bits. At the moment, we spend three bits
> >> on a single feature, which feels wasteful.
> >>
> >> What do you think?
> >> https://lore.kernel.org/all/20260409120415.GF86584@unreal/
> >
> > I already proposed a very different interface for TPH that decouples
> > the dma-buf creation from setting the TPH values:
> >
> > https://lore.kernel.org/all/20260423132016.4a25e074@shazbot.org/
> >
> > This is overall less intrusive than the TPH change proposed, but it
> > could still make sense to align this as an operation on the dma-buf,
> > that can be probed as a separate feature. Thanks,
>
> I'll add a VFIO_DEVICE_FEATURE_DMA_BUF_ATTRS in a v2 instead to get in
> line with the TPH work, no worries.
>
> For the benefit of future hackers, how would you describe the criteria
> for adding flags to this existing field? What hypothetical feature
> characteristics would be appropriate? (Maybe it's that these attrs &
> TPH add scalar fields in several bits rather than a simple boolean.)
> Two of us have independently added something that's turned out to be
> inapproriate so some guidance would be good.
I think the question of how we actually expand an arbitrary grab bag of
"ATTRS" is the central question in whether we should implement the
interface. If we follow the direction I suggested for TPH, maybe this
is just a VFIO_DEVICE_FEATURE_DMA_BUF_WC, where it supports only PROBE
and SET, with SET taking only the dma-buf fd to implement the one-way
promotion from UC -> WC.
If we support a generic SET ATTRS feature, we really need to map out how
flag bits are indicated as supported and how a user untangles failures
from trying to set various attributes. If we end up with a feature
indicating each ATTR is available, we might as well have just
implemented a feature for each attribute. Thanks,
Alex
On Mon, May 11, 2026 at 04:30:39PM +0100, Matt Evans wrote:
> Hi Alex, Leon,
>
> On 27/04/2026 15:36, Alex Williamson wrote:
> >
> > On Sun, 26 Apr 2026 13:52:15 +0300
> > Leon Romanovsky <leon(a)kernel.org> wrote:
> >
> > > On Fri, Apr 24, 2026 at 03:31:53PM -0300, Jason Gunthorpe wrote:
> > > > On Thu, Apr 16, 2026 at 06:17:52AM -0700, Matt Evans wrote:
> > > > > A new field is reserved in vfio_device_feature_dma_buf.flags to
> > > > > request CPU-facing memory type attributes for mmap()s of the buffer.
> > > > > Add a flag VFIO_DEVICE_FEATURE_DMA_BUF_ATTR_WC, which results in WC
> > > > > PTEs for the DMABUF's BAR region.
> > > > >
> > > > > Signed-off-by: Matt Evans <mattev(a)meta.com>
> > > > > ---
> > > > > drivers/vfio/pci/vfio_pci_dmabuf.c | 15 +++++++++++++--
> > > > > drivers/vfio/pci/vfio_pci_priv.h | 1 +
> > > > > include/uapi/linux/vfio.h | 12 +++++++++---
> > > > > 3 files changed, 23 insertions(+), 5 deletions(-)
> > > >
> > > > Nice and simple
> > > >
> > > > Reviewed-by: Jason Gunthorpe <jgg(a)nvidia.com>
> > > > > @@ -1549,8 +1551,12 @@ struct vfio_region_dma_range {
> > > > > struct vfio_device_feature_dma_buf {
> > > > > __u32 region_index;
> > > > > __u32 open_flags;
> > > > > - __u32 flags;
> > > > > - __u32 nr_ranges;
> > > > > + __u32 flags;
> > > > > + /* Flags sub-field reserved for attribute enum */
> > > > > +#define VFIO_DEVICE_FEATURE_DMA_BUF_ATTR_MASK (0xfU << 28)
> > > > > +#define VFIO_DEVICE_FEATURE_DMA_BUF_ATTR_UC (0 << 28)
> > > > > +#define VFIO_DEVICE_FEATURE_DMA_BUF_ATTR_WC (1 << 28)
> > > > > + __u32 nr_ranges;
> > >
> > > Alex,
> > >
> > > The TPH proposal extends the flags field in a similar way, but I suggested
> > > a different approach to conserve bits. At the moment, we spend three bits
> > > on a single feature, which feels wasteful.
> > >
> > > What do you think?
> > > https://lore.kernel.org/all/20260409120415.GF86584@unreal/
> >
> > I already proposed a very different interface for TPH that decouples
> > the dma-buf creation from setting the TPH values:
> >
> > https://lore.kernel.org/all/20260423132016.4a25e074@shazbot.org/
> >
> > This is overall less intrusive than the TPH change proposed, but it
> > could still make sense to align this as an operation on the dma-buf,
> > that can be probed as a separate feature. Thanks,
>
> I'll add a VFIO_DEVICE_FEATURE_DMA_BUF_ATTRS in a v2 instead to get in line
> with the TPH work, no worries.
>
> For the benefit of future hackers, how would you describe the criteria for
> adding flags to this existing field?
One bit per-feature.
> What hypothetical feature characteristics would be appropriate? (Maybe it's that these attrs & TPH
> add scalar fields in several bits rather than a simple boolean.) Two of us
> have independently added something that's turned out to be inapproriate so
> some guidance would be good.
Both of you intertwined the signaling bit with the actual data, and that is
what led me to prefer a different approach.
Thanks
>
> Thanks!
>
>
> Matt
On Thu, May 07, 2026 at 05:16:56PM +1000, Alexey Kardashevskiy wrote:
> true but either way dmabuf slicing will be directed by QEMU's
> msix-table emulation MR and this slicing needs to match the TDISP
> report so I'll have to teach QEMU these reports, right? I am worried
> if I miss something obvious, again. Thanks,
I don't think so.. It just needs to slice it into the MSI page
blindly. When the VM goes to validate the TDISP report against the
mappings it will fail to accept the device if there is a mismatch.
The only thing qemu could do is fail sooner, but I don't know that is
worth the complexity as we do expect all devices to have their MSI
range unprotected.
Jason
On Tue, May 05, 2026 at 06:40:21PM +0200, Boris Brezillon wrote:
> On Tue, 5 May 2026 17:39:13 +0200
> Maxime Ripard <mripard(a)kernel.org> wrote:
>
> > Hi Boris,
> >
> > On Tue, May 05, 2026 at 05:20:48PM +0200, Boris Brezillon wrote:
> > > Hi Ketil,
> > >
> > > On Tue, 5 May 2026 16:05:07 +0200
> > > Ketil Johnsen <ketil.johnsen(a)arm.com> wrote:
> > >
> > > > From: John Stultz <jstultz(a)google.com>
> > > >
> > > > Add proper reference counting on the dma_heap structure. While
> > > > existing heaps are built-in, we may eventually have heaps loaded
> > > > from modules, and we'll need to be able to properly handle the
> > > > references to the heaps
> > >
> > > It's weird that this "heap as module" thing is mentioned here, but
> > > actual robustness to make this safe is not added in the commit or any
> > > of the following ones.
> > >
> > > >
> > > > Signed-off-by: John Stultz <jstultz(a)google.com>
> > > > Signed-off-by: T.J. Mercier <tjmercier(a)google.com>
> > > > Signed-off-by: Yong Wu <yong.wu(a)mediatek.com>
> > > > [Yong: Just add comment for "minor" and "refcount"]
> > > > Signed-off-by: Yunfei Dong <yunfei.dong(a)mediatek.com>
> > > > [Yunfei: Change reviewer's comments]
> > > > Signed-off-by: Florent Tomasin <florent.tomasin(a)arm.com>
> > > > [Florent: Rebase]
> > > > Signed-off-by: Ketil Johnsen <ketil.johnsen(a)arm.com>
> > > > [Ketil: Rebase]
> > > > ---
> > > > drivers/dma-buf/dma-heap.c | 29 +++++++++++++++++++++++++++++
> > > > include/linux/dma-heap.h | 2 ++
> > > > 2 files changed, 31 insertions(+)
> > > >
> > > > diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c
> > > > index ac5f8685a6494..9fd365ddbd517 100644
> > > > --- a/drivers/dma-buf/dma-heap.c
> > > > +++ b/drivers/dma-buf/dma-heap.c
> > > > @@ -12,6 +12,7 @@
> > > > #include <linux/dma-heap.h>
> > > > #include <linux/err.h>
> > > > #include <linux/export.h>
> > > > +#include <linux/kref.h>
> > > > #include <linux/list.h>
> > > > #include <linux/nospec.h>
> > > > #include <linux/syscalls.h>
> > > > @@ -31,6 +32,7 @@
> > > > * @heap_devt: heap device node
> > > > * @list: list head connecting to list of heaps
> > > > * @heap_cdev: heap char device
> > > > + * @refcount: reference counter for this heap device
> > > > *
> > > > * Represents a heap of memory from which buffers can be made.
> > > > */
> > > > @@ -41,6 +43,7 @@ struct dma_heap {
> > > > dev_t heap_devt;
> > > > struct list_head list;
> > > > struct cdev heap_cdev;
> > > > + struct kref refcount;
> > > > };
> > > >
> > > > static LIST_HEAD(heap_list);
> > > > @@ -248,6 +251,7 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info)
> > > > if (!heap)
> > > > return ERR_PTR(-ENOMEM);
> > > >
> > > > + kref_init(&heap->refcount);
> > > > heap->name = exp_info->name;
> > > > heap->ops = exp_info->ops;
> > > > heap->priv = exp_info->priv;
> > > > @@ -313,6 +317,31 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info)
> > > > }
> > > > EXPORT_SYMBOL_NS_GPL(dma_heap_add, "DMA_BUF_HEAP");
> > > >
> > > > +static void dma_heap_release(struct kref *ref)
> > > > +{
> > > > + struct dma_heap *heap = container_of(ref, struct dma_heap, refcount);
> > > > + unsigned int minor = MINOR(heap->heap_devt);
> > > > +
> > > > + mutex_lock(&heap_list_lock);
> > > > + list_del(&heap->list);
> > > > + mutex_unlock(&heap_list_lock);
> > > > +
> > > > + device_destroy(dma_heap_class, heap->heap_devt);
> > > > + cdev_del(&heap->heap_cdev);
> > > > + xa_erase(&dma_heap_minors, minor);
> > > > +
> > > > + kfree(heap);
> > >
> > > That's actually problematic, because cdev_del() doesn't guarantee that
> > > all opened FDs have been closed [1], it just guarantees that no new ones
> > > can materialize. In order to make that safe, we'd need a
> > >
> > > 1. kref_get_unless_zero() in dma_heap_open(), with proper locking around
> > > the xa_load() to protect against the heap removal that's happening
> > > here
> > > 2. a dma_heap_put() in a new dma_heap_close() implementation
> > > 3. a guarantee that heap implementations won't go away until the last
> > > ref is dropped, which means ops and all the data needed for this heap
> > > to satisfy ioctl()s (and more generally every passed at
> > > dma_heap_add() time) have to stay valid until the last ref is
> > > dropped. Alternatively, we could restrict this only to in-flight
> > > ioctl()s, and have the ops replaced by some dummy ops using RCU or a
> > > rwlock. But I guess live dmabufs allocated on this heap have to
> > > retain the heap and its implementation anyway.
> > >
> > > For record, #3 is already not satisfied by the current tee_heap
> > > implementation (tee_dma_heap objects can vanish before the dma_heap
> > > object is gone). The other implementations seem to be fine because they
> > > are statically linked, and they either have exp_info.priv set to NULL,
> > > or something that's never released.
> >
> > That statement won't hold for long, see:
> > https://lore.kernel.org/r/20260427-dma-buf-heaps-as-modules-v5-0-b6f5678fee…
> >
> > However, all upstream heaps can be loaded as module, but not unloaded.
> > So once you get a reference to it, you can assume it will live forever.
> > That's why we didn't merge that patch before, even though it was discussed:
> >
> > https://lore.kernel.org/all/CANDhNCqk9Uk4aXHhUsL4hR1GHNmWZnH3C9Np-A02wdi+J3…
>
> Hm, not too sure that makes the tee_heap implementation sane WRT
> tee_heap removal though, unless we have a guarantee that
> tee_device_unregister() will never be called...
I missed that part. You're totally right then :)
Maxime
Modern mimarinin vazgeçilmez yapı elemanlarından biri haline gelen demir döner merdivenler, hem estetik görünümü hem de uzun ömürlü kullanımıyla yaşam alanlarına değer katmaktadır. Özellikle dar alanlarda maksimum kullanım avantajı sunan bu merdiven sistemleri, evlerden iş yerlerine, dubleks dairelerden villa projelerine kadar birçok farklı alanda tercih edilmektedir.
Dayanıklı metal yapısı sayesinde yüksek taşıma kapasitesine sahip olan demir döner merdiven modelleri, güvenli kullanım sunarken dekoratif tasarımlarıyla da dikkat çeker. Klasik, modern, endüstriyel veya minimalist dekorasyon stillerine uyum sağlayabilen bu özel merdivenler, mekânın atmosferini tamamen değiştirebilir.
Demir döner merdivenlerin en önemli avantajlarından biri yer tasarrufu sağlamasıdır. Geleneksel düz merdivenlere göre daha az alan kaplayan spiral tasarım, özellikle küçük metrekareli alanlarda büyük avantaj sunar. Bu sayede hem kullanışlı hem de şık bir geçiş alanı oluşturulur.
Üretim aşamasında kullanılan kaliteli demir malzeme, paslanmaya ve deformasyona karşı yüksek direnç sağlar. Elektrostatik boya uygulamaları sayesinde merdiven yüzeyi uzun yıllar ilk günkü görünümünü korur. İç mekân kullanımının yanı sıra dış mekân projelerinde de tercih edilen demir döner merdivenler, hava koşullarına dayanıklı yapısıyla güven verir.
Kişiye özel ölçülerde üretilebilen modeller sayesinde her projeye uygun çözümler sunulabilir. Basamak genişliği, korkuluk tasarımı, renk seçenekleri ve merdiven çapı tamamen ihtiyaca göre şekillendirilebilir. Ahşap basamak detaylarıyla sıcak bir görünüm elde edilebilirken tamamen metal tasarımlarla modern ve güçlü bir atmosfer oluşturulabilir.
Demir döner merdivenler sadece bir geçiş aracı değil, aynı zamanda dekoratif bir mimari unsur olarak da öne çıkar. Özellikle loft daireler, teras bağlantıları, çatı katları ve mağaza iç tasarımlarında estetik görünümüyle dikkat çekmektedir. Hem fonksiyonel hem de görsel açıdan güçlü bir çözüm arayanlar için ideal seçenekler arasında yer alır.
Uzun ömürlü kullanım, sağlam yapı, estetik görünüm ve alan tasarrufu avantajlarını bir araya getiren demir döner merdiven sistemleri, modern yaşam alanlarının vazgeçilmez tercihleri arasında yer almaktadır. Siz de yaşam alanınıza özel tasarlanmış kaliteli ve şık bir merdiven çözümü ile mekânlarınıza değer katabilirsiniz.
Demir döner merdiven https://fakrocatimerdivenleri.com/doner-merdivenler/
Fakro çatı merdivenleri, modern yaşam alanlarında çatı katına güvenli, konforlu ve pratik erişim sağlamak için geliştirilmiş yenilikçi çözümler arasında yer almaktadır. Dayanıklı yapısı, estetik tasarımı ve uzun ömürlü kullanım avantajı ile dikkat çeken Fakro çatı merdivenleri; evler, dubleks daireler, villalar, ofisler ve depo alanları için ideal bir kullanım sunar. Kullanılmadığı zaman katlanabilir yapısı sayesinde minimum alan kaplayan bu sistemler, yaşam alanlarında ekstra yer tasarrufu sağlamaktadır.
Fakro’nun geliştirdiği çatı merdiveni modelleri; ahşap, metal ve makaslı sistem seçenekleriyle farklı ihtiyaçlara hitap eder. Isı yalıtımlı kapak yapıları sayesinde enerji kaybını minimum seviyeye indirirken, özellikle kış aylarında iç mekan sıcaklığının korunmasına yardımcı olur. Kaymaz basamak yapısı ve sağlam menteşe sistemi ise kullanıcı güvenliğini üst seviyeye taşır. Böylece hem güvenli hem de ergonomik bir kullanım deneyimi elde edilir.
Kurulum açısından oldukça pratik olan Fakro çatı merdivenleri, tavan boşluklarına uyum sağlayan özel ölçü seçenekleri ile üretilmektedir. Tavana tam entegre olan yapısı sayesinde dekoratif açıdan da estetik bir görünüm sunar. Açılıp kapanma mekanizmasının kolay çalışması, günlük kullanım sırasında büyük avantaj sağlar. Özellikle dar alanlarda maksimum verim almak isteyen kullanıcılar için son derece işlevsel bir çözüm oluşturur.
Fakro ahşap çatı merdivenleri doğal görünümü ile yaşam alanlarına sıcak bir atmosfer kazandırırken, metal çatı merdivenleri yüksek taşıma kapasitesi ve dayanıklılığı ile öne çıkar. Makaslı alüminyum modeller ise kompakt yapıları sayesinde küçük tavan girişlerinde bile rahat kullanım imkanı sunmaktadır. Her modelde kalite standartlarının yüksek tutulması, ürünlerin uzun yıllar sorunsuz kullanılmasına katkı sağlar.
Fakro çatı merdivenleri https://www.fakrocatimerdivenleri.com