Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3174072rdh; Mon, 27 Nov 2023 07:59:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEo/m43R7YUmtsOKrQWa6M0UOQyHPmc3xqTAfAMEQx1Opld8vP+VFcWlSO6XoZlPYrtyyKi X-Received: by 2002:a05:6a21:189:b0:18b:d946:5d1 with SMTP id le9-20020a056a21018900b0018bd94605d1mr14344233pzb.54.1701100768768; Mon, 27 Nov 2023 07:59:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701100768; cv=none; d=google.com; s=arc-20160816; b=fKDRGw/3oTIeFfTa3YCRgOEsFBN7/ydubG8hTmveMlYVEEajxTs54OK/QQ4Xu0T9mA j+DOHcqvmRy7Ll84PaP64vVBiFgRK5u/N2fuLOlw+CQhYIKY9uIoV1NrGvwsJusqWQIw 2kpS0bKaWXY7WCnBH87GDeE5imYDfIWgmwwTQslCYDHKPkmZpuLv4UTFtWXa+wDBbMhX cpIHMsxIxcUpRzlMh4zIY9d/Lb3IwC7rN161pYcDXPNaNm+7s0zCVQV3RANAxKvC8gaS hwa4hi/bWm0OZ39zgNKyliCXtCunpgjmEwnTWL5IMuoK3C181mb+neSpQRTwBChzRuOH 7xrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tUgq9Lh2WcUaeiZmtRT3FCB/gicWhBSDb80oTN4/dCY=; fh=Fr/y41wOpDknSLbaDCK+i7K+sVHWnZRBUcI5umBZuAQ=; b=yqA5Vr+I7tkBTnX3l0D5TVgoq9I6ybhkD9HPqbHg7mJmh4h3llQ1G0m12H7oFbYcku j5jKLEUYGW0X2s3OCJb1qkHfz99lBcQD2oDpjKT13aM8yI74bZ3Qw8H2iOxylA72bI3F NBKlPfEAGQG2T7wa67mHZC4ajLQviE/i/RJmjLxKfQed47xPEhsUFO38o2VKs2ro3xAU u9Yfomn4HS7+OYLpcc6A9V5DJeEawUFbdjeYGlwrQPKGOeAFFcIS5At/a/h0uYGZuTpK YVFrU4StJiAvmm643vPCjjUSqiCFXvlM26YR/1gR8VvVgYOK98JUP/9MpTjdDgYNTGp+ StEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id by6-20020a056a02058600b005ab776a4d4csi10719479pgb.610.2023.11.27.07.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 07:59:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 64F65807C761; Mon, 27 Nov 2023 07:59:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234207AbjK0P7M (ORCPT + 99 others); Mon, 27 Nov 2023 10:59:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234265AbjK0P7L (ORCPT ); Mon, 27 Nov 2023 10:59:11 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC7A81A1; Mon, 27 Nov 2023 07:59:17 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 9629B67373; Mon, 27 Nov 2023 16:59:13 +0100 (CET) Date: Mon, 27 Nov 2023 16:59:13 +0100 From: Christoph Hellwig To: Petr =?utf-8?B?VGVzYcWZw61r?= Cc: Christoph Hellwig , 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: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231123111608.17727968@meshulam.tesarici.cz> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-0.8 required=5.0 tests=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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 27 Nov 2023 07:59:26 -0800 (PST) On Thu, Nov 23, 2023 at 11:16:08AM +0100, Petr Tesařík wrote: > > To sum it up, there are two types of alignment: > > > > 1. specified by a device's min_align_mask; this says how many low > > bits of a buffer's physical address must be preserved, > > > > 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. Both are correct.