Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp429672ybl; Thu, 12 Dec 2019 21:37:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwOlt5hrgk973RNZ14PANOrEhbQMeSamFQ2PKdDzYkjzPkn7O+DGKSdjWR6je2O959YvaKb X-Received: by 2002:a05:6830:10c6:: with SMTP id z6mr13353558oto.203.1576215463106; Thu, 12 Dec 2019 21:37:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576215463; cv=none; d=google.com; s=arc-20160816; b=QyrSk/amiVMOfgE/qya95sIamuY/KsBFQDqduieMkA1/QuOXGcP5dQrIOctIDMiTDJ LG/IQ8rQ6//jtar3+R8FHtlo2UpubqsB7Y74uoP9xqbmUCt/7ME/4rW8ds35wJggPUJS 1RuNLxZARsqhDZmQEEUcZGdv+VRSLzLnJGoVCydhY14eALjfu1IfsiFW/gSvkY+tC4vU mtLF+EYDjVKhhlGkLUJQ9KWpeiZXoPOFAeGytwfuSeFDlVqdiTlxMWd8LJqwL60pHygO 3kebskMZjxZjloW3MdB+CIqUqj9YVKVtCewmphxoiPJLGJAEXQxl36SN57ny7M60eU6L +nHQ== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=KrRJhXbPmYzxHbKKDmxeVwb2dFiex77QA0exnu3ANOQ=; b=mv23JA0Kl7tZicRXzIHPLnVF6rVBVsG4ft7+LEL4ysMGAm4BrBqE3qLhHw7m0DX563 tjgP+F1GUSX5nyRE9sdlyz7AKGPDOWG8VSqLEAAfdj22uOrDFtIUhmB0DickhlgIkV7e 5tf2mzTg4xg6YQtTNAAso1ww1DP98I39qoRvhuWMglNkbhCM81i0+SePFjQCQxvbHTcT MEer/UaiFnUx0odNNmMuQ1m8jTxpNSrsi88XTJYu92+cPcI/k4pHOitB36J3CO+4PyU2 /l5XlVrLOqfjT6LqbrJ1eoo1YrjTT315wfkhAo9Ykl4zZ4FwWlXE4aa3Ui9yZ+UkBjLc OIPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zl1wMdxL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12si4381823otf.18.2019.12.12.21.37.30; Thu, 12 Dec 2019 21:37:43 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zl1wMdxL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732094AbfLMFhD (ORCPT + 99 others); Fri, 13 Dec 2019 00:37:03 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:57128 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725799AbfLMFhC (ORCPT ); Fri, 13 Dec 2019 00:37:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576215421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=KrRJhXbPmYzxHbKKDmxeVwb2dFiex77QA0exnu3ANOQ=; b=Zl1wMdxLnAK8dQf807kbL5V7VcPqbK/g0M0oxMp2a6F3NDPlI5LkUQOrvZ6Nh/o7n/REgy 0xNGRedluK7iSVjInqMT0QgK0s0Feew/yAR24D5HWNmagJy9+ArYiYoiswLdUxDj2+YZjZ fH0NG7ko/Q+uXq/iOV2wpIqJ0F96OEM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-414-KmzpGEOENaKFrOMYeuCQ3w-1; Fri, 13 Dec 2019 00:36:58 -0500 X-MC-Unique: KmzpGEOENaKFrOMYeuCQ3w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27A361800D63; Fri, 13 Dec 2019 05:36:57 +0000 (UTC) Received: from cantor.redhat.com (ovpn-116-67.phx2.redhat.com [10.3.116.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 073F646E77; Fri, 13 Dec 2019 05:36:49 +0000 (UTC) From: Jerry Snitselaar To: linux-kernel@vger.kernel.org Cc: Joerg Roedel , Lu Baolu , iommu@lists.linux-foundation.org, stable@vger.kernel.org Subject: [PATCH] iommu/vt-d: Allocate reserved region for ISA with correct permission Date: Thu, 12 Dec 2019 22:36:42 -0700 Message-Id: <20191213053642.5696-1-jsnitsel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 =20 Cc: iommu@lists.linux-foundation.org Cc: stable@vger.kernel.org # v5.3+ Fixes: d850c2ee5fe2 ("iommu/vt-d: Expose ISA direct mapping region via io= mmu_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 dev= ice *device, struct pci_dev *pdev =3D to_pci_dev(device); =20 if ((pdev->class >> 8) =3D=3D PCI_CLASS_BRIDGE_ISA) { - reg =3D iommu_alloc_resv_region(0, 1UL << 24, 0, + reg =3D iommu_alloc_resv_region(0, 1UL << 24, prot, IOMMU_RESV_DIRECT); if (reg) list_add_tail(®->list, head); --=20 2.24.0