Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp292039img; Mon, 18 Mar 2019 03:17:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkJoqqQuEMZcIg/STmKHJ4no1a7h6rHjvZClfx/jRqLK+pqzb4/2zm1yz3iw33h8yfjWNc X-Received: by 2002:a63:d449:: with SMTP id i9mr17017185pgj.449.1552904276028; Mon, 18 Mar 2019 03:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552904276; cv=none; d=google.com; s=arc-20160816; b=NQG56VOz7NKxnzMIEUQ4beytrsDq8juilNqByfiakoyT2qOCq7jx1HtWzZLzegBzpP 5mKcM98qGSABuETx7eyXAUjaW4AtPbNUxEM2aq6F/Pr1pzisbUDp8kSoM/nlP8G6JSpc Cb2tz4f4tpskFQV4UpfkGF8M05mlLlBNaQYF1+m7D2t1kjU7Sq922IJRxQp+5AnAJkar SHFT3d1bZ5OnpllgInDRskIw/RR589iDJxWvhGnDYFIeUJPNOO61aETjRONArxc2cZit BkYYb3wMjTvei/OnmA1tQXfoVpvYujouuM1hxEE1SRxl5LFCE43zuEZtLPDObkfgh3vH vueg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=GYJ0tF37p9nQZcVj9LKyrTkB18hY/vaDkitOe14p6cw=; b=E0DqERS8XNn7oXsQiw5TvGwOwVLQocJv8f7C54hXlhRmHJpIkhU8jot3yenDYQeBDg n/Jg2pfaQiYBy5QVfCzJg108sM+1StKUHts/X4yP8zShWcLZcshwr75Tfc9JKPq4TlhD VZqEvBIJVq6RhXr9H5UOcZ9nPuFfrceboovEVgvwbuFNVjo2dTJEHQfArqSDZU4QD781 ZK9xD700plhALJ9DoDXt4NufAVDHMVYDytySmuH1JfwS05nK2+Nw6mgHvUY7H2R3dKei d2fRMI+4oTcoLcqzWk0mVt9FzUiJ7aRxmS2pfzUxnosCEDyoDokTAf3BnGZJFb7nOSi+ Xzbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g98si9148948plb.11.2019.03.18.03.17.40; Mon, 18 Mar 2019 03:17:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727217AbfCRKRG (ORCPT + 99 others); Mon, 18 Mar 2019 06:17:06 -0400 Received: from 8bytes.org ([81.169.241.247]:58202 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726771AbfCRKRG (ORCPT ); Mon, 18 Mar 2019 06:17:06 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id D489D327; Mon, 18 Mar 2019 11:17:04 +0100 (CET) Date: Mon, 18 Mar 2019 11:17:03 +0100 From: Joerg Roedel To: Stanislaw Gruszka Cc: Alexander Duyck , Rosen Penev , Lorenzo Bianconi , linux-wireless , Samuel Sieb , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, jan.viktorin@gmail.com Subject: Re: [PATCH v2] iommu/amd: fix sg->dma_address for sg->offset bigger than PAGE_SIZE Message-ID: <20190318101703.GA6100@8bytes.org> References: <20190228121948.GD6072@redhat.com> <20190228134029.GC1594@8bytes.org> <20190304071037.GA2787@redhat.com> <20190311084319.GA3310@redhat.com> <20190311090314.GB3310@redhat.com> <20190312070832.GA2483@redhat.com> <67c062b183fbd5651a9aa990e677d31673ff7580.camel@linux.intel.com> <20190313090316.GA2663@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313090316.GA2663@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stanislaw, thanks a lot for looking into this and tracking it down! On Wed, Mar 13, 2019 at 10:03:17AM +0100, Stanislaw Gruszka wrote: > - s->dma_address += address + s->offset; > + /* Add in the remaining piece of the scatter-gather offset that > + * was masked out when we were determining the physical address > + * via (sg_phys(s) & PAGE_MASK) earlier. > + */ > + s->dma_address += address + (s->offset & ~PAGE_MASK); > s->dma_length = s->length; Applied the patch for v5.1 (with an added Fixes-tag and a minor coding style change) and will send it upstream soon. Thanks again, Joerg