Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1563841rwb; Thu, 8 Dec 2022 12:15:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ZHez+pbjP9Wid0UZW3mXISyFhv65p5+NhB7DKsZZBMRrZQlX24cRSLvdQZj/H7Eew9KZ4 X-Received: by 2002:a05:6402:5412:b0:460:e19c:15a3 with SMTP id ev18-20020a056402541200b00460e19c15a3mr69138442edb.252.1670530550930; Thu, 08 Dec 2022 12:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670530550; cv=none; d=google.com; s=arc-20160816; b=uxn8nSyP8EJGLmpGKzc6jHpzU1KKpuLXU5cWHnJKEzeJWxiQWtMhNqrbfzpp3o1UCN cceU8CHDO7m0h/ypSfFJW5OSpWJGC1ODgXA4fZmKQCR1Fm4ilCpwb3ITy+oeOOQMbIbO fGB8PMdtws8WH6/KqAU4fDTiu+sJMGlcbtqVw7vKjsLskblUcjt/q9e5PwwV/K8Lin0j UA/WJNpQo6VS1X3QpoO/jYVAh/hLPpnauurzWYFCNI8RWHTqtw3xe/YIAJHX7HR2huYV D2290gh1wCfkEuTIzGAM0+bdptBUz7Z4BN+Ve9BSnP1PXp8FYncUsQbnoELXWcNhZSJu buSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=u9vLWKI5zlvwnkCSzUEhWjZnJmVEh2oFq9A6y7IkT2U=; b=vbuFZ+fSTC50S1w10aCS2sHTaQbGv8ZGWzWdk+wwsFShRhmcW/5Q1f7RO/EE1v0D0+ xbrzE8qHCBA1sYrqI3VNp9bCSNUM/sJbGOLNW3gms4SYorG1/KxF07gxUQi3w4iNKQYj z9dRYOpirDXqeKVCG+uxXGjtwRKeATQ6HJNOhi4+FPMc8niJ71L/oB9GHqh70FKelgAX MoGJgNxRAmQiBAg3oR2cWhjPFViDBhXuB7Jz0K3V7eKrlGyklGLt0yl5U6m8iLTfP416 nyD9h27GPCB/hVaF8Dj6wEkRgoeQSN9DXKUkseCGrqArl5O9nKHoEeYqbiDLXxTLtYff 0cUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UwCFtErF; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy1-20020a170906fe0100b00781f51771b6si17210542ejb.900.2022.12.08.12.15.32; Thu, 08 Dec 2022 12:15:50 -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=@redhat.com header.s=mimecast20190719 header.b=UwCFtErF; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbiLHUEb (ORCPT + 74 others); Thu, 8 Dec 2022 15:04:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbiLHUE3 (ORCPT ); Thu, 8 Dec 2022 15:04:29 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09CE769A84 for ; Thu, 8 Dec 2022 12:03:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670529816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u9vLWKI5zlvwnkCSzUEhWjZnJmVEh2oFq9A6y7IkT2U=; b=UwCFtErFUf3W1sQ+BbsQWZqeuX9YXqVFdXkvC4Jh69vfuu1XF6aP1huWEFRn1SYVXvSGLz EtN/9/mmT1AJE1pd2BhJ2zWROT64NK/LsfnK8JXAahaC6yZbjIli5PZY8PF+wJQivt++ff Eniq9nTOVYXbPS0IRmfn8IoW4ewaTCY= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-78-d6BbNR1QOxyh4Yiko8cluQ-1; Thu, 08 Dec 2022 15:03:35 -0500 X-MC-Unique: d6BbNR1QOxyh4Yiko8cluQ-1 Received: by mail-ed1-f71.google.com with SMTP id w22-20020a056402269600b0046b00a9ee5fso135376edd.2 for ; Thu, 08 Dec 2022 12:03:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=u9vLWKI5zlvwnkCSzUEhWjZnJmVEh2oFq9A6y7IkT2U=; b=TvOpzKsvF1OKQYE5HaviPCmf02wnu1iVV/5i7pNE8UPmJkqlp7JIl0riW7IirlTt93 RE6+PODr8aIy/BUmdpznBUBZ8r4IZbMRd8tvaiPxYiVktaq3PvivM5E/Dv8sCOGUYwDp h+y9SJWi+zJuxXtax1CpiYmmIQGiczutBeSaaFmco66Dq/cNSFiYcd9l+ke008g6VHc5 L/Ora1DX2lY2xKwA49WWHyVfVDGrykG9lOsPR56v3xzfuz5m88JtUH6slLvcjqZqk2PK YR/jKbX2D1hhe5BzqT2eTiKQ5PiPv2MxKBysqhGI1XZv2ji6DyP0kQIZY1Bw1MMnicVY yJQg== X-Gm-Message-State: ANoB5pkNrqAxoKqFaRLPQ7BnIUOU/4y+CNFV6oDNwq4o2861JSVcNdLn kE7ukPSW6cN0L27qpMM6+XJpuRbrXLIA9i7VESskKmwaV0aiVOv9Q8D54jJJWbaoXfZcEbGFGbr HaqecE8fzCYR7mg3Tsw8U4sA5 X-Received: by 2002:a17:907:8746:b0:7bc:1e7e:6b8e with SMTP id qo6-20020a170907874600b007bc1e7e6b8emr2903728ejc.43.1670529813870; Thu, 08 Dec 2022 12:03:33 -0800 (PST) X-Received: by 2002:a17:907:8746:b0:7bc:1e7e:6b8e with SMTP id qo6-20020a170907874600b007bc1e7e6b8emr2903713ejc.43.1670529813704; Thu, 08 Dec 2022 12:03:33 -0800 (PST) Received: from ?IPV6:2001:1c00:c1e:bf00:d69d:5353:dba5:ee81? (2001-1c00-0c1e-bf00-d69d-5353-dba5-ee81.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:d69d:5353:dba5:ee81]) by smtp.gmail.com with ESMTPSA id t1-20020a170906a10100b0078d3f96d293sm3330021ejy.30.2022.12.08.12.03.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Dec 2022 12:03:33 -0800 (PST) Message-ID: <2ee3cee0-965a-a36e-da2c-d671b102c8d2@redhat.com> Date: Thu, 8 Dec 2022 21:03:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v2 0/4] PCI: Continue E820 vs host bridge window saga Content-Language: en-US, nl To: Bjorn Helgaas , linux-pci@vger.kernel.org Cc: Florent DELAHAYE , Konrad J Hambrick , Matt Hansen <2lprbe78@duck.com>, =?UTF-8?Q?Benoit_Gr=c3=a9goire?= , Nicholas Johnson , Mika Westerberg , Werner Sembach , mumblingdrunkard@protonmail.com, linux-kernel@vger.kernel.org, Bjorn Helgaas References: <20221208190341.1560157-1-helgaas@kernel.org> From: Hans de Goede In-Reply-To: <20221208190341.1560157-1-helgaas@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Hi, On 12/8/22 20:03, Bjorn Helgaas wrote: > 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 large 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. > > Changes from v1 to v2: > - Remove only large (>= 256KB) EfiMemoryMappedIO areas from E820 to avoid > the Lenovo X1 Carbon suspend/resume problems. This machine includes > 64KB of non-window space in the PNP0A03 _CRS, and a corresponding > EfiMemoryMappedIO area seems to be the only clue to avoid it (see > https://bugzilla.redhat.com/show_bug.cgi?id=2029207). Interdiff below. Thanks, v2 looks good to me: Acked-by: Hans de Goede for the series. I have also started a Fedora kernel test-build with this series added and asked the reporters of the ideapad touchpad + x1 carbon suspend/resume: https://bugzilla.redhat.com/show_bug.cgi?id=1868899 https://bugzilla.redhat.com/show_bug.cgi?id=2029207 bugs to test. Regards, Hans > 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 | 8 +++++-- > arch/x86/pci/acpi.c | 2 +- > arch/x86/platform/efi/efi.c | 46 +++++++++++++++++++++++++++++++++++++ > drivers/pci/bus.c | 4 ++++ > 4 files changed, 57 insertions(+), 3 deletions(-) >