Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2880732ybl; Sat, 14 Dec 2019 21:42:24 -0800 (PST) X-Google-Smtp-Source: APXvYqzK+Lit9BX8gU+fAe+u79Qw1oWkZINjJzJ45bC+Xl0NzherxEsogPnMp9eDzq7zlvo+NEy/ X-Received: by 2002:a05:6830:50:: with SMTP id d16mr26048581otp.155.1576388544218; 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=duMoc4wonNNdHrkLt+9iYfKawX29s5YbjEv+5LP+7y452ytx3VZATkQYstD1sq3DVi 8LqEGaqrgMitVL0vobDh5T72GgmZVZqJTcer+jMXj2kcGpk63eYWIb0eEWfImXmZaMYF 0zCkfQXFB/01FyY0Yi5ckJWl6T6FNAb8+jbQ7bhTuCGR4Op39go9UvHc8/4LMmtRZ8Op SdzGvwdaKAU+JFCrx3VhW0rSjaLQSKy306u8jCpcAU7NWhmcFE/ysUj2mVqBF2yYII50 vTQXwFI+g65qB49w0PJtPWWmr43vC5fPavL5eiHDbVnaWNt0qHVPliZDbG67khc3cYYI sjcQ== 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=Tidns5sgftLfBDRyxeBBnBJG9FfOO4p+/DU+rGz0mxY=; b=peTmBfPjmkUfeu8ZW62a4OEG4OstWvi3da6udgXhmh1leEYsIjE4ySbTdCXMIImPnO rGIawg0Mij2G44+GJG/KGf7nYpT+HQvzJpoieNzfwzTxEjbRx28YTfNdQED6fx4pmDnh fCxBJGAukeclP/hTf+pw7rr7jShxqf9mqZ6nzn2TQGxzSvTF/vkBQ2ZQgGah9p9XBEe/ UJS8bMEI94qrO2yQD0FeIn4PR2GEX72WK3rdHT/jUZeDk2dR4MIQflKWFG1pC3AiT9sC H91wF3fTKYe0NEw9FghYElvMm1hjcV+xKZmSVnZMfqcxpYkLaNGa9idn2dlbHfKC4uBS ipKg== 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 a2si7576435otn.319.2019.12.14.21.41.43; 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 S1726094AbfLOFjM (ORCPT + 99 others); Sun, 15 Dec 2019 00:39:12 -0500 Received: from mga09.intel.com ([134.134.136.24]:55643 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbfLOFjL (ORCPT ); Sun, 15 Dec 2019 00:39:11 -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 orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Dec 2019 21:39:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,316,1571727600"; d="scan'208";a="226735317" 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:39:09 -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> <5ccaaec0-b070-b820-cebd-6b7ad179109c@linux.intel.com> From: Lu Baolu Message-ID: <7f109c98-00d5-d66c-05c7-70eb670bd1a2@linux.intel.com> Date: Sun, 15 Dec 2019 13:38:20 +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: <5ccaaec0-b070-b820-cebd-6b7ad179109c@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jerry, On 12/14/19 9:42 AM, Lu Baolu wrote: > Hi Jerry, > > 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 >> --- >>   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); > > > This also applies to the IOAPIC range. Can you please change them > together? Please ignore this comment. These two ranges are of different type. Your fix is enough. Sorry for the confusion. Best regards, baolu