Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp230444rdh; Thu, 23 Nov 2023 02:18:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDAhEZe+2ypy0W6R0UdPn1C6LolReBI4LI35rsSvjAE5eDoe0+4ri69aXrmZ4bnKOHZl2x X-Received: by 2002:a05:6830:22f3:b0:6d6:491c:3518 with SMTP id t19-20020a05683022f300b006d6491c3518mr5716848otc.29.1700734738857; Thu, 23 Nov 2023 02:18:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700734738; cv=none; d=google.com; s=arc-20160816; b=0+/WpHDRkT4mex4shikZwL598slG5aouer9GIopHuOO9r/jpQBgU1+Qb7BzOokTTSk dS5bBRs4POhpaObW8fSec6QTj0ijZNGDCL0IeMz/9CXaQnePwktTHCS3qAwiMkK0we6H Y10E+RhAAHGlVrHvnHp0eQHcNskczhCu7ku9vjrRBmkYEN5Thy3jAyJW+shtgd7KMK5r LWMoZ3bR68zUedfSl0fyOnHZhHczrsgSajWw6rUDWCA6UAViK3qZyCLhbJV+QkIjw6jW SoX3VFHZNKn8rBEfX/0TolBULZeX5XTYHuKNJpKn+BICn3JW2QybjikibOXRf0hEer5n dd/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=EdicTQ0WVN3Tyr7Dyg1y1koB7xnUE3Se1tRK6oaluOo=; fh=esICj2Hg0Q8gFAnrVv2kJhNBGwtI9Avi9UbQw1WvQd8=; b=klr5SN5VBWbU8/iS0VQE6PifNVAV7avKtNlR2iFo3c6p+2mCq5FWt1Uq5pRgDXey4P DfZ1qPni2Qhm3QrGtCgTkrBZY3dlmWxz9EUmc7RUlJ98rFH8gsjkryzXypt9JRryF8K3 VTp5cR9clXwnbWMXB/5v0BV8ahsCfbWnKkaO08kXata/Bri7DmPYJYoMWRHGvkKvtms2 6knXlX9A6UhjEWiJAXeFQn4HSfA5B2MaiW6LJAue3ICiiEuMyhGDOkuSpFoiSZcMEXlJ 9wOM1PBbRDITRPMnrp5bIY8b3EZy0gzeBRFOQwzmFeLU/iupJkusM8wydbxO/qkkzCmP 8HSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=DDPSK0lG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tesarici.cz Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e36-20020a630f24000000b005ab92870413si1017954pgl.498.2023.11.23.02.18.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 02:18:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=DDPSK0lG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tesarici.cz Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3F6AA80713C0; Thu, 23 Nov 2023 02:16:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234620AbjKWKQL (ORCPT + 99 others); Thu, 23 Nov 2023 05:16:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjKWKQJ (ORCPT ); Thu, 23 Nov 2023 05:16:09 -0500 Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CCE79F; Thu, 23 Nov 2023 02:16:13 -0800 (PST) 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 4ED651A1F9E; Thu, 23 Nov 2023 11:16:10 +0100 (CET) Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail; t=1700734570; bh=IdlZbZ9FL5iny9zKRN7ZMCUL5Jenf+2OfYnJsvJqcig=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DDPSK0lGkfZJHOQZNuLlkLCLbHz1wjzqVXLySg3Q8z8v7t5gijyPAbAiww7BW4rQr X2EHNtMdFNvELQGkgNrK29IfFgUDgjQUmz9dd+wWZuWnxYFT9HUPPY/tIjAr/4Z7Al LCbuCRwmyx01ek0FkLAGYG8vqjsa3KscngzQWmOLXmSMp5woK+anXKMYENadtfWAxO 4mvc7VDKq40/5hTwubz8kifMxUhkDWkl8oEpJYxKuIkSGXypzDhcoE9I4CU5hYWWQ1 4JPUyw025ZJ6Qux1IpbkqUH/wC+OyAm2Y3txJyL3Mm0XJYDyM6WznR/dLWgi1+vEqY AdxDvgM/iHMNg== Date: Thu, 23 Nov 2023 11:16:08 +0100 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Christoph Hellwig Cc: Halil Pasic , Niklas Schnelle , Bjorn Helgaas , Marek Szyprowski , Robin Murphy , Petr Tesarik , Ross Lagerwall , linux-pci , linux-kernel@vger.kernel.org, iommu@lists.linux.dev, Matthew Rosato , Jianxiong Gao Subject: Re: Memory corruption with CONFIG_SWIOTLB_DYNAMIC=y Message-ID: <20231123111608.17727968@meshulam.tesarici.cz> In-Reply-To: <20231108101347.77cab795@meshulam.tesarici.cz> References: <104a8c8fedffd1ff8a2890983e2ec1c26bff6810.camel@linux.ibm.com> <20231103171447.02759771.pasic@linux.ibm.com> <20231103214831.26d29f4d@meshulam.tesarici.cz> <20231107182420.0bd8c211.pasic@linux.ibm.com> <20231108101347.77cab795@meshulam.tesarici.cz> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 02:16:26 -0800 (PST) Hello everybody, I don't think I have ever seen an answer to my question regarding alignment constraints on swiotlb bounce buffers: On Wed, 8 Nov 2023 10:13:47 +0100 Petr Tesa=C5=99=C3=ADk wrote: >[...] > To sum it up, there are two types of alignment: >=20 > 1. specified by a device's min_align_mask; this says how many low > bits of a buffer's physical address must be preserved, >=20 > 2. specified by allocation size and/or the alignment parameter; > this says how many low bits in the first IO TLB slot's physical > address must be zero. >=20 > I hope somebody can confirm or correct this summary before I go > and break something. You know, it's not like cleanups in SWIOTLB > have never broken anything. ;-) If no answer means that nobody knows, then based on my understanding the existing code (both implementation and users), I can assume that this is the correct interpretation. I'm giving it a few more days. If there's still no reaction, expect a beautiful documentation patch and a less beautiful cleanup patch in the next week. Petr T