From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (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 EE07037DAAD for ; Fri, 7 Aug 2026 13:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786111097; cv=none; b=go12UkfX+tF2HZNrs7qKMjRPDlsUBv970H+8QlmuXaokY6f1nAC0TIgazaEmrA8QEQAUGIcKYWHUZz4g9tUw1fc8v1lUWt55mxBZw51RTSvEGsuLJIfOc4OUlIJ/YygKD2nn6XwCBHhzBV7846jGNiiWAMkSbeb+uStcbrYZO44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786111097; c=relaxed/simple; bh=zrBhytxcXDNPG0MMxibBNcHjDvvuQV6t6BI7tYVRQPY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bxP301LNp750TapULvG5CGlnxmX4yuGLFiIXR4BAVtakW03xRQmXGuBeBuQrRBxiGaimQbQ3k0GDxEDwALhwNTim+hIrYSdL/Uq/k9L5Nw08AOBFXWSqMWfmesU34uWnPX6eTv6NkdlubVtD5OjxBClN6PKDXh/ET4Ax2+HieJ8= 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=f1zwtco0; arc=none smtp.client-ip=209.85.222.175 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="f1zwtco0" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-92e99ef0902so188243585a.2 for ; Fri, 07 Aug 2026 06:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1786111092; x=1786715892; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=i2ro1loNwbkACqpDIeM0PdgrbNZfsWDTHY6fPjx3IQg=; b=f1zwtco0Spb1KGX/d4YUUD5iwf5/K8pVAXM6jJz5a1HYP4Luw2nOuPkxp3l04gz82S Zbxh0Rj6HM4C0x7A97PcsOfCklVPCR031BtHPqzaJGgzaj+wDKxRwKvtZ+hJmeRRsiul 2UetpBw6g+OsFIRz5Q4T824gBbhl4/p7IbGYbaeAx/gt0Q88xdVekkQ81XD+O7mLk0ev x1SREJU8+ppxeEC3SmzPYqnV6rM0NUd+kmVaxKjPo+6R2gvXrX5e4aiulV5gFHnXubdy r7FVlZ135OO0fQH4HSxDfiuErkDquQIUfCvp91J/LMHnYIdqEGmjx/VpaLKt5H4rCQg+ Ey6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786111092; x=1786715892; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=i2ro1loNwbkACqpDIeM0PdgrbNZfsWDTHY6fPjx3IQg=; b=UDTqTiUJ8udHOnEZr3bAJayyv7i8GPCUyViOaVFya+4gMhiCf0Tq7qo3N9G/55c9Dy 8HLshHJy7JxgaZEMfRS+URh90IAH4OaFV+PmNQ5W7JN1T8+ccIRThxqa6j2jKZNQFcqe DPspEcA18pdbB2pDa6OSQlR4YKMNFQr8dRxyVxdKhwg/Z0A12fZy1eSmjy6lnMSgDyaN QruwDaWxDnJhH9W4T8XqbwhNbaAv0Nkh+nWc/ets46nbxEaQCdf56zdk3Jd3ixAM04Pw JvPUpXK8YifCsinWVtbcEUwuoA6K8gf9PCnVnIcv+htkxShkkswZ69/9uuXU802WWyVS dtLA== X-Forwarded-Encrypted: i=1; AHgh+RrmLRuqinD0hbNOBFMrkH/4O6nJRGNwXZhdoryzksP3CBJAAtVjs1Pht6ChSCPZkC00bE+dboFF5U9gLMs=@vger.kernel.org X-Gm-Message-State: AOJu0YzDLC/60Q9I/hOB9t8o1Mw9tWxXOWzKTv42wdtrwGmZVdU9Jkhu msZFDiqlPHf8f8nAhIZX4183kZZ/khPdbUVVYsSoJoKDAsovXgfua9dP2aZ06sy4ETA= X-Gm-Gg: AR+sD12kgRJEqCUvtexuzkQJIWe/17qaKDvqLjnhEO8cttpinbRoBWeEsAyKWkSs4rj SYuE87JG2b/b8zmWJjlk7z0kZnFgpLgCbfOa5jSaP/4KRrYN19tPRUaI1/pxTuy+vKkfwdUYoV9 8q3/KPizq9KsgMuz99VbrrY/FTamsm0dloVTlsxKnK34rB2pfwNLs/xHzkwZDNNLI8j+TTRPHOA 13kiAlQAD9G3nlYuYPrOPYdietWvNBCHMhWobBReJkBNB4I/VGWkOp53/nFDNd7E4igoyuxu8AJ EJLpZ/qWEh49sLC69I11YHD4LGKVmC0Smr5/KXfVmFEJXxLiCCxVwpMCP8weqpT+99CNF+ixKPa M7d/fLgHUNgmtor2AJV/7T50HtsFmt4BpO8jSCthJQcFMLclvWjHOJ/lHNxK5NgKIbkwIKpshNN RoATXBBeS4yoEymYP4zvV3401ZrppOlUPHbz5oPg== X-Received: by 2002:a05:620a:2725:b0:916:14f5:8866 with SMTP id af79cd13be357-936490191c4mr2577886985a.16.1786111092001; Fri, 07 Aug 2026 06:58:12 -0700 (PDT) Received: from ziepe.ca ([142.166.156.215]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9366e2971d0sm152121785a.43.2026.08.07.06.58.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 06:58:11 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wsL5O-000000012Hc-2aob; Fri, 07 Aug 2026 10:58:10 -0300 Date: Fri, 7 Aug 2026 10:58:10 -0300 From: Jason Gunthorpe To: Will Deacon , Mostafa Saleh Cc: "Aneesh Kumar K.V" , iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, Robin Murphy , Marek Szyprowski , Marc Zyngier , Steven Price , Suzuki K Poulose , Catalin Marinas , Jiri Pirko , Petr Tesarik , Alexey Kardashevskiy , Dan Williams , Xu Yilun , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , x86@kernel.org Subject: Re: [PATCH] arm64: swiotlb: Keep the default size for protected guests Message-ID: <20260807135810.GA200537@ziepe.ca> References: <20260717180442.110954-18-aneesh.kumar@kernel.org> <20260807092612.2202005-1-aneesh.kumar@kernel.org> 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: On Fri, Aug 07, 2026 at 02:18:31PM +0100, Will Deacon wrote: > > I was under the impression that there is a possibility of using swiotlb > > instead of restricted-dma-pool with pKVM. > > Yes, that patch enables swiotlb as a possibility for protected guests > but with your patch we avoid shrinking the swiotlb buffer even when > restricted dma pools are being used and that's a waste of memory. I also thought we switched pkvm to use CC-like swiotlb as part of the alignment in this rework? Mostafa ? > > If that is not the case, then we could change: > > > > !cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) && > > > > to > > > > !is_realm_world() && > > Perhaps, or you could just pass the swiotlb= option if the defaults don't > work for you. Can you give more details about the slots exhaustion you're > seeing under CCA? We see badness with swiotlb too, it basically doesn't work out of the box if you have to use it 100% for real devices. It easily runs out of memory. Auto tuning to higher levels makes sense to me, but I'd rather the core code handled adjusting its size to the estimated need, not arch code. Jason