From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 21C2F37E2F9 for ; Wed, 15 Apr 2026 08:51:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776243116; cv=none; b=aCZRyyKA1sU3y0fQSkwTAAnB3w/QlgJUcKCcUL57n87LYzAwRuKyXQI1Q/bOmqxVemDoYFcY1Lww56LL7RTfmH6xak7piczZwQvEm+/joyklI5vlP99vaR6nFjjCsFjSVaeKIIPZzkblvRfNOAFfI0vMc09t01biKuz7Ot3tkrg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776243116; c=relaxed/simple; bh=6pUn6Tqadn/2k0ftAXvABlUZ2+cNlJkOMoZcR3N/b3s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hPc03AGREKfjbdle06PFFtMYLceqUob50htkLDPGeGpR+eQ7f+l1x1Fd+BlHpYDS2dKOhs2UVR5p1pLM5maeqinKZ93zDQidkW0qvkoOSGzo5IFZuvU5l5NBz8eyXoSWWQlqCYQ2RN7f+awS0O4GdyizqsRd2Pn8SStG8/tz5/I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iBjANUMG; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iBjANUMG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1776243114; x=1807779114; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=6pUn6Tqadn/2k0ftAXvABlUZ2+cNlJkOMoZcR3N/b3s=; b=iBjANUMGSAO1QwZGKjfXQptLQzdedYoCRD1zmc7D9QYkLHDtHQEEWF8C tfDPtHlgKvAvJj5B21g/zXN6g933cXs4O+TCB9/tnAQcpH5xtrqzQphXJ +71/+vFtzxZXImqafet317cJOlQ8UUdo1/PCTA0FSMUtpmo6fMKrNLgCt Lyh05rKKpNGJxixc7TxSmmxHxkwAlIVKuL9baHRSpmbbPJia6OHu6MR5B F+8NE8Uol3GoyGqGxOAtVgnbTsDrRBC701QrC/tq/w8rqVXvxpVsF5qW6 bDMS686Ram5Tnz1leNNrqdPa6PY5yA9iz7PqDXENxH1vLf9BppOseXUZD g==; X-CSE-ConnectionGUID: y5XdWzQWS3yfeLhe0Kgcxg== X-CSE-MsgGUID: v1e8yjCYQgu6j0E/2RO2EA== X-IronPort-AV: E=McAfee;i="6800,10657,11759"; a="77120061" X-IronPort-AV: E=Sophos;i="6.23,179,1770624000"; d="scan'208";a="77120061" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2026 01:51:53 -0700 X-CSE-ConnectionGUID: hpgHenbdQCaYWAl7BpuQJg== X-CSE-MsgGUID: NCLGW1RVR/y9nlPGK9LMdg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,179,1770624000"; d="scan'208";a="227717338" Received: from rvuia-mobl.ger.corp.intel.com (HELO localhost) ([10.245.244.34]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2026 01:51:51 -0700 Date: Wed, 15 Apr 2026 11:51:48 +0300 From: Andy Shevchenko To: David Gow Cc: Ingo Molnar , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, Andy Shevchenko , Arnd Bergmann , Nikolay Borisov , "H . Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/boot/e820: Re-enable fallback if e820 table is empty Message-ID: References: <20260415003021.1543723-1-david@davidgow.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260415003021.1543723-1-david@davidgow.net> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Wed, Apr 15, 2026 at 08:30:18AM +0800, David Gow wrote: > In commit 157266edcc56 ("x86/boot/e820: Simplify append_e820_table() and remove restriction on single-entry tables"), Note, it's fine to wrap this line in the commit message, it's only requirement to tags to be "1 tag — 1 line". > 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 remove restriction on single-entry tables") ... > struct boot_e820_entry *entry = entries; > > + /* If there aren't any entries, we'll want to fall-back to another source. */ > + if (!nr_entries) > + return -1; Can we return -ENODATA or -ENOENT here? -- With Best Regards, Andy Shevchenko