Received: by 2002:ac2:4468:0:0:0:0:0 with SMTP id y8csp444082lfl; Tue, 15 Feb 2022 07:39:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2nkl5Y5dTopFRpTUPyK72lLAp9X+NDZApLZOQLkSbPu6QUxiorGMKF2z7scBrczO9hHh2 X-Received: by 2002:a17:907:6094:: with SMTP id ht20mr3344760ejc.609.1644939543046; Tue, 15 Feb 2022 07:39:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644939543; cv=none; d=google.com; s=arc-20160816; b=A7KeppzeN1F9SwnUF9xX6j7mRsCPNNhl9j5f0hUUFxvfNf8Ws0HwhdsSiprUJcooEo Tvz+TAbgIn/pwRIB3HBN9Nyax/pRer/5tCE1E0BCkaQ1Gnt9U0+c8DpmULnrUCh7HDEy 7yYIyRLSgt/tG0d1ZX8J9la/QLdeFp3NwrV/j+QO5/7uLRneoYCh71b647NoOSiv8RXc H5oRiioPgPQC3IaRHkV0KUTCwJKyv+8IgUA/pTY1YmA+FmBjKsL+clC26C5gGWhAlLAs mHOHEd2sekx/s7yonpPM1ssPgHbJ7kLil5yJ8T8LkfZu3kZEmD4Izrq1X2O5MMF8zx3c CxFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=v4Hs5xiB5ph6Hlk01oj3OPPFkgN+IUi0rc+drfQDk34=; b=ZX0GbltSX9wf4MNoIEITMnQP+aeeGavwslCiZ0mqBTIWO6MOTbLLF/65hPuW9HGB4m 2pJIr8bJYEvX4CyxDoITPNvUetH383606tFOc3FEkxI3M7LWKsBoTm0O6/NzDwv8d4TO UPddwCaR9fgVKnYGSeccPA3aLg6yCOaruPyeYE5UQ5H5jh9hO/tKVFleCPJkzYIfMTFR 2aYx0AM7+gCGYXsEtOjxlRbv4kbfl3HFi+SsOvVev/r/6gAhNcyV1KFCc4UUqE3aRR4a wU/eGzpSYe9Ts8XXtzCryK52Qbjvw1JKnhbfxj9VCmVzv8lyA0avEe+3RdZWnfdbcumI u+Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CXP0rEBr; 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 q9si100058edd.182.2022.02.15.07.38.39; Tue, 15 Feb 2022 07:39:03 -0800 (PST) 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=CXP0rEBr; 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 S239566AbiBOPJz (ORCPT + 99 others); Tue, 15 Feb 2022 10:09:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:47908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232910AbiBOPJy (ORCPT ); Tue, 15 Feb 2022 10:09:54 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59C7B24BCE; Tue, 15 Feb 2022 07:09:43 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id EB19361563; Tue, 15 Feb 2022 15:09:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF293C340EB; Tue, 15 Feb 2022 15:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644937782; bh=rQRzKiWjUEky441SM9VPj2LOw9hR96TVsT711jhkyb0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=CXP0rEBrVkzFiRZeDgYjn/z85zqqkvPxVs1Zg02Ic84H/tmLzroXhvXVJipIGcgcn Pe4nloYCPt+YsC2XrN5rhBXqzvsVSnpk3L+CbCHtaKBkExYFT3xfEJycVe7XsgW3A2 2Gx1pBjJxjjEV1MLyAHmIArBJ+wI01dWa+wKjHlSFCOcuy6P3wGWsemyhCSThNDC8c 7KC7s0k/P8lbTMwO4RW/DP8jBuYVoX/mC93BarWSlDdy1wDN2wZleW8DfGUWpAt4PT hrIS/csTdZ0nbk+eU4QIOgsccjVTRuH9SMyT37PW1+STNiu/aMnREhQNWkEa2UYMjF 20XbDO+rzoxvg== Date: Tue, 15 Feb 2022 09:09:39 -0600 From: Bjorn Helgaas To: Kai-Heng Feng Cc: "Rafael J. Wysocki" , Keith Busch , Bjorn Helgaas , Linux PM , Nirmal Patel , Jonathan Derrick , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Linux PCI , Linux Kernel Mailing List Subject: Re: [PATCH v3] PCI: vmd: Honor ACPI _OSC on PCIe features Message-ID: <20220215150939.GA106706@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.2 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,T_SCC_BODY_TEXT_LINE 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 On Mon, Feb 14, 2022 at 08:23:05AM +0800, Kai-Heng Feng wrote: > On Thu, Feb 10, 2022 at 5:36 AM Bjorn Helgaas wrote: > > On Tue, Dec 07, 2021 at 02:15:04PM +0100, Rafael J. Wysocki wrote: > > > On Tue, Dec 7, 2021 at 12:12 AM Keith Busch wrote: > > > > On Fri, Dec 03, 2021 at 11:15:41AM +0800, Kai-Heng Feng wrote: > > > > > When Samsung PCIe Gen4 NVMe is connected to Intel ADL VMD, the > > > > > combination causes AER message flood and drags the system performance > > > > > down. > > > > > > > > > > The issue doesn't happen when VMD mode is disabled in BIOS, since AER > > > > > isn't enabled by acpi_pci_root_create() . When VMD mode is enabled, AER > > > > > is enabled regardless of _OSC: > > > > > [ 0.410076] acpi PNP0A08:00: _OSC: platform does not support [AER] > > > > > ... > > > > > [ 1.486704] pcieport 10000:e0:06.0: AER: enabled with IRQ 146 > > > > > > > > > > Since VMD is an aperture to regular PCIe root ports, honor ACPI _OSC to > > > > > disable PCIe features accordingly to resolve the issue. > > > > > > > > At least for some versions of this hardare, I recall ACPI is unaware of > > > > any devices in the VMD domain; the platform can not see past the VMD > > > > endpoint, so I throught the driver was supposed to always let the VMD > > > > domain use OS native support regardless of the parent's ACPI _OSC. > > > > > > This is orthogonal to whether or not ACPI is aware of the VMD domain > > > or the devices in it. > > > > > > If the platform firmware does not allow the OS to control specific > > > PCIe features at the physical host bridge level, that extends to the > > > VMD "bus", because it is just a way to expose a hidden part of the > > > PCIe hierarchy. > > > > I don't understand what's going on here. Do we understand the AER > > message flood? Are we just papering over it by disabling AER? > > To be more precise, AER is disabled by the platform vendor in BIOS to > paper over the issue. > The only viable solution for us is to follow their settings. We may > never know what really happens underneath. > > Disabling ASPM/AER/PME etc is a normal practice for ODMs unfortunately. OK. So this patch actually has nothing in particular to do with AER. It's about making _OSC apply to *all* devices below a host bridge, even those below a VMD. This is slightly ambiguous because while "_OSC applies to the entire hierarchy originated by a PCI Host Bridge" (PCI Firmware spec r3.3, sec 4.5.1), vmd.c creates a logical view where devices below the VMD are in a separate hierarchy with a separate domain. The interpretation that _OSC applies to devices below VMD should work, as long as it is possible for platform firmware to manage services (AER, pciehp, etc) for things below VMD without getting in the way of vmd.c. But I think one implication of this is that we cannot support hot-added VMDs. For example, firmware that wants to manage AER will use _OSC to retain AER control. But if the firmware doesn't know how VMDs work, it will not be able to handle AER for devices below the VMD. > > If an error occurs below a VMD, who notices and reports it? If we > > disable native AER below VMD because of _OSC, as this patch does, I > > guess we're assuming the platform will handle AER events below VMD. > > Is that really true? Does the platform know how to find AER log > > registers of devices below VMD? > > > > > The platform firmware does that through ACPI _OSC under the host > > > bridge device (not under the VMD device) which it is very well aware > > > of.