From patchwork Thu Jun 2 06:32:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koba Ko X-Patchwork-Id: 1638221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=m+09xeuP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LDGRj5T3Pz9sG6 for ; Thu, 2 Jun 2022 16:33:20 +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 1nweON-00031W-Vp; Thu, 02 Jun 2022 06:33:11 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nweOI-00030M-43 for kernel-team@lists.ubuntu.com; Thu, 02 Jun 2022 06:33:06 +0000 Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id E10663F194 for ; Thu, 2 Jun 2022 06:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1654151585; bh=5RCdzk/JhkRDcOSncELGQYBfcxGPjLM+e1GXFbtHM5o=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=m+09xeuPYpVhQRe5zKxThoAbug4PRLGC86zANUO1wizVYEcaNg+yomqTeF5x5N39g nAJh6OA+qRnpma6jwDI15HILmMK869O5H07x/3hPi1cbUehYXeoA94sQw7i2E/bySj GFnuzbhsYeDf5PIIkhGjlS1d2e8Xp2Ja7ZtT/Z9KaiqkAX7NQQG4AJs38hm4s4UVVT FEDHxPAwQHK8grfBrrFEhJofYdzBebsdqdW4SThxVeF67+cErBQxSVU/nhAkX2dreo 4Xi+mHOgoeP1AS61y6Crvmp9rKImJtHV/IILlPtsV1oN15lVx48HSXR5MC+MkzdjBV R11EE3brLmYcQ== Received: by mail-pl1-f199.google.com with SMTP id i8-20020a170902c94800b0016517194819so2108083pla.7 for ; Wed, 01 Jun 2022 23:33:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5RCdzk/JhkRDcOSncELGQYBfcxGPjLM+e1GXFbtHM5o=; b=FDkVW+P/Kp7EAsjFE9IRMVNA5cPirKQNt2zjfaqsCw8DtF82WheeFHdeZYTK2BYbEk iQRLyXoo4F1A/HZlcYgBUII8llCkrQ/3lVOOlMJpvqYr0HRn32pos+nPl4SZVDv/RSqt Acw8aVBVPl0FtPRrRmhzJZ2ZaXGayHU/Go/tZIQE1jYkcb/GAIfD0blzouzHk6JCHhm3 2HoGoHNtWN+MqWukl5KBNYhdHzS23gc5HVRWtSiHX460XbI8bTpZLf5Ae3jYKUpUiV8i QaC4qnfDhKnJPmaYdbu2GzycxRkotueWSPELunUY+C3QB2YjPlyT9PbYo6H6HMZ0D+I+ kq8Q== X-Gm-Message-State: AOAM532VUVNFNkrsujBrCAdLWl3JxevZ0kEYqgApg8hvMp1nge2bOMND igXBRtg/PViVTjBiCtoqZNeD24cc5EE5/xMSXRYpKYY8p4susg4xJmNLaCC1fvd7KfZAr4XLPZt fuW/N0WClba8SjOFdpvCY5zMyKUOsF1MgUwBjkccumQ== X-Received: by 2002:a63:8043:0:b0:3fc:d9e7:2357 with SMTP id j64-20020a638043000000b003fcd9e72357mr1955481pgd.405.1654151584279; Wed, 01 Jun 2022 23:33:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpwY6rJ4/EZ+ogqUFuAw4CuRc2VaRsHgo6eEJkaxSjRiK0RcSNdtt73tfwd0RQvmY0fdMrug== X-Received: by 2002:a63:8043:0:b0:3fc:d9e7:2357 with SMTP id j64-20020a638043000000b003fcd9e72357mr1955462pgd.405.1654151583894; Wed, 01 Jun 2022 23:33:03 -0700 (PDT) Received: from canonical.com (2001-b011-3815-1799-c8b3-3945-38ee-fba9.dynamic-ip6.hinet.net. [2001:b011:3815:1799:c8b3:3945:38ee:fba9]) by smtp.gmail.com with ESMTPSA id k1-20020a633d01000000b003c619f3d086sm2405197pga.2.2022.06.01.23.33.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 23:33:03 -0700 (PDT) From: Koba Ko To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2][SRU][J/U/OEM-5.17/OEM-5.14] PCI: vmd: Assign VMD IRQ domain before enumeration Date: Thu, 2 Jun 2022 14:32:58 +0800 Message-Id: <20220602063259.43781-2-koba.ko@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220602063259.43781-1-koba.ko@canonical.com> References: <20220602063259.43781-1-koba.ko@canonical.com> MIME-Version: 1.0 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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Nirmal Patel BugLink: https://bugs.launchpad.net/bugs/1976587 During the boot process all the PCI devices are assigned default PCI-MSI IRQ domain including VMD endpoint devices. If interrupt-remapping is enabled by IOMMU, the PCI devices except VMD get new INTEL-IR-MSI IRQ domain. And VMD is supposed to create and assign a separate VMD-MSI IRQ domain for its child devices in order to support MSI-X remapping capabilities. Now when MSI-X remapping in VMD is disabled in order to improve performance, VMD skips VMD-MSI IRQ domain assignment process to its child devices. Thus the devices behind VMD get default PCI-MSI IRQ domain instead of INTEL-IR-MSI IRQ domain when VMD creates root bus and configures child devices. As a result host OS fails to boot and DMAR errors were observed when interrupt remapping was enabled on Intel Icelake CPUs. For instance: DMAR: DRHD: handling fault status reg 2 DMAR: [INTR-REMAP] Request device [0xe2:0x00.0] fault index 0xa00 [fault reason 0x25] Blocked a compatibility format interrupt request To fix this issue, dev_msi_info struct in dev struct maintains correct value of IRQ domain. VMD will use this information to assign proper IRQ domain to its child devices when it doesn't create a separate IRQ domain. Link: https://lore.kernel.org/r/20220511095707.25403-2-nirmal.patel@linux.intel.com Signed-off-by: Nirmal Patel Signed-off-by: Lorenzo Pieralisi (cherry picked from commit 886e67100b904cb1b106ed1dfa8a60696aff519a git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git) Signed-off-by: Koba Ko --- drivers/pci/controller/vmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index eb05cceab964f..5015adc04d191 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -853,6 +853,9 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features) vmd_attach_resources(vmd); if (vmd->irq_domain) dev_set_msi_domain(&vmd->bus->dev, vmd->irq_domain); + else + dev_set_msi_domain(&vmd->bus->dev, + dev_get_msi_domain(&vmd->dev->dev)); vmd_acpi_begin(); From patchwork Thu Jun 2 06:32:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koba Ko X-Patchwork-Id: 1638219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=e4w2f79e; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LDGRj5X58z9sGG for ; Thu, 2 Jun 2022 16:33:20 +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 1nweOO-00031j-4J; Thu, 02 Jun 2022 06:33:12 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nweOJ-00030u-U0 for kernel-team@lists.ubuntu.com; Thu, 02 Jun 2022 06:33:07 +0000 Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B10373F6FE for ; Thu, 2 Jun 2022 06:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1654151587; bh=2ln6eXTefQuycQyZtei5F+yfhruH43gm8WDWzxj9Uyg=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e4w2f79eDrXw6/ahzhrwRfDT6Ue5CGFXnPP0vOHrrzf4F9mTg60Gkm5HFZfW+xM83 tXYAvBG8MLHxFCNMkiq8V1PamxTQ5pKdq0yjkjHxPjD0bah6173MXg3fxgThFyuZnC W6bpevSsVXMbm1n238cNW4UbD80sGYtOg+46pPZBNi2MNDxv1sSvp5rIbzGvLu3kMD ebVwgKeJiw3r9I4IaDFVMtTHKtoCmPfEufy68cMPAboxobei3bQbx84lQAbes0H7uX KB+qLiBiSsVOWfjApOEql+GjQgiLr9oXslBcSGU6h+svlk/7ZbGBaDaZCavRI8T0C0 u+5BMnrZNUC7g== Received: by mail-pf1-f197.google.com with SMTP id q12-20020a056a0002ac00b0051bb2e66c91so2170799pfs.4 for ; Wed, 01 Jun 2022 23:33:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2ln6eXTefQuycQyZtei5F+yfhruH43gm8WDWzxj9Uyg=; b=GV0h5wIyD/1uxuQ8Arb17g79scNhEBHFQEEQvrMnAQg4UaIWd0ejinkNR1it4v5I3p S5Uaj16GhXGcjp2z52IBSaJR1YIX+qQB59jRZwno+W+lkV1u4sTiRNnReVoEiNNO7Afa pjaTditXVpRi3o7nS0sZn26Le3ig9dN+n8dEiWEUWGf0oQZXyhpCYmOgGLFqVqKhTz5O Jm4ehIkaqVF2H14xJ1FiTtntMXRqwbR2ZzH7X3Zl5BL/409qzqD9tu018L/B8FNx395G xFSg8SMr+6pPoNw1iJafekLdIbmF1qpeAzzAttdsaXDta3jq4pHNDGz5L9J0EWajdhsx D5ZQ== X-Gm-Message-State: AOAM532lqTQN6QEfvjUSiQnKi5ppJyE4O4pwr3dFmt3+7BSni5ljT5jp vdTgigfBRYBbetdDW/3dhDBj48WO6j3bmkAIojFuNOy7jIuBoeQ3kOZ4v+0/2Rm9FIATxtnkCab SRyrayAxH6XtnBnd4Q3qisqmSNmV8yaeJr0faY7Ryww== X-Received: by 2002:a17:90b:38cc:b0:1e0:1c6f:d3e3 with SMTP id nn12-20020a17090b38cc00b001e01c6fd3e3mr38400103pjb.86.1654151586115; Wed, 01 Jun 2022 23:33:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd5++DxGaKv0f2sr+tP592L595Q6qEvzupZSJW1Tn9gPnPoogG4RYZ1vhGV54o1q9+QPFARg== X-Received: by 2002:a17:90b:38cc:b0:1e0:1c6f:d3e3 with SMTP id nn12-20020a17090b38cc00b001e01c6fd3e3mr38400064pjb.86.1654151585689; Wed, 01 Jun 2022 23:33:05 -0700 (PDT) Received: from canonical.com (2001-b011-3815-1799-c8b3-3945-38ee-fba9.dynamic-ip6.hinet.net. [2001:b011:3815:1799:c8b3:3945:38ee:fba9]) by smtp.gmail.com with ESMTPSA id t21-20020aa79475000000b0051bbe085f16sm1227566pfq.104.2022.06.01.23.33.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 23:33:05 -0700 (PDT) From: Koba Ko To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2][SRU][J/U/OEM-5.17] PCI: vmd: Revert 2565e5b69c44 ("PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU.") Date: Thu, 2 Jun 2022 14:32:59 +0800 Message-Id: <20220602063259.43781-3-koba.ko@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220602063259.43781-1-koba.ko@canonical.com> References: <20220602063259.43781-1-koba.ko@canonical.com> MIME-Version: 1.0 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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Nirmal Patel BugLink: https://bugs.launchpad.net/bugs/1976587 Revert 2565e5b69c44 ("PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU.") The commit 2565e5b69c44 was added as a workaround to keep MSI-X remapping enabled if IOMMU enables interrupt remapping. VMD would keep running in low performance mode. There is no dependency between MSI-X remapping by VMD and interrupt remapping by IOMMU. Link: https://lore.kernel.org/r/20220511095707.25403-3-nirmal.patel@linux.intel.com Signed-off-by: Nirmal Patel Signed-off-by: Lorenzo Pieralisi (cherry picked from commit c94f732e8001a860b42aa740b0a178a29907463c git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git) Signed-off-by: Koba Ko --- drivers/pci/controller/vmd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index 5015adc04d191..94a14a3d7e555 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -813,8 +812,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features) * acceptable because the guest is usually CPU-limited and MSI * remapping doesn't become a performance bottleneck. */ - if (iommu_capable(vmd->dev->dev.bus, IOMMU_CAP_INTR_REMAP) || - !(features & VMD_FEAT_CAN_BYPASS_MSI_REMAP) || + if (!(features & VMD_FEAT_CAN_BYPASS_MSI_REMAP) || offset[0] || offset[1]) { ret = vmd_alloc_irqs(vmd); if (ret)