From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 C347F378D8C for ; Fri, 7 Aug 2026 16:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786121258; cv=none; b=DtfBNWE+UMaC3jIjzk2o2jK9C6zxCOFHtlg6+ooukMkGSoeBnqpp9Y4iWdjT1j9BbZHsAFeXq/N2miGPYreILbSo5SeNblVU//mwHYE3TO5xQK/JbAmHY0tPe4kAqxgxqoJGWovJ9LpF2SLmkPJsVJxdvab3eig3p/FQwgdUUFM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786121258; c=relaxed/simple; bh=7bs5G7VXSiFLS7sfQ/bpcg7JaFFI7guoI5oTlg+tHew=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BBky4JiKTteR4yAc31271iZm1V+1BsY+NpeplskapeNutfSlupEPo3RFthgMi6hyIJ3pp2DpBlObxxuRJdGLXppJ2gBveuY6R9F6weg5dbMc556OyKN0AGx4kN1z7cZzeAiKg+uTL/TisKodP0YAsBl/d4ORSMesMLp1XpIvrYw= 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=DFI8JbOR; arc=none smtp.client-ip=209.85.222.170 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="DFI8JbOR" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-92e533aacf2so201577785a.2 for ; Fri, 07 Aug 2026 09:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1786121256; x=1786726056; 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=+gWaXZ9+2O+1F3TFyj+8MDOiIFSD+n/ei0pL8L1uFmE=; b=DFI8JbORhspWXRivTxh4KgURgbQAlSfXqwfwkqBL+KfaUOsoik34bi7XTMCILqTCYq 7FEBn0/j4OWvaKia9hZ1XUFr7BrVOsyoVB15Yowtb3OTJj4Mt7E9+kBv90XmIXYulThp g2sC1PEcKqojdIvNXUx2Gk6C9kl1csph2AMHj0rT8NHFEefqhTX+GI6S6hXVvycErETt oYegv/UE+lJz60MtS9NFAiaKotZxI3og1sleNdpyGK00dNLVCSfl/WJemyG/ov9B4m9G p4r4iEHSSYspWC1hCqDXP4Vh+n/NNB0GJK+pcPhLHIZY4DW+i7bJZ1C7EHoNTOSvmNu+ FWng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786121256; x=1786726056; 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=+gWaXZ9+2O+1F3TFyj+8MDOiIFSD+n/ei0pL8L1uFmE=; b=Yk3pvsi2DJDmNl8ISzs3tWFwEWx31dPvYZ0E64uPmY6EYVyc7/eGhsLoYy6xvCaZl0 5l7V8IgLVgZang91DcAzSEWhnlEeE+XCtPrXAhP12D84XE98z0laBAwFkDC4whiqnLBr kUvl4kwgJwX5GAmN5atzKnhDth82uzgac/SaFf78EdnrjNv1A3J0CwTmu5BF25S3hFfj Y6ZTF4rwJhuhTtX96FMY26Rz3xVD60PLJ7EANRwPDT3g+3zacZQEo2sggEQi0/7kfHbW f798mrFFg/dnOFbdC0n5MzveFEN8S5PVbRxW/3tod1zN9hnzZqlGG9895M7m8vxTokk4 2u5Q== X-Forwarded-Encrypted: i=1; AHgh+RpSJ+U13k4YJQ/Q5MlyRbrzswdTXsUJYzsR2i/GtQkM/Wkf3eOk1JF2+BezIYYfUOVtXEQn8x42Jmgr+tU=@vger.kernel.org X-Gm-Message-State: AOJu0YyGZXH/R/dipLVqUEOVwaGVUUHOBBxwR1+bv5DOUh66ggIL9fPW bGGLVv6DwBXJBOsS5ZTj8IN/KM8aA0X/L9juEIhXG7lDfr5YJpzrxXTwRlYpGxv2tNQ= X-Gm-Gg: AR+sD125UfPh33Ghmp8d4GXwiyC06ptLKsIVDXCnTOFmyDzu0immBEmRJyFCdIlhjeQ 7p7dQaRaewH8TyiZEPd0S0odnfSxdx5JYEJVBRMPEKEfrCiw/r1uDT2tfzb5Ydm3q4WGL1u6glH 8YAOaFZClsE1jyMhK0JrB4T/Lu25Ylh3q7yy0dvj08HKP2hEoOzOwfnPcdcKNfCDnWGvTa7J3V8 3lvhrxcIqVy6CWmgq6bXMAGKOPpVyGDhQbPdlRsCgiOop/nS37214WgRD0Pumgkm0EcRKAOhfC6 xs1YSM55pHuwWzSqzk5fJIjBsXdr7wdfKkoYMKmD469BP+tI402VFfSw+aSD80Hwzbyo4VmgunF Pd6TFdGmbZFSaVFj96vbP/QPtEx1jdZVHnOx6p7xWnNQAsQ/2a2Ssohqwjw4FPY+TZSzBUETBOZ 2dpYaAqigPJKC2sq4+pmlkIDhA86udncF4X4DH86bZ6J1nA/E8 X-Received: by 2002:a05:620a:2849:b0:930:f2c8:d9ea with SMTP id af79cd13be357-93671f33f9fmr432093385a.41.1786121255653; Fri, 07 Aug 2026 09:47:35 -0700 (PDT) Received: from ziepe.ca ([142.166.156.215]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9366e03ed23sm187954085a.7.2026.08.07.09.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 09:47:35 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wsNjK-000000014w0-1mQB; Fri, 07 Aug 2026 13:47:34 -0300 Date: Fri, 7 Aug 2026 13:47:34 -0300 From: Jason Gunthorpe To: Mostafa Saleh Cc: Will Deacon , "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: <20260807164734.GE200537@ziepe.ca> References: <20260717180442.110954-18-aneesh.kumar@kernel.org> <20260807092612.2202005-1-aneesh.kumar@kernel.org> <20260807135810.GA200537@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=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Aug 07, 2026 at 03:34:47PM +0000, Mostafa Saleh wrote: > On Fri, Aug 07, 2026 at 10:58:10AM -0300, Jason Gunthorpe wrote: > > 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 ? > > Yes, now protected VMs can use the SWIOTLB for bouncing. However for > Android (and kvmtool), use restricted DMA. so SWIOTLB is not used. Oh? Why? > However, I do not think we should over engineer this in the code, > swiotlb can be set from the cmdline and now through Kconfig also. That's fine for android, but real users buying a cloud VM and sticking a distro on it shouldn't be expected to have to mess with cmdline just go get a halfway working system Jason