Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2703652rwb; Fri, 2 Dec 2022 13:49:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf51TL2Ls/eEfGTI6D3iDpLTiv5LEr7WJNyWHmcmXX+4YXAhwRyO8Jy32C/8DC8LmMncf4wR X-Received: by 2002:a17:906:524f:b0:7ae:59dd:e3f4 with SMTP id y15-20020a170906524f00b007ae59dde3f4mr50681607ejm.755.1670017774585; Fri, 02 Dec 2022 13:49:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670017774; cv=none; d=google.com; s=arc-20160816; b=USTV3QKUKAdq0ZVa2bzLA5hncfg6QCMohnbxOPX5j8o2rJYDEeBhrhFQLweLB0dOSE 2lIFn0IEoB035j5JQvKIrdypXTHeRbSiSBn507JMgBEJrUjrTb0vPXrCztnJLgsLsUTh PbyOxGf79U4M+rvqav8DzVuPxrvyYJgiRo4VMZMBXb3C+85nS23san4PGZl6f6fd7J0L EDA5vwSv1YamjMSDh3FbLFOdsiI5+9y5RtaRrleQ9F03Tenz3vk/IKVQxaj1NnKWUWOB RJBdgFANgRLqy9hnv0dZFBipxd2MbJiUMpkxzwpNXItHChkCAdRmRvaZJeHi1lRFNiZ8 /RLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=z2FOPD1rxFRPinJIz3a/USpiAAMYHK1mmTzHNT25Beg=; b=kb3GRdlD/Y3sng9R+E972n0AtBw2vbtpp7zeMRu6LvgGHmjOl9jQWX/yuoMlYztZ8Y WYYDoQ7G9XXLArzQS+xwIa+iP34oUdTtCrpFuaeXWvBSQfNE3FfUucqRdFsrYXQrvXaZ 47TRQciD9yVeR+flH/Tx0kzu0HJsPho9XWqDXWM9oVW0mCe2HLMMhNnKFH9xmc/FB6tk ImJlpbVdH9PiuFyR+k5hZ+4izTbGz9KX5AOtz6RBemfh/WiTxeac2ldZHPSuCx4FPiNI 9jbc7+J9pLn97ygBqTf0Fsqm3ye/LtcrD+6rQfdfkl4MS4Gu32IiFO8niT0vErqyb7e+ OLnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="d4qTFc/f"; 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 i7-20020aa7c707000000b004612915d1a0si7060596edq.507.2022.12.02.13.49.14; Fri, 02 Dec 2022 13:49:34 -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="d4qTFc/f"; 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 S234480AbiLBVTE (ORCPT + 82 others); Fri, 2 Dec 2022 16:19:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234242AbiLBVSv (ORCPT ); Fri, 2 Dec 2022 16:18:51 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 867F65915A; Fri, 2 Dec 2022 13:18:46 -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 900C8623D6; Fri, 2 Dec 2022 21:18:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDA10C433D6; Fri, 2 Dec 2022 21:18:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670015925; bh=2rrX47NWa70VI8AqxvMAoJDdj+in56xV4jYSGcyJcbo=; h=From:To:Cc:Subject:Date:From; b=d4qTFc/f72OMYxi/1HZE0CdQFKVlgLXIQsf6tAbNbpLXfL/lJBiriy9Skujf59U/l UTDzQnx5ZAY1+ZeCHAeTueZVZwJG3MpPXzmAnjFtm+rxxzsWuPtng1ikgX6s9D1U9k 7tk1HQdZIhZCURQkfR9xlVfsZ1IxOZXND7fKXaLauWlAtasxRdI0t762JdMwYay7Mv SYxaVcGFm9XnsMlsPSCdH59mEBmngBdsR2ynwvKt3bV6FQI6t+PVDg7NmhkA0VveWW 3tzTlcIsad84rsaDJJd9vI4bQ+Wwa+xJHXHXiqGi+V6pauXAyoXc4qTuK4jI8VPOf8 Sz/xgLOG0MGig== From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: Hans de Goede , Florent DELAHAYE , Konrad J Hambrick , Matt Hansen <2lprbe78@duck.com>, =?UTF-8?q?Benoit=20Gr=C3=A9goire?= , Nicholas Johnson , Mika Westerberg , Werner Sembach , mumblingdrunkard@protonmail.com, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 0/4] PCI: Continue E820 vs host bridge window saga Date: Fri, 2 Dec 2022 15:18:34 -0600 Message-Id: <20221202211838.1061278-1-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.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 From: Bjorn Helgaas When allocating space for PCI BARs, Linux avoids allocating space mentioned in the E820 map. This was originally done by 4dc2287c1805 ("x86: avoid E820 regions when allocating address space") to work around BIOS defects that included unusable space in host bridge _CRS. Some recent machines use EfiMemoryMappedIO for PCI MMCONFIG and host bridge apertures, and bootloaders and EFI stubs convert those to E820 regions, which means we can't allocate space for hot-added PCI devices (often a dock) or for devices the BIOS didn't configure (often a touchpad) The current strategy is to add DMI quirks that disable the E820 filtering on these machines and to disable it entirely starting with 2023 BIOSes: d341838d776a ("x86/PCI: Disable E820 reserved region clipping via quirks") 0ae084d5a674 ("x86/PCI: Disable E820 reserved region clipping starting in 2023") But the quirks are problematic because it's really hard to list all the machines that need them. This series is an attempt at a more generic approach. I'm told by firmware folks that EfiMemoryMappedIO means "the OS should map this area so EFI runtime services can use it in virtual mode," but does not prevent the OS from using it. The first patch removes any EfiMemoryMappedIO areas from the E820 map. This doesn't affect any virtual mapping of those areas (that would have to be done directly from the EFI memory map) but it means Linux can allocate space for PCI MMIO. The rest are basically cosmetic log message changes. Bjorn Helgaas (4): efi/x86: Remove EfiMemoryMappedIO from E820 map PCI: Skip allocate_resource() if too little space available x86/PCI: Tidy E820 removal messages x86/PCI: Fix log message typo arch/x86/kernel/resource.c | 7 +++++-- arch/x86/pci/acpi.c | 2 +- arch/x86/platform/efi/efi.c | 36 ++++++++++++++++++++++++++++++++++++ drivers/pci/bus.c | 4 ++++ 4 files changed, 46 insertions(+), 3 deletions(-) -- 2.25.1