Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp411125rdg; Thu, 12 Oct 2023 09:04:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKTTatb8T49nb2cozlsGhKlUmg9L6iG5IuJ2mSXfuAQyOaJX5ZpkXAbkMmPZjZ91PyAl7p X-Received: by 2002:a05:6a20:12c6:b0:174:63a9:293 with SMTP id v6-20020a056a2012c600b0017463a90293mr3990145pzg.48.1697126678533; Thu, 12 Oct 2023 09:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697126678; cv=none; d=google.com; s=arc-20160816; b=s9h9uRbTmFc1AFkPB/Unn4FwuQn8wuvY88ydcnLnsj2JxOh7daEcQtGO2bEwyK+EPE l2ZNGCYJD3nlc5Wpa8NLI02YUCWgMLcXkXd9YvwJ80Wk5nTNDP7IH2S5O9cZp8awBqfE Q12441vpOyq/0FjFApWGb+AMv0ngfXBuY/KSsgfBKZj7u/bWbOKsPvTj71JsP5jAhPX8 byuSdbXe3wNYA6TmqgJnSm2bteaThyoj6FP38Utb88jWkhf5IdAHJ6rZ1T8J4Dm954nR UnDO0ahRpsarqmTSrE90oaXeBF/ou9FD9jozmWUrEsi0AG94tW5aBEqEbslvMdLWmhqo NUIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vxNZBWp2Yc+y+3Svg6dFtUXrQRVxNhFLVftKpTWCraE=; fh=ziH6AqjcMAvHDbbuYhB2UMLIJ1wrChU+QKAaLUKUtjI=; b=KYPedgzzxAECmLLX6QQ1mPo+RiUtS0pyJkkP6dzehDNLNwFnPZd5LntMqnaA7mh7Vf N6MYzNL4MV1VmXjlkClcnhimtMP/4/Yi214bS+Z4Qw7cOJOe3HH3lbmSJyTMcQR8x+Up shfuy9JuMXQg8nGcauvqrKO3Mk7/KtZXkmGy9Mwx9d4S4vsIw/5sZCeooomEa1W943io 5aZ+3WW8mHjKlo5jCuiIBAbUEYWVuFOyD69YGYv0S6CTimDtjqs1yytxtGU5uc20s5Gw pf7y75TQ14eOdL7qdjQUcgGjIq/PGk95FgOsff8qUzsooYOuyGxfSBMNVPBUTX2tZCeO tFIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id v64-20020a638943000000b00578b8016c40si2604632pgd.93.2023.10.12.09.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 09:04:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id F1C8182372C7; Thu, 12 Oct 2023 09:04:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343697AbjJLQEV (ORCPT + 99 others); Thu, 12 Oct 2023 12:04:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233085AbjJLQEU (ORCPT ); Thu, 12 Oct 2023 12:04:20 -0400 X-Greylist: delayed 1827 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 12 Oct 2023 09:04:18 PDT Received: from pepin.polanet.pl (pepin.polanet.pl [193.34.52.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2116FBB; Thu, 12 Oct 2023 09:04:17 -0700 (PDT) Date: Thu, 12 Oct 2023 17:33:47 +0200 From: Tomasz Pala To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Dan J Williams , Kan Liang , Tony Luck , David E Box , Yunying Sun , Dave Jiang , Mika Westerberg , Giovanni Cabiddu , Herbert Xu , Hans de Goede , Florent DELAHAYE , Konrad J Hambrick , Matt Hansen <2lprbe78@duck.com>, Nicholas Johnson , Benoit =?iso-8859-2?Q?Gr=E9goire?= , Werner Sembach , mumblingdrunkard@protonmail.com, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH 2/2] x86/pci: Treat EfiMemoryMappedIO as reservation of ECAM space Message-ID: <20231012153347.GA26695@polanet.pl> References: <20230110180243.1590045-1-helgaas@kernel.org> <20230110180243.1590045-3-helgaas@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <20230110180243.1590045-3-helgaas@kernel.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 12 Oct 2023 09:04:36 -0700 (PDT) Hello, On Tue, Jan 10, 2023 at 12:02:43 -0600, Bjorn Helgaas wrote: > Normally we reject ECAM space unless it is reported as reserved in the E820 > table or via a PNP0C02 _CRS method (PCI Firmware, r3.3, sec 4.1.2). This > means PCI extended config space (offsets 0x100-0xfff) may not be accessible. > > Some firmware doesn't report ECAM space via PNP0C02 _CRS methods, but does > mention it as an EfiMemoryMappedIO region via EFI GetMemoryMap(), which is > normally converted to an E820 entry by a bootloader or EFI stub. > > 07eab0901ede ("efi/x86: Remove EfiMemoryMappedIO from E820 map"), removes > E820 entries that correspond to EfiMemoryMappedIO regions because some > other firmware uses EfiMemoryMappedIO for PCI host bridge windows, and the > E820 entries prevent Linux from allocating BAR space for hot-added devices. > > Allow use of ECAM for extended config space when the region is covered by > an EfiMemoryMappedIO region, even if it's not included in E820 or PNP0C02 > _CRS. I'm still having a problem initializing ixgbe NICs with pristine 6.5.7 kernel. efi: Remove mem63: MMIO range=[0x80000000-0x8fffffff] (256MB) from e820 map [...] [mem 0x7f800000-0xfed1bfff] available for PCI devices [...] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0x80000000-0x8fffffff] (base 0x80000000) [Firmware Info]: PCI: MMCONFIG at [mem 0x80000000-0x8fffffff] not reserved in ACPI motherboard resources PCI: MMCONFIG at [mem 0x80000000-0x8fffffff] reserved as EfiMemoryMappedIO [...] ixgbe 0000:02:00.0: enabling device (0140 -> 0142) ixgbe 0000:02:00.0: BAR 0: can't reserve [mem 0x80000000-0x8007ffff 64bit] ixgbe 0000:02:00.0: pci_request_selected_regions failed 0xfffffff0 ixgbe: probe of 0000:02:00.0 failed with error -16 After disabling the code causing this (using always-false condition: if (size >= 256*1024 && 0) { ) in the chunk: https://lore.kernel.org/lkml/20221208190341.1560157-2-helgaas@kernel.org/ the BAR starts at 0x90000000 (not 0x80000000): efi: Not removing mem63: MMIO range=[0x80000000-0x8fffffff] (262144KB) from e820 map [...] [mem 0x90000000-0xfed1bfff] available for PCI devices [...] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0x80000000-0x8fffffff] (base 0x80000000) PCI: MMCONFIG at [mem 0x80000000-0x8fffffff] reserved as E820 entry and everything seems to work again. I've got full system bootup logs from the upstream and worked around, but I'm not sure if this is OK to attach them (the CC list is long). Also, this is my test machine so I can run some experiments. best regards, -- Tomasz Pala