Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp815734rdb; Fri, 26 Jan 2024 11:29:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdkS9X0i3hLX8rkPHeU7SmqyF5Ee7fEIzDiVd6/aBbnpkXxCULzQTzlnTrK27ElROIAs5T X-Received: by 2002:a1c:6a0a:0:b0:40e:43ba:610e with SMTP id f10-20020a1c6a0a000000b0040e43ba610emr229946wmc.66.1706297391393; Fri, 26 Jan 2024 11:29:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706297391; cv=pass; d=google.com; s=arc-20160816; b=ygaz1qvRaEAY36imM4oa7oRtvc1BiOeYzIe5OTD2/q9w4ClKtAFihpr+f+IC5uNJQU mKT+Y/XUnFD//KyEFGuXh8BJfwH7szBMaSAu2QRuoAnSxrjUfSrYep640Fv4cMyilUOa DHWgTSSbDYA9TdM33rf2XwRvrR0qcfwr9/ek5LQnyvJtdN6DMn6FCQsAnAZBE31VHU2r HYtwpW76VD7QgPIyP+tfOUPI5fXlU92QUTyepeacNLrpgblHDYWWsepr70XqKsp2rkKs R6TnO1GleYIAUwLDnmPO2k/T9AylWiU/s4oMP0ShnXOBD4zfVyOr6WRb6si57AolkqO4 AIsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=NKNiTVYy7793g7M21ZdT85kw+nAqYzkEg0gF0UZK0oE=; fh=Ss+gMWPWhxa5A6H0Pmo/zSgzPxOFo1vKyAsFQX+gdw0=; b=hP6JS4Z1O+iF9UabfKFDvDBDF+yMqvsGXcTgTgc3C0zwNS1D/J8Zeeb/OPFEzYc8jC W4h60u52pyG+34CbR4URC8/A3OeP0nOh9KynhHX/X7djUZeDZ0rublHhK3YrMCiadfc4 Gg3uA/dIgZnFcCqBzO3GLhbyk2jeW4u4G7F18q6WSWmJHHL8oyjZZ2sHtE9GbJxa5TWz 6sul74OCggP4DE+Ksh4TrECmk0uXWxxHO2QPt7f3H0EndftDcUi71GJQ29+1UVUC7K2l I5R/3a6E1grDkpJrFODsoLdW7PU/cr6lSKIyWbBfBcatEn/RMSZAwIOuh5/wNd2r//J3 Saug== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eZXhBhTq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-40567-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a25-20020a1709064a5900b00a2c467ec739si915229ejv.357.2024.01.26.11.29.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 11:29:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40567-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eZXhBhTq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-40567-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1387D1F230ED for ; Fri, 26 Jan 2024 19:29:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E100B225A5; Fri, 26 Jan 2024 19:29:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eZXhBhTq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C3382261A; Fri, 26 Jan 2024 19:29:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706297380; cv=none; b=Nbss/HCZsDRPeK1aLjDJRe6iKno0n/v3f70GxDPc1GxyiloWwjPINf/omRted7iTShoXFD7bAwLD61mJ6srNNIM5anjifoTdaWoOpoIZlEdEK7/my3Sc5yOOLDSPLS+xkC16Q45R4CTfWN2eBHLLimyN1N15Ao389FO0N4lJ3VQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706297380; c=relaxed/simple; bh=wplePetjGGSutFZASxBToeC5djPktb7V8+iOKkDud5k=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=JjJC3Qf4aM1VJQExJUE0J1VVAso46uGwSBEcZnUTfeAn0gn3KqfsAwTzMa5+w6m9t4rV1f1qX+OAIFIWIA+6w7iNqIehTq4HrZkw7++srTOn69hYTl3fuOjxURtPkmEbtNHD7ZfbBituEsVJA0dbx/guj+A0EXwGPFfKHoZvtus= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eZXhBhTq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D9E0C433C7; Fri, 26 Jan 2024 19:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706297379; bh=wplePetjGGSutFZASxBToeC5djPktb7V8+iOKkDud5k=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=eZXhBhTqFDJRwK21waHVWzEiVFadEQmlKIaRoUq0enXE4XeWC1PT2+6Wd89GwXCtq Z0djqqRK/nY0iMv5jYilo97ZyK23MFkA6iBUnKHewIz4JiYcHwHU/vxogMFRu9g/37 K96uyKXVWdcZ0TbUEQq6t/0HDzZdEb8yM0tl6gjv5g2BKqU1qZWUzDPVyahyU2iyeG bmJ5k225dKtWKUBQhFkTKbogy3tH/TKgoJNyuZFdu4XBx7bT1rOENtoGXQODid9hD7 SMMwU8UcBW40lLTpypz5HanH5zvt9iPg3gth8qLq+toRcYTHpjvZXwp3nbKVKch49H S4uE9HcM6S5Gw== Date: Fri, 26 Jan 2024 13:29:37 -0600 From: Bjorn Helgaas To: Mario Limonciello Cc: Bjorn Helgaas , "Rafael J . Wysocki" , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] x86/pci: Stop requiring ECAM to be declared in E820, ACPI or EFI Message-ID: <20240126192937.GA448790@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jan 26, 2024 at 12:32:34PM -0600, Mario Limonciello wrote: > On 1/25/2024 18:35, Bjorn Helgaas wrote: > > On Wed, Jan 17, 2024 at 11:53:50AM -0600, Mario Limonciello wrote: > > > On 12/15/2023 16:03, Mario Limonciello wrote: > > > > commit 7752d5cfe3d1 ("x86: validate against acpi motherboard resources") > > > > introduced checks for ensuring that MCFG table also has memory region > > > > reservations to ensure no conflicts were introduced from a buggy BIOS. > ... > > > Any thoughts on this version since our last conversation on V1? > > > > Just to let you know that I'm not ignoring this, and I'm trying to > > formulate a useful response. > > Thanks, I had been wondering. > > FYI - we've also added another place to make noise about this ECAM > issue in AMDGPU. This warning should go into 6.9: > > https://lore.kernel.org/amd-gfx/20240110101319.695169-1-Jun.Ma2@amd.com/ Looks similar to the PCI core warning here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/probe.c?id=v6.7#n1134 The comment says it doesn't work for devices on the root bus, though. Maybe it could be made to work there as well? > > mmconfig-shared.c has grown into an > > extremely complicated mess and is a continual source of problems, so > > I'd really like to untangle it a tiny bit if we can. > > > > One thing is that per spec, ACPI motherboard resources are the ONLY > > way to reserve ECAM space. I'd like to reclaim a little clarity about > > that and separate out the E820 and EFI stuff as secondary hacks. But > > there's an insane amount of history that got us here. > > I guess you know better than anyone here. But if my idea is > actually viable then the E820 and EFI stuff turn into "information > only". That would definitely be a good thing. I would like it if that were more obvious from reading the code because I spend waaay too much time staring at that labyrinth. > > The problem we have to avoid is assigning a BAR that overlaps ECAM. > > We assign BARs for lots of reasons. dGPU and resizable BARs are > > examples but there are others, like hotplug and SR-IOV. The fact that > > Windows works is a red herring because it allocates BARs differently. > > Have we actually observed a case that assigning the BAR overlaps > ECAM region thus far or it's hypothetical? Yes, it has happened. There's an example in the commit log here: https://git.kernel.org/linus/070909e56a7d ("x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS") > > And of course, if there's any way to solve this safely without > > adding yet another kernel parameter, that would be vastly > > preferable. > > The kernel isn't static though; something we could do is keep the > parameter around a year or two to get the bug feedback loop of > people testing it and then rip it out if nothing comes up. Yeah. It's pretty hard to remove those options though. For example, "pci=routeirq" was added in the pre-git era and probably isn't necessary, but how do we know nobody uses it? Bjorn