Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp43869pxu; Tue, 24 Nov 2020 18:04:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzezgrhEmC8ZWj0CfduD5HSzNVKOwesayYoM1j+YOALQqEQaCkxOgJOV5NaAnQw3rDfxbWH X-Received: by 2002:a17:907:3e85:: with SMTP id hs5mr1195309ejc.548.1606269849017; Tue, 24 Nov 2020 18:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606269849; cv=none; d=google.com; s=arc-20160816; b=lw1Ri9JHipo9fAdxx8AX0ODiLJ2hz67uP2OkMFlKFLCjeRs9vKq1/pAyLZ4jFdvgyj QXXLstJJV6nrz/qbYx7r8ZFf8MccuzzsOco/s0g9rhxGbob/OFc/FxEY4HSpDlaxjQe6 j+UOZfijFz4Kf0fRLXLkvm2RiUbHLUW3LKpRbpNVC18vYpgNGNifcsVa6qELD7gi8HPw 9NcYOmwMM8XEdHNlBipKwaYhCVyGDSvNMDl0qo/UjEzJjbq2nuGipzyKnxuy76rPKQoY HFkr1pkvGBYPzkqS6Oo8xkBpLbVgsyuQ7zkFJr0kdIIdSjz2rcUkfGEkTATzUagbIcW8 eRBg== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=3+MAzLfOvCtM8mXS20GEg6QxtrHcBdlVhrbYwwfuQsA=; b=dM1FhLhbOrNDpJdo8PrmlqhXOy0oMxmYY3At0CJyYgcGU44V1g0Lh2dK/WozMKsnf9 L6ZEI2W+kpYwY1XrFjINqQMighyMf8I2vKfDEGWXbRzYa+cqag5ltYuTnmar8xtU0ahG ntYiZArKVDLWVayOyVtQ7rwtvpBqGiNLCoeEulwGOLtHpASCagANedw54mjLJe+BYj2U pTWAp81AtSKYBgdXDKXE4jxQPU/Q8n7NCVx4BHtCsBIvjwhY7RrkxpZwDzN1E0yUaowx AOWPbOvsbdS+K8wTgAkAQ34KatYSJZlAk+y9lCKluKh5J3qVV8l2uxmW8FkFk7qsRFjq XVyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn28si414471ejb.585.2020.11.24.18.03.46; Tue, 24 Nov 2020 18:04:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733017AbgKXLtM (ORCPT + 99 others); Tue, 24 Nov 2020 06:49:12 -0500 Received: from verein.lst.de ([213.95.11.211]:54156 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728491AbgKXLtL (ORCPT ); Tue, 24 Nov 2020 06:49:11 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id E3A5F6736F; Tue, 24 Nov 2020 12:49:06 +0100 (CET) Date: Tue, 24 Nov 2020 12:49:06 +0100 From: Christoph Hellwig To: Jianxiong Gao Cc: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me, m.szyprowski@samsung.com, robin.murphy@arm.com, konrad.wilk@oracle.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, David Rientjes Subject: Re: [PATCH] [PATCH] Adding offset keeping option when mapping data via SWIOTLB. Message-ID: <20201124114906.GA22619@lst.de> References: <20201123221807.3344263-1-jxgao@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201123221807.3344263-1-jxgao@google.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 23, 2020 at 02:18:07PM -0800, Jianxiong Gao wrote: > NVMe driver and other applications may depend on the data offset > to operate correctly. Currently when unaligned data is mapped via > SWIOTLB, the data is mapped as slab aligned with the SWIOTLB. When > booting with --swiotlb=force option and using NVMe as interface, > running mkfs.xfs on Rhel fails because of the unalignment issue. > This patch adds an option to make sure the mapped data preserves > its offset of the orginal addrss. Tested on latest kernel that > this patch fixes the issue. > > Signed-off-by: Jianxiong Gao > Acked-by: David Rientjes I think we actually need to do this by default. There are plenty of other hardware designs that rely on dma mapping not adding offsets that did not exist, e.g. ahci and various RDMA NICs.