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: <20251013192940.GC14552@unreal>
Date: Mon, 13 Oct 2025 22:29:40 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Keith Busch <kbusch@...nel.org>
Cc: Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
	Jason Gunthorpe <jgg@...dia.com>, linux-block@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
	Sagi Grimberg <sagi@...mberg.me>
Subject: Re: [PATCH 3/4] block-dma: properly take MMIO path

On Mon, Oct 13, 2025 at 01:01:18PM -0600, Keith Busch wrote:
> On Mon, Oct 13, 2025 at 06:34:11PM +0300, Leon Romanovsky wrote:
> >  static bool blk_dma_map_direct(struct request *req, struct device *dma_dev,
> >  		struct blk_dma_iter *iter, struct phys_vec *vec)
> >  {
> > +	unsigned int attrs = 0;
> > +
> > +	if (req->cmd_flags & REQ_MMIO)
> > +		attrs |= DMA_ATTR_MMIO;
> 
> Since data and integrity paylods use these same functions and may point
> to different kinds of memory, I think you'd have to pass the 'attrs'
> from the caller since it knows which flags to check for MMIO dma.

I think that hunk will fix it.

diff --git a/block/blk-mq-dma.c b/block/blk-mq-dma.c
index 38f5c34ca223..8af88ba97c7a 100644
--- a/block/blk-mq-dma.c
+++ b/block/blk-mq-dma.c
@@ -88,9 +88,11 @@ static bool blk_dma_map_bus(struct blk_dma_iter *iter, struct phys_vec *vec)
 static bool blk_dma_map_direct(struct request *req, struct device *dma_dev,
                struct blk_dma_iter *iter, struct phys_vec *vec)
 {
+       struct bio_integrity_payload *bip = bio_integrity(req->bio);
        unsigned int attrs = 0;

-       if (req->cmd_flags & REQ_MMIO)
+       if ((!bip && req->cmd_flags & REQ_MMIO) ||
+           bio_integrity_flagged(req->bio, BIP_MMIO))
                attrs |= DMA_ATTR_MMIO;

        iter->addr = dma_map_phys(dma_dev, vec->paddr, vec->len,
~

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ