Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2880733ybl; Sat, 14 Dec 2019 21:42:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxck9B4rYVCPoreWGSI+xgnGXGm71nEADPf+M8+V010YrWjnh5Ys1btlCXMyO0yJ9aBvQ0R X-Received: by 2002:a05:6830:2081:: with SMTP id y1mr25120936otq.55.1576388544225; Sat, 14 Dec 2019 21:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576388544; cv=none; d=google.com; s=arc-20160816; b=TUh60Gt0qitdA0FanfO1EE3KDD6FwNb43q45bIPp7TAp/69ihgqZpplvk9guV+42uX zLFtalrZuno3OxvshtvKtE8aUAAiCRpXfQoD463zmFvNGkKyBcqwrL7dTNEmqEVyuraw K1+R8N9e+VLj07Uzy1jrPQMedi0LgI0YN1RNUr+gqrHThN6A3LtuSTb2cmoeYRA17w4I iFT5iR4XlPeC3JwPtfzZb+QwIVl79xeFmtw+XmSPWVzcXheW8jZu+1ndWKn+1Y3cGF5f q/gtc3wmu74aTq+lHXQHgZaoSKYfaDKLcFjHLm6+CzYd7ZGTxqZ//rNdmj2/iGOFSpk0 jRjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc; bh=5pYZlVeonULYs/T2Dcn0ogro5WkxGH2iXRuGJlkwGBA=; b=Lvj0TPe8zd91OH4wwMISe4kLKtZuDGWp3lDnmmUtttBtFIMLY8xwuttLuzyeMapR72 LRCHq2wtLvYKFwsCGZ6KgJ/B7C9N04r71MaAxmbgKUo0d14tblL5GCFYxIaSafgL5IEj JsgORr24ysj8rfrsoOFP/nc2umeIKXVgZKrd0rgA7bl8JQeNfBM0E7r8rMniswCEXgyl RcWTFDw5S7G7iKz78wHyAX0NWMvkGVwjmj8nMphxhPeTePlBdC2sbnx8lgsBhiTKw/a6 f7CrCtQWFnbJhI5urXnRF5NXUgtnfCOV/onrJHYYpceyCnXM6WqQezGmVTpfd1deqFgV ASug== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e64si7334236oif.210.2019.12.14.21.42.13; Sat, 14 Dec 2019 21:42:24 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726135AbfLOFkX (ORCPT + 99 others); Sun, 15 Dec 2019 00:40:23 -0500 Received: from mga14.intel.com ([192.55.52.115]:47426 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbfLOFkX (ORCPT ); Sun, 15 Dec 2019 00:40:23 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Dec 2019 21:40:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,316,1571727600"; d="scan'208";a="226735470" Received: from allen-box.sh.intel.com (HELO [10.239.159.136]) ([10.239.159.136]) by orsmga002.jf.intel.com with ESMTP; 14 Dec 2019 21:40:20 -0800 Cc: baolu.lu@linux.intel.com, Joerg Roedel , iommu@lists.linux-foundation.org, stable@vger.kernel.org Subject: Re: [PATCH] iommu/vt-d: Allocate reserved region for ISA with correct permission To: Jerry Snitselaar , linux-kernel@vger.kernel.org References: <20191213053642.5696-1-jsnitsel@redhat.com> From: Lu Baolu Message-ID: <3a9bcdc5-9e78-945d-f6e4-5af6829bf4f0@linux.intel.com> Date: Sun, 15 Dec 2019 13:39:31 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <20191213053642.5696-1-jsnitsel@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 12/13/19 1:36 PM, Jerry Snitselaar wrote: > Currently the reserved region for ISA is allocated with no > permissions. If a dma domain is being used, mapping this region will > fail. Set the permissions to DMA_PTE_READ|DMA_PTE_WRITE. > > Cc: Joerg Roedel > Cc: Lu Baolu > Cc: iommu@lists.linux-foundation.org > Cc: stable@vger.kernel.org # v5.3+ > Fixes: d850c2ee5fe2 ("iommu/vt-d: Expose ISA direct mapping region via iommu_get_resv_regions") > Signed-off-by: Jerry Snitselaar This fix looks reasonable to me. Acked-by: Lu Baolu Best regards, baolu > --- > drivers/iommu/intel-iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c > index 0c8d81f56a30..998529cebcf2 100644 > --- a/drivers/iommu/intel-iommu.c > +++ b/drivers/iommu/intel-iommu.c > @@ -5736,7 +5736,7 @@ static void intel_iommu_get_resv_regions(struct device *device, > struct pci_dev *pdev = to_pci_dev(device); > > if ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) { > - reg = iommu_alloc_resv_region(0, 1UL << 24, 0, > + reg = iommu_alloc_resv_region(0, 1UL << 24, prot, > IOMMU_RESV_DIRECT); > if (reg) > list_add_tail(®->list, head); >