Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3658057rdh; Mon, 27 Nov 2023 23:16:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFiI1/pT84soVA49f7yqggbTowYzecr1t7rv3r7RyrMfK6ly8qBa1OYm6y64AwONqfzTFtz X-Received: by 2002:a05:6358:999e:b0:16e:1603:25bb with SMTP id j30-20020a056358999e00b0016e160325bbmr14297476rwb.24.1701155795053; Mon, 27 Nov 2023 23:16:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701155795; cv=none; d=google.com; s=arc-20160816; b=AbDObBlr0F8L0d5VC48ElpqDxAMdUAVHovfEEDMrU+esPi6r+Ds7Rxa4O8CBVTUpTF VrNuaNuKnkRYhApwLDfHCVOZ2yOBSi4UeJxh0oHrhF9cN2RXCTsDwkFcxl0YzMUPrjNc Kpn2UoCc5Q5HAytKOtlDAj7QBlgz8UpeJOic7NdkytIOlrXf48tavcIwhw/EtDYRmKa4 DvN2T1XoT5w1mQIwAY+pB2Np6kr01Uii6OU21PM0aFKtv3tSJy3KBnrm4jdELJ+eu3rp fwFzLHoM/ByrqlLVh4Rw79IvhxnEKYbKmVf7Wn07eNK/5crahW9dPbYRPTst1/m4G4EV 1Q5g== 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=0Ij0V2vK3TZ/biAM//tGO8EnPA7M3+ObORvtDfHS0jM=; fh=esICj2Hg0Q8gFAnrVv2kJhNBGwtI9Avi9UbQw1WvQd8=; b=Oevvscl2+Etibzkf/bA+jLSfbJTUQ8pFbk/jD+dAkdXIPCHUeNFbhlhu77TGZ54gZE xnMEA5aQg1Siwz8OWDDIUlH+dRCiXCOOS/QqWm8rK5W4jJkuhZaHTsvaG6Rp9r9JKr7O V7oqWUCGOL4qYG8mhfmedM3bAH4AlwUQeJeAOkJDlQ0vLtHSFVMWxurQGaEmneFunqQq rmC+aqozRJjEnE/LDvJ56MoP8yiXfoXHHZtT8DDM6AWsj6QO9DgQlHhD2sSIch0dwNMt vHLzgzKWQz65qQURWVYF6SP9GzwMRU8UTTMSyHugC43NlERqHSVhL81iwsvHXAFQp82M +7Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=T8vArpDQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h13-20020a63df4d000000b005b99ea783aasi11456476pgj.755.2023.11.27.23.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 23:16:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=T8vArpDQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id D24B3809B471; Mon, 27 Nov 2023 23:16:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343764AbjK1HQM (ORCPT + 99 others); Tue, 28 Nov 2023 02:16:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbjK1HQK (ORCPT ); Tue, 28 Nov 2023 02:16:10 -0500 Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E637138; Mon, 27 Nov 2023 23:16:15 -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 2DFB41A71BB; Tue, 28 Nov 2023 08:16:12 +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=1701155772; bh=s04RxWy3zIlE9UTQSGNYqjvMzSlBKupZZjbzsW8zx48=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=T8vArpDQPUBGqncPtDpRLYD0zqwqLVsKmTuOaiOS3KyrgB0ax2CzPaV7iKk0Klrph 0stWB9AP21JSoozk1FPTDazokzL2anT8AR8kHuDUiYHPmFmCaiA39alAY3x5OMyM2U 3Ba3qT8qbINfzJSKw6uOARNHs3gmjkSt3NBpsePdskqDPY2XPwsdAlfABj+eGL30CP PaTuewKFJNRcx4RfZDBK9dRPfn0NYvkwRxAGQilTYpC72Uj54la8joiRDNe6CK4KyQ ME2QlSC+EjXaxkpiggVUmHbu9ZrNZrQRPVEyo1DWcnDpg2OP6RjOk39RQWHD4A9sxR A7s7m7zw4SiMA== Date: Tue, 28 Nov 2023 08:16:10 +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: <20231128081610.5616ef14@meshulam.tesarici.cz> In-Reply-To: <20231127155913.GA1468@lst.de> 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> <20231123111608.17727968@meshulam.tesarici.cz> <20231127155913.GA1468@lst.de> 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=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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 (howler.vger.email [0.0.0.0]); Mon, 27 Nov 2023 23:16:32 -0800 (PST) On Mon, 27 Nov 2023 16:59:13 +0100 Christoph Hellwig wrote: > On Thu, Nov 23, 2023 at 11:16:08AM +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 >=20 > Both are correct. Great! Thank you for confirmation. Unfortunately, that's not quite how the code works now. I'm on it to fix things. Petr T