From patchwork Fri Dec 15 07:38:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Lane X-Patchwork-Id: 1876498 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ss1M30hfTz20LX for ; Fri, 15 Dec 2023 18:39:25 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rE2mo-0004R3-KD; Fri, 15 Dec 2023 07:39:06 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rE2ml-0004Qe-Qw for kernel-team@lists.ubuntu.com; Fri, 15 Dec 2023 07:39:03 +0000 Received: from galactica.tail09933.ts.net (1.general.jlane.us.vpn [10.172.64.160]) (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-canonical-1.canonical.com (Postfix) with ESMTPSA id 3A28A3F6B8 for ; Fri, 15 Dec 2023 07:39:03 +0000 (UTC) From: Jeff Lane To: kernel-team@lists.ubuntu.com Subject: [SRU L][PATCH 0/2] OS cannot boot successfully when enabling VMD in UEFI setup Date: Fri, 15 Dec 2023 02:38:59 -0500 Message-Id: <20231215073901.1718677-1-jeffrey.lane@canonical.com> X-Mailer: git-send-email 2.34.1 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: Michael Reed BugLink: https://bugs.launchpad.net/bugs/2020022 [Impact] When enabling VMD in UEFI setup, OS cannot boot successfully. And, the panic leads to the system reboot. The following log is shown: [ 166.605518] DMAR: VT-d detected Invalidation Queue Error: Reason f [ 166.605522] DMAR: VT-d detected Invalidation Time-out Error: SID ffff [ 166.612445] DMAR: VT-d detected Invalidation Completion Error: SID ffff [ 166.612447] DMAR: QI HEAD: UNKNOWN qw0 = 0x0, qw1 = 0x0 [ 166.612449] DMAR: QI PRIOR: UNKNOWN qw0 = 0x0, qw1 = 0x0 ... Additional info: * The issue happens on both Lenovo SE350 server and Lenovo SR850 v2 server. Debugging info and fix commit info: * `git bisect` indicates the offending commit is 6aab5622296b ("PCI: vmd: Clean up domain before enumeration"). The root cause is that VMD driver tries to clear a PCI configuration space range when resetting a VMD domain (https://github.com/torvalds/linux/blob/master/drivers/pci/controller/vmd.c#L544), which leads to the failure. [Fix] * Another `git bisect` indicates the fix commit is 20f3337d350c ("x86: don't use REP_GOOD or ERMS for small memory clearing). I confirmed that this commit can fix the issue. Would it be possible to include the commit 20f3337d350c in Ubuntu 22.04.2/23.10 kernel? [Test Plan] Reproduce Step 1.Disable Intel VMD in BIOS settings System Settings --> Devices and I/O Ports --> Intel VMD technology --> Enable/Disable Intel VMD : Disabled 2.Install OS 3.Enable Intel VMD in BIOS settings System Settings --> Devices and I/O Ports --> Intel VMD technology --> Enable/Disable Intel VMD : Enabled 4.Rebooting will reproduce this issue [ Where problems could occur ] * Lenovo SE350 server and Lenovo SR850 v2 server * The regression leads to the boot failure (cannot boot info OS successfully). [ Other Info ] https://code.launchpad.net/~mreed8855/ubuntu/+source/linux/+git/lunar/+ref/enable_vmd_lp_2020022 Jim Mattson (1): x86/cpufeatures: Add macros for Intel's new fast rep string features Linus Torvalds (1): x86: don't use REP_GOOD or ERMS for small memory clearing arch/x86/include/asm/cpufeatures.h | 3 ++ arch/x86/lib/memset_64.S | 47 +++++++----------------------- 2 files changed, 14 insertions(+), 36 deletions(-) Acked-by: Tim Gardner Acked-by: Manuel Diewald