From patchwork Thu Aug 13 08:26:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koba Ko X-Patchwork-Id: 1344122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BS06720Bvz9sTF; Thu, 13 Aug 2020 18:26:37 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1k68ZG-0007Zw-5o; Thu, 13 Aug 2020 08:26:34 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k68ZC-0007ZL-H6 for kernel-team@lists.ubuntu.com; Thu, 13 Aug 2020 08:26:30 +0000 Received: from mail-pf1-f198.google.com ([209.85.210.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k68ZC-0007Qr-5H for kernel-team@lists.ubuntu.com; Thu, 13 Aug 2020 08:26:30 +0000 Received: by mail-pf1-f198.google.com with SMTP id f5so3843918pfe.2 for ; Thu, 13 Aug 2020 01:26:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=CgrYh1nCVQnFU3541d8IW7EwRFF0u/V+BhMqk/ulOvo=; b=hWGQpMUQhXlAk9yBff6v7iswhAthx3h6D6UKBVhDQgJL110ov/CWHv851FIkY8MvZ9 sD2dCj5sbssSPmkpoGtFXCyHl1tivUZgVHA/YWceroRVXCnGBQd/XxzcLtbjGGowR2MN yEoTSmjtKeGEiIFSpsrJf6a/ETzLaCCejv4npJpzs2GpCpMy6u9GaUDOF7IYUA9uny8i gpL5R7L2KAuei69TL0bNGMDMuk54MbpqsDrysUrKoOcJJFaPt7Rh1Pkc521bmgoVmbPo sWRIfUiExuTYTYDIMmhnWHxySZhIJRrwc4qkX9zd/nsfOAvkhzG8kuNgVMOwhUPo53Z+ RM6w== X-Gm-Message-State: AOAM533Zyb9v9CioiX7qTMfSxzQ8LUML305rRS8CYt3fi/2GZxl+9oZS fTKjJXarcDz6MzgjDMcwmuy3D0BCiI3mHnaJInA1qBdtjS2EnoVCl7QYxp1Rsne6SkD/BlgMvSN RIO6/5a10ywQAS00ZBb9doi7/2LSDQyZNfMZ23AMhlA== X-Received: by 2002:a17:902:10e:: with SMTP id 14mr2775083plb.297.1597307188607; Thu, 13 Aug 2020 01:26:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqsUMo57YMHnuMk+iwLxxr6nH6W/l7wrX/CIkqFhJQLYzoixTwV1DLZX+YmxF3tYLc/Dp9QQ== X-Received: by 2002:a17:902:10e:: with SMTP id 14mr2775072plb.297.1597307188330; Thu, 13 Aug 2020 01:26:28 -0700 (PDT) Received: from canonical.com (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id s125sm5318444pfc.63.2020.08.13.01.26.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Aug 2020 01:26:27 -0700 (PDT) From: Koba Ko To: kernel-team@lists.ubuntu.com Subject: [SRU][OEM-5.6][PATCH 1/1] iommu/vt-d: Enable PCI ACS for platform opt in hint Date: Thu, 13 Aug 2020 16:26:22 +0800 Message-Id: <20200813082622.6850-2-koba.ko@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813082622.6850-1-koba.ko@canonical.com> References: <20200813082622.6850-1-koba.ko@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Lu Baolu BugLink: https://bugs.launchpad.net/bugs/1891449 PCI ACS is disabled if Intel IOMMU is off by default or intel_iommu=off is used in command line. Unfortunately, Intel IOMMU will be forced on if there're devices sitting on an external facing PCI port that is marked as untrusted (for example, thunderbolt peripherals). That means, PCI ACS is disabled while Intel IOMMU is forced on to isolate those devices. As the result, the devices of an MFD will be grouped by a single group even the ACS is supported on device. [ 0.691263] pci 0000:00:07.1: Adding to iommu group 3 [ 0.691277] pci 0000:00:07.2: Adding to iommu group 3 [ 0.691292] pci 0000:00:07.3: Adding to iommu group 3 Fix it by requesting PCI ACS when Intel IOMMU is detected with platform opt in hint. Fixes: 89a6079df791a ("iommu/vt-d: Force IOMMU on for platform opt in hint") Co-developed-by: Lalithambika Krishnakumar Signed-off-by: Lalithambika Krishnakumar Signed-off-by: Lu Baolu Reviewed-by: Mika Westerberg Cc: Mika Westerberg Cc: Ashok Raj Link: https://lore.kernel.org/r/20200622231345.29722-5-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel (cherry picked from the commit 50310600ebda74b9988467e2e6128711c7ba56fc) Signed-off-by: Koba Ko Acked-by: Stefan Bader --- drivers/iommu/dmar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 19245819f326..a658e68b81ea 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c @@ -898,7 +898,8 @@ int __init detect_intel_iommu(void) if (!ret) ret = dmar_walk_dmar_table((struct acpi_table_dmar *)dmar_tbl, &validate_drhd_cb); - if (!ret && !no_iommu && !iommu_detected && !dmar_disabled) { + if (!ret && !no_iommu && !iommu_detected && + (!dmar_disabled || dmar_platform_optin())) { iommu_detected = 1; /* Make sure ACS will be enabled */ pci_request_acs();