All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>,
	linux-rdma@vger.kernel.org, edwards@nvidia.com, kees@kernel.org,
	parav@nvidia.com, mbloch@nvidia.com, yishaih@nvidia.com,
	lirongqing@baidu.com, huangjunxian6@hisilicon.com,
	liuy22@mails.tsinghua.edu.cn, jmoroni@google.com
Subject: Re: [PATCH rdma-next v2 1/2] RDMA/uverbs: expose CoCo DMA bounce requirement to userspace
Date: Tue, 12 May 2026 16:08:44 +0200	[thread overview]
Message-ID: <agM0bHFFDnSBL8RK@FV6GYCPJ69> (raw)
In-Reply-To: <20260512140510.GA7702@ziepe.ca>

Tue, May 12, 2026 at 04:05:10PM CEST, jgg@ziepe.ca wrote:
>On Tue, May 12, 2026 at 04:03:07PM +0200, Jiri Pirko wrote:
>> >> @@ -1419,6 +1421,10 @@ int ib_register_device(struct ib_device *device, const char *name,
>> >>  	 */
>> >>  	WARN_ON(dma_device && !dma_device->dma_parms);
>> >>  	device->dma_device = dma_device;
>> >> +	if (dma_device &&
>> >> +	    cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) &&
>> >> +	    is_swiotlb_force_bounce(dma_device))
>> >
>> >It is the wrong place. When I worked on my DMA series, I tried something
>> >similar (a call into SWIOTLB) to notify users that RDMA would not work.
>> >
>> >The general feedback was that this is a layering violation, and that any
>> >knowledge of SWIOTLB (and its API) should not leak out of the DMA API.
>> >
>> >You shouldn't call to is_swiotlb_force_bounce() here.
>> 
>> What do you suggest as alternative? We need to somehow tell the user
>> what is the situation.
>
>For now CC_ATTR_GUEST_MEM_ENCRYPT is likely sufficient.
>
>Later we should be able to detect if the device is in T=1 mode
>directly.

Okay, so we assume for now that every device is T=0 (which I believe is
the reality). Once T=1 device appears, it changes this "if statement".
Do I understand that correctly?

  reply	other threads:[~2026-05-12 14:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 11:14 [PATCH rdma-next v2 0/2] RDMA: detect and handle CoCo DMA bounce buffering Jiri Pirko
2026-05-06 11:14 ` [PATCH rdma-next v2 1/2] RDMA/uverbs: expose CoCo DMA bounce requirement to userspace Jiri Pirko
2026-05-12 13:03   ` Leon Romanovsky
2026-05-12 14:03     ` Jiri Pirko
2026-05-12 14:05       ` Jason Gunthorpe
2026-05-12 14:08         ` Jiri Pirko [this message]
2026-05-12 14:34           ` Jason Gunthorpe
2026-05-12 18:30             ` Jiri Pirko
2026-05-06 11:14 ` [PATCH rdma-next v2 2/2] RDMA/umem: block plain userspace memory registration under CoCo bounce Jiri Pirko
2026-05-12 13:05   ` Leon Romanovsky
2026-05-12 14:04     ` Jiri Pirko
2026-05-14 16:25       ` Leon Romanovsky
2026-05-15  6:13         ` Jiri Pirko
2026-05-06 12:52 ` [PATCH rdma-next v2 0/2] RDMA: detect and handle CoCo DMA bounce buffering Jacob Moroni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agM0bHFFDnSBL8RK@FV6GYCPJ69 \
    --to=jiri@resnulli.us \
    --cc=edwards@nvidia.com \
    --cc=huangjunxian6@hisilicon.com \
    --cc=jgg@ziepe.ca \
    --cc=jmoroni@google.com \
    --cc=kees@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    --cc=liuy22@mails.tsinghua.edu.cn \
    --cc=mbloch@nvidia.com \
    --cc=parav@nvidia.com \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.