From e0828c84e6ececdfe83659d2c4d0f07e658aaaa7 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 27 Sep 2026 21:44:11 +0200 Subject: [PATCH] linux-omarchy: keep Intel IOMMU off by default on Dell XPS 13 9343 CONFIG_INTEL_IOMMU_DEFAULT_ON=y breaks the firmware TPM (Intel PTT) on the XPS 13 9343. The PTT command buffer lives in system RAM and is read by a hidden ME function (00:16.7) via DMA, but the firmware's DMAR table has no RMRR covering it. With DMA remapping enabled those reads fault, tpm_crb times out (-62), and systemd waits 90 s for /dev/tpm0 on every boot. Add a DMI quirk that keeps DMA remapping off by default on this model. intel_iommu=on, tboot and platform opt-in still force it on. Applied to both linux-omarchy and linux-omarchy-bore, pkgrel bumped to 7. Fixes #677 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019uo7x1CH4xTNQTzhnzKd3Z --- ...0-iommu-intel-xps13-9343-ptt-no-rmrr.patch | 70 +++++++++++++++++++ pkgbuilds/linux-omarchy-bore/PKGBUILD | 5 +- ...0-iommu-intel-xps13-9343-ptt-no-rmrr.patch | 70 +++++++++++++++++++ pkgbuilds/linux-omarchy/PKGBUILD | 5 +- 4 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 pkgbuilds/linux-omarchy-bore/0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch create mode 100644 pkgbuilds/linux-omarchy/0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch diff --git a/pkgbuilds/linux-omarchy-bore/0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch b/pkgbuilds/linux-omarchy-bore/0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch new file mode 100644 index 0000000000..c13382bbf6 --- /dev/null +++ b/pkgbuilds/linux-omarchy-bore/0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch @@ -0,0 +1,70 @@ +diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -209,6 +209,7 @@ static int intel_iommu_superpage = 1; + static int iommu_identity_mapping; + static int iommu_skip_te_disable; + static int disable_igfx_iommu; ++static int dmar_cmdline_on; + + #define IDENTMAP_AZALIA 4 + +@@ -241,6 +242,7 @@ static int __init intel_iommu_setup(char *str) + while (*str) { + if (!strncmp(str, "on", 2)) { + dmar_disabled = 0; ++ dmar_cmdline_on = 1; + pr_info("IOMMU enabled\n"); + } else if (!strncmp(str, "off", 3)) { + dmar_disabled = 1; +@@ -2538,6 +2540,41 @@ static int __init probe_acpi_namespace_devices(void) + return 0; + } + ++/* ++ * On these machines the firmware-TPM (Intel PTT) command/response buffers ++ * live in system RAM and are fetched by a hidden ME function (00:16.7) via ++ * DMA, but the DMAR table has no RMRR covering them. With DMA remapping ++ * enabled those reads fault and tpm_crb probe times out, so the TPM is ++ * unusable. Keep the IOMMU off by default there; "intel_iommu=on" still ++ * enables it. ++ */ ++static const struct dmi_system_id intel_iommu_ptt_no_rmrr[] __initconst = { ++ { ++ .ident = "Dell XPS 13 9343", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343"), ++ }, ++ }, ++ { } ++}; ++ ++static __init void intel_iommu_apply_dmi_quirks(void) ++{ ++ const struct dmi_system_id *id; ++ ++ if (dmar_disabled || dmar_cmdline_on) ++ return; ++ ++ id = dmi_first_match(intel_iommu_ptt_no_rmrr); ++ if (!id) ++ return; ++ ++ pr_info("%s: disabling DMA remapping by default, firmware TPM DMA is not covered by an RMRR (use intel_iommu=on to override)\n", ++ id->ident); ++ dmar_disabled = 1; ++} ++ + static __init int tboot_force_iommu(void) + { + if (!tboot_enabled()) +@@ -2558,6 +2595,8 @@ int __init intel_iommu_init(void) + struct dmar_drhd_unit *drhd; + struct intel_iommu *iommu; + ++ intel_iommu_apply_dmi_quirks(); ++ + /* + * Intel IOMMU is required for a TXT/tboot launch or platform + * opt in, so enforce that. diff --git a/pkgbuilds/linux-omarchy-bore/PKGBUILD b/pkgbuilds/linux-omarchy-bore/PKGBUILD index d9c5b417e8..7d723189e8 100644 --- a/pkgbuilds/linux-omarchy-bore/PKGBUILD +++ b/pkgbuilds/linux-omarchy-bore/PKGBUILD @@ -3,7 +3,7 @@ pkgbase=linux-omarchy-bore pkgver=7.2.5 -pkgrel=6 +pkgrel=7 pkgdesc='Omarchy Linux (BORE CPU scheduler, ADIOS I/O scheduler)' url='https://omarchy.org' arch=( @@ -124,6 +124,7 @@ source=( 0661-rtw89-command-offload-source.patch{,.sig} 0662-iwlwifi-mld-skip-tx-when-firmware-dead.patch{,.sig} 0700-pci-target-speed-quirk.patch{,.sig} + 0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch 0750-applesmc-cache-race.patch{,.sig} 0751-applesmc-key-backlight-workqueue-leak.patch{,.sig} 0770-acpi-pm-acer-swift3-sf314-56g-power-resource.patch{,.sig} @@ -304,6 +305,7 @@ b2sums=('48551bee71cd02815136fb8abe7da4464c2e17c89ef35cb0c0530c8b969fe12127ca97a 'SKIP' '4a4af88fc8a8c37ae6d20b35d19e60a17672569d5489be120edbcc62ab3ba4bbc43b78cd0799b9fd73c84b089364320bcbad6fcb7128c2cb06d15ed984d6fc8c' 'SKIP' + '5270f0fb2c643d83d2646a11be81aae80166b9fe955cb67fe3cefffb5261790c7171daa3208643a771df2482cd6eff94371357008cdb6fdcc31bc49ec4714971' '0959ca78ff31299adf1091f4aa1b32cd2e9066aba5e44f0658c91bcb93fe8714f7b671ffa2cd498ecbb6c6e643ac6571bfb193034af206599122fd7c2a3c23a8' 'SKIP' '03ca740048e48c5b6948f972f7a826240cf51c9b5c8645d1b1c50366e78cbf45f5b45b7b47f87f231b50aab46ef2f8fd78bc53899ba1c319a19f9f61c7cecb90' @@ -499,6 +501,7 @@ sha256sums=('55ddf0df8325d9dad96fcff7bd93977d22e3f50af06527572af59b77c7632b78' 'SKIP' '4e80f2d05591175d4ed0a1a144509e97260e5593472aae586c07956215d99162' 'SKIP' + '0273ba08c71247b0af83d97347f42e2528a5c6fa16a44b0dc949869bb89d2ec8' '8ebce8f38e38bd66879d040028c2448e5bc7dcde9df0ccee2b4221015591b162' 'SKIP' '0b0e05b615ae6eb825bf7d7fa568f551b0dff6c2cee62c9285c1b0d63224ea1c' diff --git a/pkgbuilds/linux-omarchy/0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch b/pkgbuilds/linux-omarchy/0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch new file mode 100644 index 0000000000..c13382bbf6 --- /dev/null +++ b/pkgbuilds/linux-omarchy/0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch @@ -0,0 +1,70 @@ +diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -209,6 +209,7 @@ static int intel_iommu_superpage = 1; + static int iommu_identity_mapping; + static int iommu_skip_te_disable; + static int disable_igfx_iommu; ++static int dmar_cmdline_on; + + #define IDENTMAP_AZALIA 4 + +@@ -241,6 +242,7 @@ static int __init intel_iommu_setup(char *str) + while (*str) { + if (!strncmp(str, "on", 2)) { + dmar_disabled = 0; ++ dmar_cmdline_on = 1; + pr_info("IOMMU enabled\n"); + } else if (!strncmp(str, "off", 3)) { + dmar_disabled = 1; +@@ -2538,6 +2540,41 @@ static int __init probe_acpi_namespace_devices(void) + return 0; + } + ++/* ++ * On these machines the firmware-TPM (Intel PTT) command/response buffers ++ * live in system RAM and are fetched by a hidden ME function (00:16.7) via ++ * DMA, but the DMAR table has no RMRR covering them. With DMA remapping ++ * enabled those reads fault and tpm_crb probe times out, so the TPM is ++ * unusable. Keep the IOMMU off by default there; "intel_iommu=on" still ++ * enables it. ++ */ ++static const struct dmi_system_id intel_iommu_ptt_no_rmrr[] __initconst = { ++ { ++ .ident = "Dell XPS 13 9343", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343"), ++ }, ++ }, ++ { } ++}; ++ ++static __init void intel_iommu_apply_dmi_quirks(void) ++{ ++ const struct dmi_system_id *id; ++ ++ if (dmar_disabled || dmar_cmdline_on) ++ return; ++ ++ id = dmi_first_match(intel_iommu_ptt_no_rmrr); ++ if (!id) ++ return; ++ ++ pr_info("%s: disabling DMA remapping by default, firmware TPM DMA is not covered by an RMRR (use intel_iommu=on to override)\n", ++ id->ident); ++ dmar_disabled = 1; ++} ++ + static __init int tboot_force_iommu(void) + { + if (!tboot_enabled()) +@@ -2558,6 +2595,8 @@ int __init intel_iommu_init(void) + struct dmar_drhd_unit *drhd; + struct intel_iommu *iommu; + ++ intel_iommu_apply_dmi_quirks(); ++ + /* + * Intel IOMMU is required for a TXT/tboot launch or platform + * opt in, so enforce that. diff --git a/pkgbuilds/linux-omarchy/PKGBUILD b/pkgbuilds/linux-omarchy/PKGBUILD index cc700494aa..7be6e56531 100644 --- a/pkgbuilds/linux-omarchy/PKGBUILD +++ b/pkgbuilds/linux-omarchy/PKGBUILD @@ -3,7 +3,7 @@ pkgbase=linux-omarchy pkgver=7.2.5 -pkgrel=6 +pkgrel=7 pkgdesc='Omarchy Linux' url='https://omarchy.org' arch=( @@ -123,6 +123,7 @@ source=( 0661-rtw89-command-offload-source.patch{,.sig} 0662-iwlwifi-mld-skip-tx-when-firmware-dead.patch{,.sig} 0700-pci-target-speed-quirk.patch{,.sig} + 0710-iommu-intel-xps13-9343-ptt-no-rmrr.patch 0750-applesmc-cache-race.patch{,.sig} 0751-applesmc-key-backlight-workqueue-leak.patch{,.sig} 0770-acpi-pm-acer-swift3-sf314-56g-power-resource.patch{,.sig} @@ -301,6 +302,7 @@ b2sums=('48551bee71cd02815136fb8abe7da4464c2e17c89ef35cb0c0530c8b969fe12127ca97a 'SKIP' '4a4af88fc8a8c37ae6d20b35d19e60a17672569d5489be120edbcc62ab3ba4bbc43b78cd0799b9fd73c84b089364320bcbad6fcb7128c2cb06d15ed984d6fc8c' 'SKIP' + '5270f0fb2c643d83d2646a11be81aae80166b9fe955cb67fe3cefffb5261790c7171daa3208643a771df2482cd6eff94371357008cdb6fdcc31bc49ec4714971' '0959ca78ff31299adf1091f4aa1b32cd2e9066aba5e44f0658c91bcb93fe8714f7b671ffa2cd498ecbb6c6e643ac6571bfb193034af206599122fd7c2a3c23a8' 'SKIP' '03ca740048e48c5b6948f972f7a826240cf51c9b5c8645d1b1c50366e78cbf45f5b45b7b47f87f231b50aab46ef2f8fd78bc53899ba1c319a19f9f61c7cecb90' @@ -494,6 +496,7 @@ sha256sums=('55ddf0df8325d9dad96fcff7bd93977d22e3f50af06527572af59b77c7632b78' 'SKIP' '4e80f2d05591175d4ed0a1a144509e97260e5593472aae586c07956215d99162' 'SKIP' + '0273ba08c71247b0af83d97347f42e2528a5c6fa16a44b0dc949869bb89d2ec8' '8ebce8f38e38bd66879d040028c2448e5bc7dcde9df0ccee2b4221015591b162' 'SKIP' '0b0e05b615ae6eb825bf7d7fa568f551b0dff6c2cee62c9285c1b0d63224ea1c'