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 BE043377567 for ; Fri, 7 Aug 2026 18:20:19 +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=1786126821; cv=none; b=nz54UeRbNriw8rmj9pJYz2KB3nOwQ7f+brkBsr7tW0Ko3tLnz9GUlxttFEdTKU5N5npvqI357Fo8Q/w+qGkns1wdFgRyjyJxSCzpYcNsXDcajyltNSMsqf3BAgI8qdXjzx09ASGZkZSEUgxpMV4CFTOQsrXtX3K1xV7FmDbNeO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786126821; c=relaxed/simple; bh=uQJoR9F+JTLHFeALKkUq+Q0MNEImv4dProP3GHVEWS0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NzKSZ2abahAHzZQPGuC1lLfKN5ExOW9edV7U4UMdaG9V0/Qc7qhufL2waWubfyfcK8LyHN/Zj+2rgXHIWMkyBvlA4C0KcnVEgCjAffXZ2kXou54RFaqs7xmYIaIFgTvctvnrE7BStPN/DNwP6zhgdgT3yERft9R9oeqEPaukDgM= 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=gobB/266; 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="gobB/266" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-92e6c4a867cso250135085a.0 for ; Fri, 07 Aug 2026 11:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1786126819; x=1786731619; 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=uQJoR9F+JTLHFeALKkUq+Q0MNEImv4dProP3GHVEWS0=; b=gobB/266UURhr/KKQGN5iI83m6iRcbjU82uIunv36GYQBQprtygYtoAzBaYHTYozyQ gHwa1mmkek21PN3rw9rUejICAnV+X/eeqmzFOgoh5/1ANykxwiA8+fOUWxWg+jIsduKn +eMKc1RIo7t0v4YvkW0AI+MhLkaqWnw5SKNwvY549eZ7NjzB8jeT22dAKJlBAb3BI8po bsY4sra7r4Q4DNDaSi905L1ZaXBuLiYiu9pqKcPXVKj/J+xjBsLp/DLbtgQDq8RwiReP MC3BnVxaEZ+UbL7m37RNgwhLpYe3+T2r3cUbG55Y3wem+2MV3d0pl1DT8s05oub//tm4 /T2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786126819; x=1786731619; 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=uQJoR9F+JTLHFeALKkUq+Q0MNEImv4dProP3GHVEWS0=; b=XX40BR7k0PMg8tTvLqbyKgyg/9eoNOWSQhpT+EXrDEir/tkur9YZX8b7qOw8SiEioY xKO++OFymcr8DtBrRXzgzb3Z2f8iUmM/gIv6MX8UqprsDqpRttLa8meq2yZlGYWMDq/+ L9sSLHDQF+Te5AdqLd/fFHZesHNHCMAM9OXITicioTi3fwGpq06M39D8d7Ad9YOGxcgI HUclVB2KBBLeWeH3s5bE+Y7/d+CFplSDcOdD1tgBkoQs/E8kEv9j5nIXGkYYIWFGBvdO W7XVxQVCvbqZTSezsQeW55UW+wxMtZqt8cQKcVXI4K6BBYv9BeYw6w5STfgcb80msFCT 45JQ== X-Forwarded-Encrypted: i=1; AHgh+RpAHoInXKdZqTxkfPa20RysDUvqAZndXiTQwv61CTOjcP4oYDrLtHWcNhoG4pUeXy1UsUgDXyijFneVpA0=@vger.kernel.org X-Gm-Message-State: AOJu0YwkuCPffzI3dw5eHUVRvWqSxzJWgp/qSbLsWnpWrSHotc0LpalR OQ+IaOrQkXi3+GzSSsyUJqsFfexKhmJ5jm/E7WhUq0ilwmw8ftPMEaa3+9zRwTMDfZQ= X-Gm-Gg: AR+sD12W/VrXAF3QEAaCfvRuH190dgUqnontggB1ZeIX0xbZIrZZ8yfjzWmCK4lMbqb 11RxrKkatRH94eHlw94FUmF7O9Q+WkZmKc61CnhNKo4v/DpVPGtz6PUgde4kXHw0SaOlK9rSK7K 8D6/JpOPNExk5YqNfsJ+EjISiB2xOJwBuQ2jTBi2LAb/T5dIJx7/PmXGGUf/+fmjW609KUWlnWA YcKzHahPofrQ0CPYZXtRMRQ+VvoJ0BfLicUVfF5IdscZWI68yOj/yVUwDIcSukeLTyHN8Y+h54c kZ+udQ6ubPlx5q0dD55Zy7H1JPoJGSWWPW1ttfJ2l7otexDB0NsjmIgkMyAXW0kLVNhelbyFnBT O4OvRT2+9Uk2ZIKb+S4vWjzhW4m6EbwQ8luk/6TVNNMDMXKc+RcafMLSk01rsQ51Lj13J5uMRh1 VwSNyAo5tz+hWeQQXLHIBwn5eRv96a+KBaNn42pOTb8L0u5hI4NFszilv5h6hF X-Received: by 2002:a05:620a:628e:b0:930:a38d:4030 with SMTP id af79cd13be357-93671eae149mr628522585a.29.1786126818655; Fri, 07 Aug 2026 11:20:18 -0700 (PDT) Received: from ziepe.ca ([142.166.156.215]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9366e02d54esm204051085a.6.2026.08.07.11.20.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 11:20:18 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wsPB3-00000001Bmx-1xNi; Fri, 07 Aug 2026 15:20:17 -0300 Date: Fri, 7 Aug 2026 15:20:17 -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: <20260807182017.GH200537@ziepe.ca> References: <20260717180442.110954-18-aneesh.kumar@kernel.org> <20260807092612.2202005-1-aneesh.kumar@kernel.org> <20260807135810.GA200537@ziepe.ca> <20260807164734.GE200537@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 06:13:49PM +0000, Mostafa Saleh wrote: > But the whole thing is best effort anyway, the kernel picks > IO_TLB_DEFAULT_SIZE which does not depend on the system topology or > how many devices or how much DMA they do. > SWIOTLB memory is wasted if unused so we should be careful around > that as it would be the other way around and users would have to > decrease it manually. Yeah, it is why the arch code shouldn't really be sizing it directly, it should be done in common code and, yes, we are probably going to have to do something alot smarter to have the common code better auto-tune this for the CC case.. Jason