Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp939241lqo; Wed, 8 May 2024 22:53:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXN9aCuCxSu/iaaX2VplEmUlqYt/UAyNrs8ypOaAvchhQbPljH44Om9guGDuAzwCBhUxKhGGuPuD8VnfurskiC0pAidrn8eOJliH+BuVg== X-Google-Smtp-Source: AGHT+IGqElU5TKsWfuSQX0IJFqBkAYUk8m39Gq5BEtPe1Y+d9TIRMHPRfskPygZebF2Lnkd57FDk X-Received: by 2002:ac2:5981:0:b0:51e:76a4:4e6d with SMTP id 2adb3069b0e04-5217cc4f6e2mr2723452e87.51.1715233981936; Wed, 08 May 2024 22:53:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715233981; cv=pass; d=google.com; s=arc-20160816; b=Uy5O1V+7KZfyFKJl/GYYa5UOdpgk6DQvtDodLtkq2aX9NxeYG/zGmHZLMWrIn+SfUf M6l8TBW7ilkATXONa3xRZ/UYlWmyiMd5psUDQswIw6exIxuJhd7M7yeoIjADRTvxU9H9 lny5ixFFSPjzhZrm/39apcXJp+0L+9CkJhawJCQRx52aaAYe4ivn2p8cCy5L4AejozPP VUoordZVqsx/HSel0Sm5eL137wvZ0o2mdvroDAOU4hvm3FLu9IxSEMN3TSPfHqpnpJKh GSuJ28eh/Lu4aD8ZlYjvId3ts9ZlTf+NLWmBgBjoSpYdnedvGaBunp20LHryhOQuV8B9 Ze/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=XpiPVFUL+AaGJMDdFMi7dziozT/Ubs4Tq5hF/a2lG8w=; fh=Mqntj07x6vDRon31g+cNwGfp9M/3mPJ6QTvHVVO1K68=; b=Y4bVzTHYATSPpZiZQ8NBLOJqdCUk1s+izSYCLSaAPm0otDMzaah8tnUP5n9SSl+Tne 8yZEVkfNophcnhdH0CTWEXjrdIeTgZcQadrJv5BxKhawAyMUo3GC4i3i1Jv+j9aq4xnP frpoU7B2gCcSCfwiSISU7FH6FaYdPj6NfQrofo+ntacIob4Kak0AXqXUTEH3d97zgBJR Pd0qjz+f4fV0eG7tFSUknZjwYuJL+NxmF25ss8IBWW6VFQ8NDEZufa148Tvn3XlAjEm/ Eg8OIlJrt+uVdgIKSYB231uS8RQAewbIvhO2mGOQ9XVPdwGh4Kg+ZdgVp8dS5V6VSiH7 2waQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=gHpqON40; arc=pass (i=1 spf=pass spfdomain=tesarici.cz dkim=pass dkdomain=tesarici.cz dmarc=pass fromdomain=tesarici.cz); spf=pass (google.com: domain of linux-kernel+bounces-174172-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174172-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tesarici.cz Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be6645si41079666b.724.2024.05.08.22.53.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 22:53:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174172-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=gHpqON40; arc=pass (i=1 spf=pass spfdomain=tesarici.cz dkim=pass dkdomain=tesarici.cz dmarc=pass fromdomain=tesarici.cz); spf=pass (google.com: domain of linux-kernel+bounces-174172-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174172-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tesarici.cz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1BBAC1F223E6 for ; Thu, 9 May 2024 05:52:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70DB51494BD; Thu, 9 May 2024 05:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tesarici.cz header.i=@tesarici.cz header.b="gHpqON40" Received: from bee.tesarici.cz (bee.tesarici.cz [37.205.15.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4812414900A; Thu, 9 May 2024 05:52:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=37.205.15.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715233945; cv=none; b=UueAXjKCHuKVStP0kF4CY4K6bXaiaG+0lsAhvaCAFNRllLNk9DqvTElfdoRcQ/wtybJbhNVM7StIaxKFD/mRo4sKtMuKIVg2fgDRxRVNdJgLivcqIH15SHtM52oJmACW5RUFtklB076qQBk5rlKFDEbWJGxjcGtLZ81aK3vHxdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715233945; c=relaxed/simple; bh=E0bYqZXYKsYzhCt6xLzwDSqYDsXqTDkvQq1kvUFpseo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Oj3tfD1+XKMWfSFy7KU/YBaisGGKrJNZv8Nh69iwfJEWFCP6TkB2D63kcYwBGzLBfsGV98ilobbABeR8MaEUolfc+C9HIhI7qXOiDWsEF8LbTce1qotBQNdV0dsGfKaHQ6a0OYsLNmyWVGDfif6DTVD0w9T4BCnjnJdwQ0fYQJk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tesarici.cz; spf=pass smtp.mailfrom=tesarici.cz; dkim=pass (2048-bit key) header.d=tesarici.cz header.i=@tesarici.cz header.b=gHpqON40; arc=none smtp.client-ip=37.205.15.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tesarici.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tesarici.cz Received: from meshulam.tesarici.cz (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bee.tesarici.cz (Postfix) with ESMTPSA id 1F41C1C3DAA; Thu, 9 May 2024 07:52:13 +0200 (CEST) Authentication-Results: mail.tesarici.cz; dmarc=fail (p=quarantine dis=none) header.from=tesarici.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tesarici.cz; s=mail; t=1715233933; bh=XpiPVFUL+AaGJMDdFMi7dziozT/Ubs4Tq5hF/a2lG8w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gHpqON40rBh3O0oITSADi1Eh1LZPdaNDKFVDkAL9DmvmC7WzomSKTTwLZilKGxHTf ajJevWgtbi3Fdwn4OqY6Qz/RzNENkDQVLLzSoQ1YhEkOHZvgYFAsicGCMhJZwWQDKG R2WYEXR142Qpq/dpgDJBk2HCn2/UmpubyKSc6FqukPqMa0CJoQAUrcla7TzjUx1hQJ +DCZqEIA4JgKyDH5sMkH4PHmkSeG/ghY/HCMdV//KfGa+lwlQ3UvPZR7z1wb1DxU2T Qi5zSBV8Jy2HzPq5jWX6H6JeqMrlRk0YOT3At+/soXJ7LD2l8wLldaF5S8RyHhuDFk RfHqen49kfmBg== Date: Thu, 9 May 2024 07:52:12 +0200 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: "T.J. Mercier" Cc: Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , mhklinux@outlook.com, robin.murphy@arm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] doc: swiotlb: iommu/dma: Clarify swiotlb=force option applies only to dma-direct Message-ID: <20240509075212.33e521a8@meshulam.tesarici.cz> In-Reply-To: <20240507013502.3095744-1-tjmercier@google.com> References: <20240507013502.3095744-1-tjmercier@google.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-suse-linux-gnu) 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-Transfer-Encoding: 7bit On Tue, 7 May 2024 01:34:58 +0000 "T.J. Mercier" wrote: > IOMMU implementations now sometimes bounce memory through SWIOTLB to > achieve cacheline alignment [1], or prevent DMA attacks by untrusted > devices [2]. These uses of SWIOTLB differ conceptually from historical > use which was a solution to the problem of device addressing > limitations that prevent DMA to some portion of system memory > (typically beyond 4 GiB). IOMMUs also solve the problem of device > addressing limitations and therefore eliminate the need for SWIOTLB for > that purpose. However as mentioned, IOMMUs can use SWIOTLB for other > purposes. > > The swiotlb=force kernel command line parameter does not impact IOMMU > related use of SWIOTLB, and that is intentional. IOMMUs cannot be forced > to use SWIOTLB for all buffers. Update the documentation for the swiotlb > parameter to clarify that SWIOTLB use can only be forced in scenarios > where an IOMMU is not involved. > > [1] https://lore.kernel.org/all/20230612153201.554742-16-catalin.marinas@arm.com > [2] https://lore.kernel.org/all/20190906061452.30791-1-baolu.lu@linux.intel.com/ > Signed-off-by: T.J. Mercier Looks good to me now. Reviewed-by: Petr Tesarik Petr T > --- > Documentation/admin-guide/kernel-parameters.txt | 1 + > Documentation/arch/x86/x86_64/boot-options.rst | 3 +++ > 2 files changed, 4 insertions(+) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 213d0719e2b7..84c582ac246c 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -6486,6 +6486,7 @@ > to a power of 2. > force -- force using of bounce buffers even if they > wouldn't be automatically used by the kernel > + where a hardware IOMMU is not involved > noforce -- Never use bounce buffers (for debugging) > > switches= [HW,M68k,EARLY] > diff --git a/Documentation/arch/x86/x86_64/boot-options.rst b/Documentation/arch/x86/x86_64/boot-options.rst > index 137432d34109..a37139d1752f 100644 > --- a/Documentation/arch/x86/x86_64/boot-options.rst > +++ b/Documentation/arch/x86/x86_64/boot-options.rst > @@ -292,6 +292,9 @@ implementation: > Prereserve that many 2K slots for the software IO bounce buffering. > force > Force all IO through the software TLB. > + Hardware IOMMU implementations can use SWIOTLB bounce buffering in > + some circumstances, but they cannot be forced to always use them, so > + this option only has an effect when no hardware IOMMU is involved. > noforce > Do not initialize the software TLB. >