Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Werner Sembach <wse@tuxedocomputers.com>
To: Hans de Goede <hdegoede@redhat.com>, Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-pci@vger.kernel.org,
	"Florent DELAHAYE" <kernelorg@undead.fr>,
	"Konrad J Hambrick" <kjhambrick@gmail.com>,
	"Matt Hansen" <2lprbe78@duck.com>,
	"Benoit Grégoire" <benoitg@coeus.ca>,
	"Nicholas Johnson" <nicholas.johnson-opensource@outlook.com.au>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>,
	mumblingdrunkard@protonmail.com, linux-kernel@vger.kernel.org,
	"Bjorn Helgaas" <bhelgaas@google.com>
Subject: Re: [PATCH 0/4] PCI: Continue E820 vs host bridge window saga
Date: Mon, 5 Dec 2022 14:27:09 +0100	[thread overview]
Message-ID: <9869d438-a715-fa5e-2877-b58f1bb6fc91@tuxedocomputers.com> (raw)
In-Reply-To: <d7f1408d-ae9f-ad55-5fc9-9d9886384a3d@redhat.com>

Hi

Am 04.12.22 um 10:29 schrieb Hans de Goede:
> Hi Bjorn,
> 
> On 12/3/22 18:57, Bjorn Helgaas wrote:
>> On Sat, Dec 03, 2022 at 01:44:10PM +0100, Hans de Goede wrote:
>>> Hi Bjorn,
>>>
>>> On 12/2/22 22:18, Bjorn Helgaas wrote:
>>>> From: Bjorn Helgaas <bhelgaas@google.com>
>>>>
>>>> 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.
>>>
>>> Thank you for working on this. I'm a bit worried about this series though.
>>>
>>> The 2 things which I worry about are:
>>>
>>>
>>> 1. I think this will not help when people boot in BIOS (CSM) mode rather
>>> then UEFI mode which quite a few Linux users still do because they learned
>>> to do this years ago when Linux EFI support (and EFI fw itself) was still
>>> a bit in flux.
>>>
>>> IIRC from the last time we looked at this in CSM mode the BIOS itself
>>> translates the EfiMemoryMappedIO areas to reserved E820 regions. So when
>>> people use the BIOS CSM mode to boot, then this patch will not help
>>> since the kernel lacks the info to do the translation.
>>
>> Right, if BIOS CSM puts EfiMemoryMappedIO in the E820 map the same way
>> bootloaders do, and the kernel doesn't have the EFI memory map, this
>> series won't help.
> 
> So I just got the requested dmesg in BIOS CSM mode from:
> https://bugzilla.redhat.com/show_bug.cgi?id=1868899
> 
> And it says:
> 
> [    0.000000] BIOS-e820: [mem 0x000000004bc50000-0x00000000cfffffff] reserved
> [    0.316140] pci_bus 0000:00: root bus resource [mem 0x65400000-0xbfffffff window]
> 
> So I'm afraid that I remembered correctly and the CSM adds
> the EfiMemoryMappedIO regions to the E820 map as reserved :(
> 
> So as you said, this series won't help for people booting in
> BIOS compatibility mode. Which means that we should at least keep
> the current list of no_e820 quirks to avoid regressing those models
> when booted in BIOS compatibility mode.
> 
> And maybe still add at least the Clevo model for which I recently
> submitted a new no_e820 quirk so that that will work in BIOS CSM
> mode too ?
Do you mean the X170KM-G? I don't think it has the option to switch to Legacy 
BIOS mode (At least i didn't found an option in the bios version i have)
> 
> Note I know you did not propose to drop the quirks in this series,
> just covering all the bases here.
> 
> Regards,
> 
> Hans
> 
> 
> 
> 
Kind regards,
Werner Sembach

  reply	other threads:[~2022-12-05 13:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 21:18 [PATCH 0/4] PCI: Continue E820 vs host bridge window saga Bjorn Helgaas
2022-12-02 21:18 ` [PATCH 1/4] efi/x86: Remove EfiMemoryMappedIO from E820 map Bjorn Helgaas
2022-12-02 21:18 ` [PATCH 2/4] PCI: Skip allocate_resource() if too little space available Bjorn Helgaas
2022-12-02 21:18 ` [PATCH 3/4] x86/PCI: Tidy E820 removal messages Bjorn Helgaas
2022-12-02 21:18 ` [PATCH 4/4] x86/PCI: Fix log message typo Bjorn Helgaas
2022-12-03 12:44 ` [PATCH 0/4] PCI: Continue E820 vs host bridge window saga Hans de Goede
2022-12-03 17:57   ` Bjorn Helgaas
2022-12-04  9:13     ` Hans de Goede
2022-12-07 15:31       ` Hans de Goede
2022-12-08 18:57         ` Bjorn Helgaas
2022-12-08 19:16           ` Hans de Goede
2022-12-08 20:06             ` Bjorn Helgaas
2022-12-08 20:19               ` Hans de Goede
2022-12-04  9:29     ` Hans de Goede
2022-12-05 13:27       ` Werner Sembach [this message]
2022-12-05 14:26         ` Hans de Goede
     [not found]           ` <CANBHt+MoHWz6nB39N3vCM8OkWcjqn_5Va-_bbEcknYDQ3Ve8=Q@mail.gmail.com>
2022-12-05 19:21             ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9869d438-a715-fa5e-2877-b58f1bb6fc91@tuxedocomputers.com \
    --to=wse@tuxedocomputers.com \
    --cc=2lprbe78@duck.com \
    --cc=benoitg@coeus.ca \
    --cc=bhelgaas@google.com \
    --cc=hdegoede@redhat.com \
    --cc=helgaas@kernel.org \
    --cc=kernelorg@undead.fr \
    --cc=kjhambrick@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=mumblingdrunkard@protonmail.com \
    --cc=nicholas.johnson-opensource@outlook.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox