From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6757F1DF73A for ; Sun, 8 Mar 2026 19:35:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772998514; cv=none; b=fHzjUHo0WGvgprPvPTm3cMGcbFk6ovDCAh5Y01prqZNmtAzkcqJh2n+SlBLK6h53J3OPD0LzwQkDBBk330ke9zC+tQhzBuLe+EUwF3uAh4smZ7ybrF9NrYuqb4U+Kp8mMQgulJaSQyishv68BTP4ccxUdq8tk9eQDt0MppM4Dew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772998514; c=relaxed/simple; bh=zm2Dv0vAUHbhHZLkCmUrHI0RLkGZ7IkSeHGtKXUgoNA=; h=Message-ID:Subject:From:To:Date:Content-Type:MIME-Version; b=pH8SyucPmce25GeinSoDZlogwFkizn6iZ4tbj6P8BDIkr59F0/TF32Di6iIO9ywfLyUDGNmEccTjqHn70a/4x9So5h6nBE6j5si/KD8P09AlDwGwEM4VNH/hprt2DL/ys0pqYmWFp3K5EPrZQ4fiPy3DLuRDiLPFh3//DCdhEyg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ieee.org; spf=pass smtp.mailfrom=ieee.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b=ISDWZhqO; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ieee.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ieee.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="ISDWZhqO" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-8cd8a189f44so18387585a.0 for ; Sun, 08 Mar 2026 12:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; t=1772998511; x=1773603311; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:from:to:cc:subject:date:message-id:reply-to; bh=zm2Dv0vAUHbhHZLkCmUrHI0RLkGZ7IkSeHGtKXUgoNA=; b=ISDWZhqOfLgxfZyhNyyIn0v5H33n2WbQFsCc5AK/KRbc4ZrON0d/fVENU81bmRBlkn JvCMpfvRnOaosAC7E7H2SdgDYYE1MKCoBJ407gwv9CaCf1RW/DuIomhs4Wu99R2LTOqA ZM+n7tZQYJ+t2UnlnFeXq86Gf1LNeOdrWzSoU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772998511; x=1773603311; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=zm2Dv0vAUHbhHZLkCmUrHI0RLkGZ7IkSeHGtKXUgoNA=; b=joxgrbe+mO3zaWI8D5nKd9UhenNq5wUPORxJRNsG7SrM1tNP/vVwqVKrQP60vrEK0D Vz1ZAeWhjJyrunEuDvcY01p52eaDBPochWUkSSrin4U2My8rhZo2bADBy0WClfTYskj1 8Ay7Iaj74ErP0wv6Synu6fiEI5K4u0LXd+8SwP3ogK77N7bDAB5PNe2XkgF0Ebvwe1bI dp+zN3wTJdbb/Itmq1TyizYMOnt9JaGHILMjWt6fPUz5KEQ9YWM48dwxoDdWm1euFHrL FJJCCNQJM949JBSY158eIEv3xl+Tpsec/e2hkktJAQqXosi5U3L5ebhWZrfBgZp01AIW xa2A== X-Gm-Message-State: AOJu0YwpnwYx9+vu36e/5zVetr4fNlkt6EvreUfTqR9FmTREO7q49Dq7 F/28d17OqvWdVJtkcX3FEJdKLru7K8XdGQ0PbVejz/rhmh4ha3LSGie3raDHe63Qo/VczRENz99 QP8AjRP6K8c8Lk96ILAuOcML4bfIIwaOt6I9lIoRDeIkr3Wcv1GeIpwYOqj5L2VH4AP0dtgHw/U LBUGMFfb8YVSSrS2mOP/Qh9PgXlcGBiyi7gSl+ko1Z7w== X-Gm-Gg: ATEYQzxe0DYVrpUJ9o6cdEv9Y/sR+mrvwlsRv3SDgqfHX2pvWkvlzDwhPqOy19YS/vR ZHyQ1CxuD5GgcnA/kvvLLt1tPxb9CJl23nnk6FqyiIB92F8LMDqGT8bRgLQPEK1X1vICZuuyw5g ASNsvI8vyFM+wWRZ3crczg3ZH5dOuQ3qsr6KijhpdV9tXFh9cRrYG1H8DnPUGPIfU7WTenTL0l0 78Fx4Rln8TAzwJDai1bh53bQ9BREyRJ025jhhkjCTNCKS74QiUVKuSQf6cQRX+2LGOOO8/MA5hx MeLhpjRgAj/Xxa7/3nqROmqj0Y+1yDFCdAIDRCf+Ti0Isy0eEUs3c76kLJboZVp67SRck5IWD/h D8r15E8Bqf0eCh1/H4wyv9hONDCmjNPSOiSuLL3J827wbs38E2A02d1oVJV3blZ9UnidXM9o8HN zkEW5q+vrVZggQ2SAHZiUNkQg= X-Received: by 2002:a05:620a:318f:b0:8c7:1a83:a15a with SMTP id af79cd13be357-8cd6d501df4mr1142609485a.59.1772998510962; Sun, 08 Mar 2026 12:35:10 -0700 (PDT) Received: from [192.168.153.215] ([73.29.38.247]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cd6f53b83esm538394385a.29.2026.03.08.12.35.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Mar 2026 12:35:10 -0700 (PDT) Message-ID: Subject: Make ReBAR Great Again From: Cristian Cocos To: linux-hotplug@vger.kernel.org Date: Sun, 08 Mar 2026 15:35:10 -0400 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (by Flathub.org) Precedence: bulk X-Mailing-List: linux-hotplug@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 =E2=80=94 the default size progra= mmed 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 =E2=80=94 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 =E2=80=94 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=C2=A0by means of the **thunderbolt.host_reset=3D0** kernel paramet= er: 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 =E2=80=94= 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=C2=A0*first*=C2=A0check for ReBAR capability during enumerati= on, resize the BAR to the largest supported size that fits within available bridge headroom, and=C2=A0*then*=C2=A0commit bridge windows and assign addr= esses. 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.