mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Oliver Lin" <oliver@liuxiaozhen.dev>
To: <baolu.lu@linux.intel.com>
Cc: <iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	 <joro@8bytes.org>, <robin.murphy@arm.com>, <will@kernel.org>,
	 "oliver" <oliver@liuxiaozhen.dev>
Subject: [PATCH] iommu/vt-d: respect user override for intel_iommu=on on Lenovo ThinkPad P50s
Date: Thu,  2 Jul 2026 18:31:37 +0800	[thread overview]
Message-ID: <20260702103137.508709-1-oliver@liuxiaozhen.dev> (raw)
In-Reply-To: <8d131b2c-978e-4aac-88aa-21b39237344a@liuxiaozhen.dev>

From: oliver <oliver@liuxiaozhen.dev>

The current DMI quirk disables VT-d on ThinkPad P50s unconditionally,
even when intel_iommu=on is explicitly requested via kernel command line.

This breaks kernel parameter precedence and user intent.

Make the quirk conditional so that it does not override explicit user
enabling of Intel IOMMU.

Signed-off-by: Oliver <oliver@liuxiaozhen.dev>
---
 drivers/iommu/intel/iommu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index a072e9ef63ef..b34b5a60f349 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -201,6 +201,7 @@ static void intel_iommu_domain_free(struct iommu_domain *domain);
 
 int dmar_disabled = !IS_ENABLED(CONFIG_INTEL_IOMMU_DEFAULT_ON);
 int intel_iommu_sm = IS_ENABLED(CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON);
+static int intel_iommu_cmdline_on;
 
 int intel_iommu_enabled = 0;
 EXPORT_SYMBOL_GPL(intel_iommu_enabled);
@@ -241,10 +242,12 @@ static int __init intel_iommu_setup(char *str)
 	while (*str) {
 		if (!strncmp(str, "on", 2)) {
 			dmar_disabled = 0;
+			intel_iommu_cmdline_on = 1;
 			pr_info("IOMMU enabled\n");
 		} else if (!strncmp(str, "off", 3)) {
 			dmar_disabled = 1;
 			no_platform_optin = 1;
+			intel_iommu_cmdline_on = 0;
 			pr_info("IOMMU disabled\n");
 		} else if (!strncmp(str, "igfx_off", 8)) {
 			disable_igfx_iommu = 1;
@@ -2578,7 +2581,8 @@ int __init intel_iommu_init(void)
 	force_on = (!intel_iommu_tboot_noforce && tboot_force_iommu()) ||
 		    platform_optin_force_iommu();
 
-	if (!force_on && dmi_check_system(intel_iommu_broken_dmar_table)) {
+	if (!force_on && !intel_iommu_cmdline_on &&
+    dmi_check_system(intel_iommu_broken_dmar_table)) {
 		dmar_disabled = 1;
 		no_platform_optin = 1;
 		pr_info("DMAR: IOMMU disabled on Lenovo ThinkPad P50s due to firmware issue\n");
-- 
2.53.0

  reply	other threads:[~2026-07-02 10:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-20 19:22 [PATCH] iommu/vt-d: Disable IOMMU " Oliver Lin
2026-06-21  1:29 ` Baolu Lu
     [not found]   ` <e4deced7-aabf-44d2-859c-d0b0add48d76@liuxiaozhen.dev>
2026-07-01 17:03     ` Oliver Lin
2026-07-02 10:31       ` Oliver Lin [this message]
2026-07-03  1:26         ` [PATCH] iommu/vt-d: respect user override for intel_iommu=on " Baolu Lu
2026-07-03  9:23           ` [PATCH v3] iommu/vt-d: Disable IOMMU by default " Oliver Lin
2026-07-13  1:55             ` Baolu Lu
2026-07-13  2:27               ` Oliver Lin
2026-07-25  2:44                 ` Oliver Lin
2026-07-27  1:31                 ` Tian, Kevin
2026-07-27  3:21                   ` Oliver Lin
2026-07-27  4:03                     ` Tian, Kevin
2026-07-27  4:48                       ` Oliver Lin
2026-07-27  5:05                         ` Tian, Kevin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260702103137.508709-1-oliver@liuxiaozhen.dev \
    --to=oliver@liuxiaozhen.dev \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®