Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp232062pxb; Tue, 2 Feb 2021 03:54:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhzpyjpAyVb5MRe0HnO9SiiG/w2EZXqKLXfTwTr0K0OUZNjn9yhuLZvMRk/SDVmtVVC+FE X-Received: by 2002:a17:906:55c5:: with SMTP id z5mr219609ejp.275.1612266899317; Tue, 02 Feb 2021 03:54:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612266899; cv=none; d=google.com; s=arc-20160816; b=QLRdXuac41mms3TgarkJxjJcb7XhmkvGkfwdE+hoC2c8R1C08OYZ9Tr8oVWlV0jhSE OXuj5sUEIX5fy+wD+qP4Eh7alk/SCP4K/9tLYsFd5XkSivU1QleZolvg4X/5NEZiNT/8 XkYWYg/JGLuRlU9X8RsQgheCSwORkREScoKlr2EdVlu8JD6WokNWqQRAsnPolRThnTIS jwW2yLGcF2KyWU7NgaUq2vgsngO9ptgpv6mdGnC/YTYhtWXLXnlbMLHl0P9bmwcAo4Kx JfHs243kq98JKQtXfgLutmAEFvhHhfS03W0uCXVf3Svc8YkyGlY3rALEMvii8GyPs3C9 fhAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8lnezsGxNtwaizFxkUXlMXWuI1lNzqSiGu+vPlmRlYo=; b=Wn/oW5RQD269YJTxmAsHGp0xL5UbzwDlD9o0R3Yo6ytf8nuH0awWUkeizdgemIPqEg Qre2JXgEDETeXUuH511thRgIFGdbV49WTIkxim3OCmuz0OCeDiZBLQGrI4xONz7JWG9d yU+0LdLSV0fTykSvayRdIr0rQ79jkce8MMPk5G4uP8h97P2UUGe1TAcVBHv2EytQbHBJ Ty/cwPRe+qiZnGogvxE8ieeN2xgIvwROGUFseUcnIWQhTJOKnXmoHqFxJ1Y5ldA4rTbx TTqY2U67cAzaoGnv13eJuVa6CpdokU9Dil1VxWZvR+ey8KP4iIPxZYn7Rk3QxqmMQNvb sYBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OJ8N1X8f; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r30si5839305edi.324.2021.02.02.03.54.33; Tue, 02 Feb 2021 03:54:59 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OJ8N1X8f; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231398AbhBBLxw (ORCPT + 99 others); Tue, 2 Feb 2021 06:53:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:41198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231199AbhBBLxr (ORCPT ); Tue, 2 Feb 2021 06:53:47 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 949E264EDA; Tue, 2 Feb 2021 11:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612266787; bh=BRH68+6vOxOQ4LInf/FRWhZDyh3A94ESv/43pW43Yt8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OJ8N1X8f4o+yVH+a6dN3B/AyPw/cXpDy9CSfhpaCFB9Pa2HmmOTPmoaihArZTNnal TmR/WYbIOe25gnkHYcuWdIdweGqctOyJgUioqJreKa2g9TO4uxZrNsAJa2EbDxh24A xiEodTo2bHyB5/pstyzXoaX6qrNTA/sMppxDmtLo= Date: Tue, 2 Feb 2021 12:53:02 +0100 From: Greg KH To: Jianxiong Gao Cc: erdemaktas@google.com, marcorr@google.com, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, saravanak@google.com, heikki.krogerus@linux.intel.com, rafael.j.wysocki@intel.com, andriy.shevchenko@linux.intel.com, dan.j.williams@intel.com, bgolaszewski@baylibre.com, jroedel@suse.de, iommu@lists.linux-foundation.org, konrad.wilk@oracle.com, kbusch@kernel.org, axboe@fb.com, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 0/3] SWIOTLB: Preserve swiotlb map offset when needed. Message-ID: References: <20210201183017.3339130-1-jxgao@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210201183017.3339130-1-jxgao@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 01, 2021 at 10:30:14AM -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. This > patch adds an option to make sure the mapped data preserves its > offset of the orginal addrss. > > Without the patch when creating xfs formatted disk on NVMe backends, > with swiotlb=force in kernel boot option, creates the following error: > meta-data=/dev/nvme2n1 isize=512 agcount=4, agsize=131072 blks > = sectsz=512 attr=2, projid32bit=1 > = crc=1 finobt=1, sparse=0, rmapbt=0, refl > ink=0 > data = bsize=4096 blocks=524288, imaxpct=25 > = sunit=0 swidth=0 blks > naming =version 2 bsize=4096 ascii-ci=0 ftype=1 > log =internal log bsize=4096 blocks=2560, version=2 > = sectsz=512 sunit=0 blks, lazy-count=1 > realtime =none extsz=4096 blocks=0, rtextents=0 > mkfs.xfs: pwrite failed: Input/output error > > Jianxiong Gao (3): > Adding page_offset_mask to device_dma_parameters > Add swiotlb offset preserving mapping when > dma_dma_parameters->page_offset_mask is non zero. > Adding device_dma_parameters->offset_preserve_mask to NVMe driver. > > drivers/nvme/host/pci.c | 4 ++++ > include/linux/device.h | 1 + > include/linux/dma-mapping.h | 17 +++++++++++++++++ > kernel/dma/swiotlb.c | 16 +++++++++++++++- > 4 files changed, 37 insertions(+), 1 deletion(-) > > -- > 2.27.0 > You forgot to mention somewhere, what changed from v1 to v2 :(