From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (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 EAEB2221F15 for ; Sat, 28 Feb 2026 00:28:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772238492; cv=none; b=k7HI2Yb1YDFwDKk4lkXlhEuikpULSEjtyyiHT+YLg8Rbv5CIetPLo9gl0wyrixLa6xuVGBwH2prhjYKpUVw808ij5jhsxSmKaoE4PLu9rdIkGC4abTq2VthdfXd5iyqOexWK4Wgp6lc9JvuKWwIJpYbhIb+UMoZYUUZGqVgqcH0= 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.52 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-f52.google.com with SMTP id 6a1803df08f44-899a917a4feso44119596d6.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=IGnSHGuMqkg/8rf3ROHR3hQ23J2pqukdRnb+XlBAlf2uYdOXPMB1hs+IhiK1+H6G2g PrcG3FJ7hQdtn0nu4B2dOv+IkFjo22JJuvf5xzPxkQV8aBfiC92yMf1bAXeJhUlvOdMN +a55RrfhrPzb7CeV60skKkFWaFWn9sGyLJCa1QJqETnZvahLnEFaGc6Zp4SrgS+/g+12 O/2bxVybNrtzHld+IlWcDZBD/HnE526RMBlAdvsD5LfbXjihPnGccYFfpgU38B7uMPxF pAHuPMajaMlf1Lyjo5p3EW77vTP5sRKWn9ZzMTOjBPBvgkbcFjWnZA/hWOjloEypcib1 YwlQ== X-Forwarded-Encrypted: i=1; AJvYcCXnlan/HzzLjrv5wmCzbMtDYAQfvQOmrHRFiUAwKcOMVFH1gv39h3ifRtUCAnVkMgCyABs=@vger.kernel.org X-Gm-Message-State: AOJu0YzFHsJHb2b1nHpOdgB5UvkHvtO5iNUWovus3LR0s3XgCJ8slZdW R4ou++nF3Qgli+2uPGIIQSSycs5kxTNNKlYpgwmRL2V5jzLiFshj/4fd6sFFC/2fHBE= X-Gm-Gg: ATEYQzxQ/MYjOg0LrZnLgHLYd8K5LajLGDF3HVKnDGgvqVcRVXeCcFv27vtJPcoemPx nfAaATYExvB937Pxx1J6ScHKGByVcKPq75SA91CgFBNd+IhApGo9V/O/BWRDgT7IltjVgmIaPvR TPkw3lyAdnCl5VL9tzrsK5apMDdjtX46NwiIe/l6/ZDQh55lt9O0oRVlj+/v44y0Flq3DGcH+it BD1ot/jL/l96OPjKbg3Z8PsERSmwGT1YlELPB7+p2E5ls/vIzLB7RQFhQ84sca/k6kXs1ub+f8n r6hg0SIoMnaTisMFXd0aNaMOD2tetMQhwRIlb3cEGaH/juXXdYma60O9dz8qNrAzp/sh4tPgfbD ITiIptmHIWQZd5gdGrIM9IgidKPMU8ZWGtXJ00fjiBU1TsTQxu4patWzuTuGe7UJzFye3sQApOr JnfShVDiLACvW6yxIzCwoYlMIY55Yxsr7Xt2w31zTdnGcH4r/x94BGTt9h7qd/DTWEU4BuYyuEk DZYQg52 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: kvm@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