public inbox for linux-hotplug@vger.kernel.org
 help / color / mirror / Atom feed
From: Cristian Cocos <cristi@ieee.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: Make ReBAR Great Again
Date: Thu, 26 Mar 2026 11:01:02 -0400	[thread overview]
Message-ID: <ec7dbc9aeab3f7e497ba6e10712da047cf5bc14e.camel@ieee.org> (raw)
In-Reply-To: <b60b2f7c039f5f325fc54a75230f595a2278776b.camel@ieee.org>

Is this the right forum to post this? The hotplug list looked to me to
be the most appropriate venue, though please advise if you guys can
think of a more appropriate recipient.

The short story is that ReBAR does not work in hotplug scenarios:
hotplugged eGPUs are forced onto a 256MB BAR regardless of the system's
ReBAR capabilities, and this because during hotplug the Linux kernel
does not consult the ReBAR capability. It's that simple. Seeing as
eGPUs are becoming more popular, accommodating eGPU hotplug scenarios
becomes stringent.

On Sun, 2026-03-08 at 15:35 -0400, Cristian Cocos wrote:
> The following is a suggestion for the Linux kernel devs.
> 
> Now that Thunderbolt eGPUs have become more common, it might be a
> good
> idea to make the Linux kernel ReBAR-over-Thunderbolt friendly. This,
> I
> contend, can be done by simply mimicking the system behavior at boot
> time.
> 
> The current Thunderbolt eGPU *hotplug* sequence of events is this:
> BAR
> 2's hardware register powers up at 256 MB — the default size
> programmed
> into the BAR's address decoder by Intel at the factory. The PCIe
> Resizable BAR capability advertises support for up to 16 GB, but it's
> passive — software must explicitly exercise it. When a Thunderbolt
> eGPU
> is hotplugged at runtime, the kernel's PCI subsystem enumerates the
> new
> device, reads the BAR at its 256 MB default, sizes the bridge windows
> to match, and assigns addresses — all before any driver loads. The
> ReBAR capability is never consulted(!) during this process.
> 
> A workaround is available for cold-plug scenarios only, and is
> achieved by means of the **thunderbolt.host_reset=0** kernel
> parameter:
> this preserves the BIOS's PCIe tunnel and BAR assignments from POST
> (where the BIOS *does* exercise ReBAR). This delivers the full 16 GB
> BAR but, as just mentioned, only works for cold-plug(!) scenarios —
> if
> the eGPU is power-cycled at runtime, the new tunnel gets the 256 MB
> default.
> 
> The proper fix would be for the kernel's PCI hotplug resource
> assignment to *first* check for ReBAR capability during enumeration,
> resize the BAR to the largest supported size that fits within
> available
> bridge headroom, and *then* commit bridge windows and assign
> addresses.
> This is essentially what the BIOS does during POST. It hasn't been
> implemented yet because eGPU-over-Thunderbolt-with-ReBAR is (was?) a
> niche use case.
> 
> Well, no more niche use case. eGPU-over-Thunderbolt is becoming
> mainstream.
> 
> 

  reply	other threads:[~2026-03-26 15:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 19:35 Make ReBAR Great Again Cristian Cocos
2026-03-26 15:01 ` Cristian Cocos [this message]
2026-03-26 15:16   ` Greg KH

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=ec7dbc9aeab3f7e497ba6e10712da047cf5bc14e.camel@ieee.org \
    --to=cristi@ieee.org \
    --cc=linux-hotplug@vger.kernel.org \
    /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