From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 EE49223EA90 for ; Sat, 28 Feb 2026 00:28:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772238492; cv=none; b=qNGEmqh96wYzJJcbDrR005hX1dksbHRdK4Rupx7GMR0n1DxhC9VH62R+7jOjfQtPfecmqHpp56pe/vcAFGqXb2G/GvL7IsIN/XYMD8lRIP36kigw20tf+G3r+NfDbbHPasZMoYtuXsxifrDMcIc9Ta8yUY6qt3ALT3zU3HAZ1O0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772238492; c=relaxed/simple; bh=YGNKoZbd9ItV0tpLlMFHS8bKihozZyqN701JI8Fx9wU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G6bao6MWIrXZMMyeSaHhxRXcXhwX/XHOIfeE4l7WTAIgHM26Vj6uPkQEsrQhdrIH88A4iJWj6yRQZOymTOdnE5WzM6CVahH7Q/1ft3oRqyROQILGNOVwAyr+xHgZzJggUiBWUwQ4GfwksQQRhlmz6TIXWibpbXGd9NC/y+azZvo= 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=Fjwi6nkk; arc=none smtp.client-ip=209.85.219.54 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="Fjwi6nkk" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-899a917a4feso44119666d6.1 for ; Fri, 27 Feb 2026 16:28:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1772238490; x=1772843290; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=KAMLfTB0VdCLmRuczMOUd+4kmAfCR9U6SjigH585Y48=; b=Fjwi6nkkLd2pShMhW0y/Rqwi+rnlcCHd51/o549qw65rRK3iTQANqTmQmzNTfBHHTS L9/tjwH8Ehzd++W/jqfmkLdZ88Gwfe2wsCgpHGEdh/mCl1mivQ9sPua8mZsrVxzTdkY/ LHf3BI5WdM9WAVTnqCAbxToH9d2y8LCIUiFlicQsbd2rsYuMsnqjYd9PQoYxf0B/eaMh 6tO5JKHtwZyrBELyJN77izqMauDnTdiXOJqEBQBSNlyQSrYeIAdRPxXjzOyg8ZL7tECC kQi1sbYm0YfLVz/lGV4luxnNOk3abuZG4aqaCOAxD/P/TcDAzmbzCzkj0AwllrGLVRyk 5cUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772238490; x=1772843290; h=in-reply-to: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=KAMLfTB0VdCLmRuczMOUd+4kmAfCR9U6SjigH585Y48=; b=c11j0rm9in0AglZTLzNH8iPG6NTfVPzxx1o44ROV88EZwqf+C0wfZYBKey0R0Yvbfx UxRYmqSugo/W+5W7dHyin6rFqnbyw9OtvnEuU/+f3Af0TildzjZQ8uNLUuKpYbTbXsm+ ilthNwsENY/SMh40rxLEEGXBRkS6qyWKwk0erBgrH7P7ntqv6FH3nQEqBwnOsKVsIXBW 06zeiODAZaq3YwXOQUB/TqLR8jLYcp8fRvQxNKBtWcWSidY6E/cQgpOhP0UTQ8FLooF0 oPR70nCsjrHXJWrdyc+tFHBrLP4lzRRfPCARpRIV3Lz/68olP6i45h+0Km8bVkKacMGS 12oA== X-Forwarded-Encrypted: i=1; AJvYcCXmauBIPpfc914mhfeC50QV4E1Q0O+PWMAxHbl3w3N8N9w1Ox1yMNvHZy0McCgtXbQRNyGkRIy9scNDPco=@vger.kernel.org X-Gm-Message-State: AOJu0YytV5BUn0VLCiqti1rF8kZJlEIJrQ68z1fAs6tCdOkhpYdwDXdP 7tiZEQibsHo53AK0kGvi4TlyK4f7pp1neMMKdoHxpmK83ekiMKV9hWzUqiUC/wwmUdM= X-Gm-Gg: ATEYQzy+ncFPAFRqc/nIn9XwlGib0T9q8mMPI9IMvr10ABCRvDLhW+c3e2xtg/yDHI0 VdQV3dtC1UKtC6B+l1lDKMaeSLN+0fkaj59wuEw48V9If7OEw7ZlEDkTtka5Z2CtDjLV4qjLsWo ooMuT3EbkNvfBbjgz+qTewC7Htw8ZOXFiVxPYvRf88a/BDUdPHCTNXemLzxbaQM5Dz8wdfTK+fy VYDsq6e3STVy1jQcYqnYaKTZyv+LMsKiUCxIdTXpYZ3YO103AAkgBCd3t+3w/ZRRu4qXXzr1681 /jeNuSqWe6PtNjoMS7AlLUposJjZuzrnN+hLzd/LLW7AwMJdOY8fBGKK8csvjUzRrOI/X5G05ye Prj/l0WdlON+BS88rYuKm/hekz/ChNlFct7vOua7X+Gh1fu1IBDXvDTW1vEeQneDCYkCPqpwvYD YguBjyCdXH8XUyQYwLZ03yLp86vGiazlR61I5ae8bms1iGuGgWOKZdwYT6+FSLxtrULw3y95qj/ XelSxgA X-Received: by 2002:ad4:5dc2:0:b0:896:f8dc:f6d4 with SMTP id 6a1803df08f44-899d1d6ca54mr69417576d6.5.1772238489925; Fri, 27 Feb 2026 16:28:09 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-112-119.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.112.119]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899c7376847sm55825926d6.28.2026.02.27.16.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 16:28:09 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vw8Bk-00000001WwN-1wgX; Fri, 27 Feb 2026 20:28:08 -0400 Date: Fri, 27 Feb 2026 20:28:08 -0400 From: Jason Gunthorpe To: dan.j.williams@intel.com Cc: Robin Murphy , Alexey Kardashevskiy , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-pci@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Sean Christopherson , Paolo Bonzini , Andy Lutomirski , Peter Zijlstra , Bjorn Helgaas , Marek Szyprowski , Andrew Morton , Catalin Marinas , Michael Ellerman , Mike Rapoport , Tom Lendacky , Ard Biesheuvel , Neeraj Upadhyay , Ashish Kalra , Stefano Garzarella , Melody Wang , Seongman Lee , Joerg Roedel , Nikunj A Dadhania , Michael Roth , Suravee Suthikulpanit , Andi Kleen , Kuppuswamy Sathyanarayanan , Tony Luck , David Woodhouse , Greg Kroah-Hartman , Denis Efremov , Geliang Tang , Piotr Gregor , "Michael S. Tsirkin" , Alex Williamson , Arnd Bergmann , Jesse Barnes , Jacob Pan , Yinghai Lu , Kevin Brodsky , Jonathan Cameron , "Aneesh Kumar K.V (Arm)" , Xu Yilun , Herbert Xu , Kim Phillips , Konrad Rzeszutek Wilk , Stefano Stabellini , Claire Chang , linux-coco@lists.linux.dev, iommu@lists.linux.dev Subject: Re: [PATCH kernel 4/9] dma/swiotlb: Stop forcing SWIOTLB for TDISP devices Message-ID: <20260228002808.GO44359@ziepe.ca> References: <20260225053806.3311234-1-aik@amd.com> <20260225053806.3311234-5-aik@amd.com> <699f238873ae7_1cc5100b6@dwillia2-mobl4.notmuch> <04b06a53-769c-44f1-a157-34591b9f8439@arm.com> <699f621daab02_2f4a1008f@dwillia2-mobl4.notmuch> 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=us-ascii Content-Disposition: inline In-Reply-To: <699f621daab02_2f4a1008f@dwillia2-mobl4.notmuch> On Wed, Feb 25, 2026 at 12:57:01PM -0800, dan.j.williams@intel.com wrote: > > (since a device that's trusted to access private memory > > isn't necessarily prohibited from still also accessing shared memory as > > well), hmmm... > > The specification allows it, but Linux DMA mapping core is not yet ready > for it. So the expectation to start is that the device loses access to > its original shared IOMMU mappings when converted to private operation. Yes, the underlying translation changes, but no, it doesn't loose DMA access to any shared pages, it just goes through the T=1 IOMMU now. The T=1 IOMMU will still have them mapped on all three platforms AFAIK. On TDX/CCA the CPU and IOMMU S2 tables are identical, so of course the shared pages are mapped. On AMD there is only one IOMMU so the page must also be mapped or non-TDISP is broken. When this TDISP awareness is put in the DMA API it needs to be done in a way that allows DMA_ATTR_CC_DECRYPTED to keep working for TDISP devices. This is important because we are expecting these sorts of things to work as part of integrating non-TDISP RDMA devices into CC guests. We can't loose access to the shared pages that are shared with the non-TDISP devices... > So on ARM where shared addresses are high, it is future work to figure > out how an accepted device might also access shared mappings outside the > device's dma_mask. ARM has a "solution" right now. The location of the high bit is controlled by the VMM and the VMM cannot create a CC VM where the IPA space exceeds the dma_mask of any assigned device. Thus the VMM must limit the total available DRAM to fit within the HW restrictions. Hopefully TDX can do the same. Jason