From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50EEB26ED55 for ; Wed, 19 Nov 2025 19:45:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763581516; cv=none; b=WDuo+SzGCDNzl3rUxFfZLH1L1LM2VFF2pmA2UPXt7pOWqSoXOYfvS0JnQfjW3tW3V/yAvFUTI489ShASTABSRpk/pCW2s5bIkPqGkvY929jlJy8AMW+izPi9avzUS/wTOhYcuUB8f5pGG72TA4ddRN6Jvo8Q2t9WUB9m3hOzvIY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763581516; c=relaxed/simple; bh=ez/Kk64Qkn4faxtP6x8udD23BDfPOJ9+UM/Y/c2urgE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Xa6nmdIEmAFeL/Y4DJwlRFOdTCULCUwsKifytzGmu7f21h4NZfMR6eY4+YoUG93pgcFTmWNOGn63n0A0T87EuXzQWZrpsldTqxQxB0x7i8bFnDfixGiOh3WLyKQamqxmM2Oq0g8w/vXxFTvjodimVMq6FaHUMy+sd0Q9hcLz4b0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=QnsJokjy; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="QnsJokjy" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-8b21fc25ae1so11337185a.1 for ; Wed, 19 Nov 2025 11:45:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1763581509; x=1764186309; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ngigizqFoW1/n7l/UtYTJcb/TxX1OBEkHcoOUDKA/VA=; b=QnsJokjyGEW0/0tsm9ACOgn9ZapvlUIuGn/IFciOS5f5BkjnSQyvBt1QRWjIALzXvV ZWJCxr/EarfBZl+9AyogFHugyYl03gfSsjh/rOLA0+xEMd7gJ6/CKwAdPpQ4hvnlJDd3 wVeItULT3S4P9Vm3pMRDVodUDzm/nWowNM7EvJjRxMmkdUpHhkYA2zvf1LX6R3oYMG/e FJrw3sMX3KSTD96Dq8SEwgkUuCh6frDdTf/QGt1dLfGBDRwSqgEF2s6tfyYnDbfMClBr mG5OXo5KzfqLVSyik8v2/lj2Wqz9SzaJ0vCDz1NhXdGkN1emJFfHmxMFVlAb4YVSRmzE FvYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763581509; x=1764186309; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ngigizqFoW1/n7l/UtYTJcb/TxX1OBEkHcoOUDKA/VA=; b=ppgj4RCn/eyE8dguxDOajITBmpjEVPiesbratpGYf2yjR5TUGkIoLkVSnOaf95bnbt 7vlFQY/bQCwRSOriYGXht8fFgRuPp0HHO3xOLAccR7OAp0YV73JGCPxUHrBwANWYMRat BcH4CmvTTXtUs6ShpKNzlpkAapb86aNP7GIEXnYzz/tEjAIymnybamYltSocxrVxGfqF /iDgSzlbNYHNvHa19UFfkS93OLSizCwLi3Ww/+XYx0b2N/LZxabyef0axJtNkatnmH2b 3hjGo7zBlG3UsVvHj6BLSha9VH5LsVh++LtJsAR7f3FBV99fXSVFbQ/rY7PCe3JclG8+ FD4A== X-Forwarded-Encrypted: i=1; AJvYcCUIxlExlF1fy/Uu4UkGzUaiue5ctNnSbvPXCvEV6qvwayREoAi1zORT9fWLOH27e+y+k4FmTdR5IFuHJ9U=@vger.kernel.org X-Gm-Message-State: AOJu0YzJrL0sYrzJwT1dwL5aP5ZXJny9O81xmKatawSg3w4ReLd+bVxQ Mn1n6ZIQi0uuVJnmOKA8oO1+bYWagaKEZjhVZuhVJxpewjqSS1Ljc6GNqJbt6WEZlXE= X-Gm-Gg: ASbGncvAYsZZIJQaKIMmHHJq3I0vzvUdju96x4IDfkdkCU5ABQUyenZEHeq6of0loSm HC5sh50Oe5s5M96q/HqfIVmBR53pkN26NSZgrYpwxYkqc/MP8Q0GNqoAlFRrux/4vdlxqSCfU4h vaW/zimdqSfBg2pwqBadnVVg6jd/dyEFulVMs2KvYh09zpcfSZ+r4CBQhopN8E9OgZ9C0spc0fQ KeyUStgPARadg7QO2SOvU9Xbsd0aruFpViZ2o+S7ebNg0z0NOs3qghXdHUEn+iTLfDP7Ipnd3LD ZtwF5pA2ciNTDJyTKFYPSu80/5GC2+GYahdp6EH1gnt63SBuvmDBy6ROeF6wQJ0trLdEGD8ty64 PHQ6mzOlR67T1d0XXnFaEdMuXNmKnlUY9dGhPjoa4x7wRoC6uRy+3bJoVPoqAtU6jXUktuiI90J yHlkYj8/BHjzTzLWQ/uJ1ZF3yc0ikCcIBAh5FXxAjIsyl/JD4Kdjznj3f+ X-Google-Smtp-Source: AGHT+IHM2All3T5KCtKB0YCjHC7VAw8938Pjcsqc0YyXScERh5oSqA8kZNdUfx1RTYUHZ+fIhtYAoA== X-Received: by 2002:a05:620a:44d4:b0:893:31da:1028 with SMTP id af79cd13be357-8b3274b5313mr86654885a.90.1763581507903; Wed, 19 Nov 2025 11:45:07 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-47-55-120-4.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.120.4]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8846e447272sm1944186d6.5.2025.11.19.11.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 11:45:07 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vLo70-00000000bcb-3TE0; Wed, 19 Nov 2025 15:45:06 -0400 Date: Wed, 19 Nov 2025 15:45:06 -0400 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: Leon Romanovsky , Bjorn Helgaas , Logan Gunthorpe , Jens Axboe , Robin Murphy , Joerg Roedel , Will Deacon , Marek Szyprowski , Andrew Morton , Jonathan Corbet , Sumit Semwal , Kees Cook , "Gustavo A. R. Silva" , Ankit Agrawal , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , Krishnakant Jaju , Matt Ochs , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, iommu@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, kvm@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v8 05/11] PCI/P2PDMA: Document DMABUF model Message-ID: <20251119194506.GS17968@ziepe.ca> References: <20251111-dmabuf-vfio-v8-0-fd9aa5df478f@nvidia.com> <20251111-dmabuf-vfio-v8-5-fd9aa5df478f@nvidia.com> <9798b34c-618b-4e89-82b0-803bc655c82b@amd.com> <20251119133529.GL17968@ziepe.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Nov 19, 2025 at 03:06:18PM +0100, Christian König wrote: > On 11/19/25 14:35, Jason Gunthorpe wrote: > > On Wed, Nov 19, 2025 at 10:18:08AM +0100, Christian König wrote: > >>> +As this is not well-defined or well-supported in real HW the kernel defaults to > >>> +blocking such routing. There is an allow list to allow detecting known-good HW, > >>> +in which case P2P between any two PCIe devices will be permitted. > >> > >> That section sounds not correct to me. > > > > It is correct in that it describes what the kernel does right now. > > > > See calc_map_type_and_dist(), host_bridge_whitelist(), cpu_supports_p2pdma(). > > Well I'm the one who originally suggested that whitelist and the description still doesn't sound correct to me. > > I would write something like "The PCIe specification doesn't define the forwarding of transactions between hierarchy domains...." Ok > The previous text was actually much better than this summary since > now it leaves out the important information where all of this is > comes from. Well, IMHO, it doesn't "come from" anywhere, this is all implementation specific behaviors.. > > ARM SOCs are frequently not supporting even on server CPUs. > > IIRC ARM actually has a validation program for this, but I've forgotten the name of it again. I suspect you mean SBSA, and I know at least one new SBSA approved chip that doesn't have working P2P through the host bridge.. :( > Randy should know the name of it and I think mentioning the status > of the vendors here would be a good idea. I think refer to the kernel code is best for what is currently permitted.. > The documentation makes it sound like DMA-buf is limited to not > using struct pages and direct I/O, but that is not true. Okay, I see what you mean, the intention was to be very strong and say if you are not using struct pages then you must using DMABUF or something like it to control lifetime. Not to say that was the only way how DMABUF can be used. Leon let's try to clarify that a bit more Jason