From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932518AbdJZIcL (ORCPT ); Thu, 26 Oct 2017 04:32:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54508 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932267AbdJZIcI (ORCPT ); Thu, 26 Oct 2017 04:32:08 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C3617EAB1 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=alex.williamson@redhat.com Date: Thu, 26 Oct 2017 10:32:01 +0200 From: Alex Williamson To: Gary R Hook Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iommu: Limit the IOVA page range to the specified addresses Message-ID: <20171026103201.6ac9f21c@t450s.home> In-Reply-To: <150827532101.76237.2380796046683480798.stgit@sosxen2.amd.com> References: <150827532101.76237.2380796046683480798.stgit@sosxen2.amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 26 Oct 2017 08:32:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Oct 2017 16:22:01 -0500 Gary R Hook wrote: > From: amd > > The extent of pages specified when applying a reserved region should > include up to the last page of the range, but not the page following > the range. > > Signed-off-by: Gary R Hook > --- > drivers/iommu/amd_iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c > index 27eb0d6fcdc2..bb3ef33e3784 100644 > --- a/drivers/iommu/amd_iommu.c > +++ b/drivers/iommu/amd_iommu.c > @@ -3271,7 +3271,7 @@ static void amd_iommu_apply_resv_region(struct device *dev, > unsigned long start, end; > > start = IOVA_PFN(region->start); > - end = IOVA_PFN(region->start + region->length); > + end = IOVA_PFN(region->start + region->length - 1); > > WARN_ON_ONCE(reserve_iova(&dma_dom->iovad, start, end) == NULL); > } This looks like a fix, should we include: Fixes: 8d54d6c8b8f3 ('iommu/amd: Implement apply_dm_region call-back') Thanks, Alex