Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp622052rwi; Mon, 31 Oct 2022 05:49:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BECyT/Lo9VnZHCgWSF6bWmJzCBBd5k/oNjHObMRfen+8+nNgeB+DSPuaauZKFwBtjCTZM X-Received: by 2002:a05:6402:5510:b0:459:5ea:9bc0 with SMTP id fi16-20020a056402551000b0045905ea9bc0mr13259938edb.152.1667220548749; Mon, 31 Oct 2022 05:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667220548; cv=none; d=google.com; s=arc-20160816; b=bEbXgpuwVLhJ6L0uuuXklDwfsUFjjxCFl6Hf15mmlscfE99eq8jbI8qQsoGwckZQPf lM9b/FHZJsIkvprWb4nTZMbbpjfg/pNFX/voZkl47uOqqcNs6mzMZ8YzN8vyfGWZpGTK bUdqy83zr0VQeG+tiC0ZIuLefljqPZXeNP7jfxWhdTToK4duzmNMBtZvJgBQ2yOPC6s5 ZlfH1XheIbG8UPbaE/8E9FaGanprZJinMKf/UISUYX6KvloC0OcGICVvb9T4rfHGEAQa A/0dhPX/Q83gwNh37Xi4eVU3+BaiQonQRfJ+vUNOGeYoOOJX2Xe+de59S2QoRLWyNWSP 16bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=6/Ix9spo78M4OWnZZlZQz7JZNQC0CFxbqtn82/PNEZ8=; b=J8bEKDhUIVOSl/+GmPa+EJEwM+ysCovjdXT2yVde8ZfJ1pNEUY+C1DEXT1REcsxDr8 98bPSM/qLImkrG6Q5zK67M/svP9KL2cY7ou0Dn+joZPegRqcEiF8WU1AzIbSdJ8qKSj4 +ZgZ9q+siqF6kld5Iu+o1SFHwgOJnCt03y2nc5O47ngjysXDb6pP9KLK1ySo321z9ZVV Auhn51+9GrOYxhEwR9T/8EcHMN14hFT6Ie0qsVBkDg+CpSDfZXqVBqXAKbN4MHK58KS2 7ayjghMUKaA8PifHOLX87v++gk5DgyYVS+v2ejZ5SpOKiLQs9m2hl9F38OXxn7eAelN7 yEXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m0AePBMI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 3-20020a508e03000000b0045981993486si7318479edw.227.2022.10.31.05.48.40; Mon, 31 Oct 2022 05:49:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m0AePBMI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230355AbiJaLjf (ORCPT + 98 others); Mon, 31 Oct 2022 07:39:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230454AbiJaLjb (ORCPT ); Mon, 31 Oct 2022 07:39:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0BE9E0C5; Mon, 31 Oct 2022 04:39:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8790CB815F0; Mon, 31 Oct 2022 11:39:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14C5AC433D6; Mon, 31 Oct 2022 11:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667216366; bh=HQjPeXhuMJaa8KQ0K5CAMhQSgd66kySqnVI3CnJ4el4=; h=Date:From:To:Cc:Subject:From; b=m0AePBMIKMtLXG91e5QuTc7jTQQbEIBSwclsWUvc520seRK4+w16BFyc0M/yUT4Ov b/K7brNnoGgy/zUu1+dLsJctx6Ao3ykO6+rp8rG8A1j5tdX7UYANxZ21ID6hMnSQME X+jJ6qZrddNz1AroVY+eNQrFerJT5SUBT95SiqPhOT3BC75/5Pvwq25FQ8AZpF57b6 R/XbMMhR4Gh+Z2XeEJs5bV5gFhonLIh+2SiVQaRuU4gwCHBc2PpADcOyT/ziV/YWh0 o6IoeAzzEwDAuzIl4tS/x3BfNrXNkCjoPlJXV6oaoEx8prtMPveOBnYAIE4OpMFV04 aDhizHCgpVFOA== Date: Mon, 31 Oct 2022 06:39:24 -0500 From: Bjorn Helgaas To: Nirmal Patel Cc: Jon Derrick , Adrian Huang , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [bugzilla-daemon@kernel.org: [Bug 216644] New: Host OS hangs when enabling VMD in UEFI setup] Message-ID: <20221031113924.GA1081013@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks, Adrian, for the bisection and detailed debugging! ----- Forwarded message from bugzilla-daemon@kernel.org ----- https://bugzilla.kernel.org/show_bug.cgi?id=216644 Summary: Host OS hangs when enabling VMD in UEFI setup Kernel Version: 6.1-rc2 Regression: No Created attachment 303108 --> https://bugzilla.kernel.org/attachment.cgi?id=303108&action=edit OS Log (Serial Log) When enabling VMD in BIOS setup, the host OS cannot boot successfully with the following error message: [ 8.986310] vmd 0000:64:05.5: PCI host bridge to bus 10000:00 ... [ 9.674113] vmd 0000:64:05.5: Bound to PCI domain 10000 ... [ 33.592638] DMAR: VT-d detected Invalidation Queue Error: Reason f [ 33.592640] DMAR: VT-d detected Invalidation Time-out Error: SID ffff [ 33.599853] DMAR: VT-d detected Invalidation Completion Error: SID ffff [ 33.607339] DMAR: QI HEAD: UNKNOWN qw0 = 0x0, qw1 = 0x0 [ 33.621143] DMAR: QI PRIOR: UNKNOWN qw0 = 0x0, qw1 = 0x0 [ 33.627366] DMAR: Invalidation Time-out Error (ITE) cleared *** Hardware Info *** Platform: skylake-D purley platform VMD: 8086:201d # lspci -s 0000:64:05.5 -nn 0000:64:05.5 RAID bus controller [0104]: Intel Corporation Volume Management Device NVMe RAID Controller [8086:201d] (rev 04) *** Detail Info *** `git bisect` points the following offending patch (commit: 6aab5622296b): commit 6aab5622296b990024ee67dd7efa7d143e7558d0 Author: Nirmal Patel Date: Tue Nov 16 15:11:36 2021 -0700 PCI: vmd: Clean up domain before enumeration During VT-d pass-through, the VMD driver occasionally fails to enumerate underlying NVMe devices when repetitive reboots are performed in the guest OS. The issue can be resolved by resetting VMD root ports for proper enumeration and triggering secondary bus reset which will also propagate reset through downstream bridges. Link: https://lore.kernel.org/r/20211116221136.85134-1-nirmal.patel@linux.intel.com Signed-off-by: Nirmal Patel Signed-off-by: Lorenzo Pieralisi Reviewed-by: Jon Derrick *** Debugging Info *** 1. Reverting 6aab5622296b on top of 6.1-rc2 can fix the issue. 2. Comment out for calling vmd_domain_reset() can also fix the issue. So, it looks like the function memset_io() causes the issue. static void vmd_domain_reset(struct vmd_dev *vmd) { ... for (bus = 0; bus < max_buses; bus++) { for (dev = 0; dev < 32; dev++) { ... memset_io(base + PCI_IO_BASE, 0, PCI_ROM_ADDRESS1 - PCI_IO_BASE); } } } } 3. pci_reset_bus() returns -25 because 'slot' or 'bus->self' is NULL. 4. We have 4 disks attached to VMD: # nvme list Node Generic SN Model Namespace Usage Format FW Rev --------------------- --------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- /dev/nvme3n1 /dev/ng3n1 222639A46A39 Micron_7450_MTFDKBA960TFR 1 11.48 GB / 960.20 GB 512 B + 0 B E2MU111 /dev/nvme2n1 /dev/ng2n1 222639A46A30 Micron_7450_MTFDKBA960TFR 1 4.18 GB / 960.20 GB 512 B + 0 B E2MU111 /dev/nvme1n1 /dev/ng1n1 BTLJ849201CE1P0I SSDPELKX010T8L 1 1.00 TB / 1.00 TB 512 B + 0 B VCV1LZ37 /dev/nvme0n1 /dev/ng0n1 BTLJ849201BS1P0I SSDPELKX010T8L 1 1.00 TB / 1.00 TB 512 B + 0 B VCV1LZ37 Any thoughts? Thanks for the help. ----- End forwarded message -----