From nobody Tue Jun 16 01:25:43 2026 Received: from sphereful.davidgow.net (sphereful.davidgow.net [203.29.242.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70EFF1A9F90 for ; Wed, 15 Apr 2026 00:38:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.29.242.92 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776213529; cv=none; b=dXA1wXpZn8+IkrLTzsBVgsMJMzAIttujIj7569tH55oKFef2NEBl+nRwPUt+tT+8jy96Z/fl2HEmFx/LwJbQ/IEj4h4Bv7N1AZen8pzNnBB24GCPcalpR8c6G7tVClaLdbZnW4CGrEcGG+KhgslABLdsVjKHYROhGrkZsmDQtqA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776213529; c=relaxed/simple; bh=I0QokC9+/QSPsExANSZmGdiHl0BhEUrPYuxYTWl/fDQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=I8kWfCYSblKqxL8V4sPFqAzfXlKeNnuthpUa8JOuIhYkQV7J6xoCyrxlGok/BDsh8OpPYh5C5DZ0Cg7HjlrTmeqK9VEWgIG1JP7L/EXBQMC31xsrj7zw1e/tKu3mgpMMho7xD+n+BTZl7A0ct/ls/t6IexjMpaTfYOxudDFm2WM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=davidgow.net; spf=pass smtp.mailfrom=davidgow.net; dkim=pass (4096-bit key) header.d=davidgow.net header.i=@davidgow.net header.b=s172O2Z2; dkim=pass (4096-bit key) header.d=davidgow.net header.i=@davidgow.net header.b=sYSQ04S+; arc=none smtp.client-ip=203.29.242.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=davidgow.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=davidgow.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=davidgow.net header.i=@davidgow.net header.b="s172O2Z2"; dkim=pass (4096-bit key) header.d=davidgow.net header.i=@davidgow.net header.b="sYSQ04S+" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=davidgow.net; s=201606; t=1776213041; bh=I0QokC9+/QSPsExANSZmGdiHl0BhEUrPYuxYTWl/fDQ=; h=From:To:Cc:Subject:Date:From; b=s172O2Z22PYwKWLjYh25eNz5KdUXT//XRtyR/23qJK+upXIVawYaN7sBvmeXqgCdN KA3DZw/34pZxj/YEE0zZANPnG1yddMyszIzGoJquKq7xbm2O6PpFO5brjX2wxBDm9j kosNCX7sktkSaoibVY+6bv0rum9IFzxNoNUfvUiSXbq86RbulAthctArbc5RLUU4gE yykPeHrBN4k6kmqHQAAjWALLkxsZT9UogqAidFShoTV+vB0r6mnnrCKQKB1/5Eeokl +vtaVHUSWe/HwaW3GOXX7Rg/N6jhTanl24dV5hfpVHtGBaezJ+zhjZa9Uv7dTry8nS 9uspUoZTnweiFwIDzH4h5ujjzdGECFM93HK3LN7d8r/7O1P5ZYp8mY+jb6NaaziG3z BS/gdF9n+Dbe0zFBErtB6I2wd/rPHZtRkFSCQRHn6X4vt63UFNLcI83iOCm3Sbqc3w /t9Vpb4aQDpVSqD1NIcU6BqbqOK6iQtirFuTe9MK9DOnQ9K4Jsn0LCyAK5xIo8MwnV dM3fJ9CQ5We0utytDJoaWzc8WGw3TfpMupw2vBPmqdUGKubj2FV9LqKLqQbmvjiRlJ ly2xZMtM8IG9EWf7BIAO5oXJwISx70ieTDOg2cYyrRwU8k85wN2kWbnlH8956JiY4G tG0vsgm7isU4yQ7aWnUrLG3c= Received: by sphereful.davidgow.net (Postfix, from userid 119) id ECD8B1E8A71; Wed, 15 Apr 2026 08:30:41 +0800 (AWST) X-Spam-Level: DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=davidgow.net; s=201606; t=1776213040; bh=I0QokC9+/QSPsExANSZmGdiHl0BhEUrPYuxYTWl/fDQ=; h=From:To:Cc:Subject:Date:From; b=sYSQ04S+HgLEKqF+dyFhWhOMu6mKgUgVew+Q4cKVHTSjS6SxhFXE4BqIZD0/3SI7W iNMuPJIjdSHMJUhIAFmtLSrSMg2dqk9HnDqxjDFdF9ZRNkaf0DYcxDiI3Un3M8AgX2 Y4vEaN1ToD1o+Z9ABkVmpLtFDuG7qkzNIrHJMc1YTCDTrBAMTU9chVLG7GI1Pn7h7O iN/mb7gtW+I6x1jCiQX7B30ug0FWl+kKX+9BHWBTDrw/qHWkDd+aebcWjIbShlJ8Do HVKgX9pfxYqjhdmXeSnlFn+5LsEpy+BmV0xiQLVPguv6VU0YU/yGg9F5arZgX1IYzv z1ojsvVwdk1xM0GUcKFKklr8fvxHUJ4Cgf22+Yas9I4LI5TEpmk4kKo+rIfouKRKdJ M+qpwykjNjv30dlJiss7t4eYF16VBcYmn53Fd+pIic0KbKcMA+f+bClc27g3lBjXv5 +OvbW6Buz6Smnp9OY0sg4EqSGp9Vq0PHVG6/mbzwJnlAdcsfp20aUKdwyIukqEmmUl onlcugwH29EnZu7uHgVciFlYF7splwQtNjQR10kavi4W5niDTA007+k6yBdHFvGKvr DtPOI3tk+eCyE2jpY3dwYQnqfAQUdsFsyfYmCOVgGKHTSmoPDyk6B8+Q2QOuBkkXot ysgIlu3r7ZYBpI9SCBjXZuYU= Received: from sparky.lan (unknown [IPv6:2001:8003:8810:ea00:ed87:ca88:5326:e11d]) by sphereful.davidgow.net (Postfix) with ESMTPSA id 7A9A41E8A6C; Wed, 15 Apr 2026 08:30:40 +0800 (AWST) From: David Gow To: Ingo Molnar , Thomas Gleixner Cc: David Gow , Borislav Petkov , Dave Hansen , x86@kernel.org, Andy Shevchenko , Arnd Bergmann , Nikolay Borisov , "H . Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH] x86/boot/e820: Re-enable fallback if e820 table is empty Date: Wed, 15 Apr 2026 08:30:18 +0800 Message-ID: <20260415003021.1543723-1-david@davidgow.net> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In commit 157266edcc56 ("x86/boot/e820: Simplify append_e820_table() and re= move restriction on single-entry tables"), the check that the number of entries in the e820 table was removed. The intention was to support single-entry maps, but by removing the check entirely, we also skip the fallback (to, e.g., the BIOS 88h function). This means that if no E820 map is passed in from the bootloader (which is the case on some bootloaders, like linld), we end up with an empty memory map, and the kernel fails to boot (either by deadlocking on OOM, or by failing to allocate the real mode trampoline, or similar). Re-instate the check in append_e820_table(), but only check nr_entries is non-zero. This allows e820__memory_setup_default() to fall back to other memory size sources, and doesn't affect e820__memory_setup_extended(), as the latter ignores the return value from append_e820_table(). Tested against linld, and the kernel boots again fine. Fixes: 157266edcc56 ("x86/boot/e820: Simplify append_e820_table() and remov= e restriction on single-entry tables") Signed-off-by: David Gow --- arch/x86/kernel/e820.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 2a9992758933..7dfd4bdc95fb 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -450,6 +450,10 @@ __init static int append_e820_table(struct boot_e820_e= ntry *entries, u32 nr_entr { struct boot_e820_entry *entry =3D entries; =20 + /* If there aren't any entries, we'll want to fall-back to another source= . */ + if (!nr_entries) + return -1; + while (nr_entries) { u64 start =3D entry->addr; u64 size =3D entry->size; --=20 2.53.0