[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 04/44] x86/boot: move mmap info to boot info


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Wed, 9 Oct 2024 20:59:22 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728521966; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=WerD3T26xORxZ1WANjFbaYCNzR7Qa1qL5Jp0Y7YENtg=; b=SsHotlmd3HPRhw7qcrPLDAxSJ2IgYloC6TEBTZmoZwmblzTy8/hALKxmWej8R1vTitLdvbfbtesKv4p8QhPlLxoswtOnLI5Bgn/hSwzcYDcqqCAbwgvfJ78LzMX/Zngm8CRDaW/z1+tb5Y04/3wKESs9pzGx16wdYXejSWiCavs=
  • Arc-seal: i=1; a=rsa-sha256; t=1728521966; cv=none; d=zohomail.com; s=zohoarc; b=hBoV0jP2yJXFvJEJPeBq59dmYTZ0dcniSGj5VTj9/PZ6O6LUHPXe9BLuKFx5mJa5J+PJtqIuEzCBmeKqjGHFtH4eEGD20SwZwCE2gm5fCcPSH0vbkFzvbpiyp0mo74dpgjAD9pg+qGHqxFwYjLodgqqhnCyQLrHTVnVJDo4Zu8A=
  • Cc: jason.andryuk@xxxxxxx, christopher.w.clark@xxxxxxxxx, stefano.stabellini@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 10 Oct 2024 00:59:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/9/24 11:13, Jan Beulich wrote:
On 06.10.2024 23:49, Daniel P. Smith wrote:
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -296,6 +296,12 @@ static struct boot_info __init 
*multiboot_fill_boot_info(unsigned long mbi_p)
      else
          bi->cmdline = "";
+ if ( mbi->flags & MBI_MEMMAP )
+    {
+        bi->memmap_addr = mbi->mmap_addr;
+        bi->memmap_length = mbi->mmap_length;
+    }
+
      return bi;
  }
@@ -1185,13 +1191,13 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      {
          memmap_type = "Xen-e820";
      }
-    else if ( mbi->flags & MBI_MEMMAP )
+    else if ( bi->memmap_addr )

I'd like to note that this isn't an exact transformation, as with the flag
set the memory map could theoretically also like at address 0. As long as
the legacy BIOS layout of low memory is as it is, that won't happen. I'm
less certain going forward, for legacy-free hardware/firmware. Imo at the
very least this needs mentioning as intentional in the description, for
archeologists to later be able to tell whether this was an oversight.

Or maybe it would be better to check ->memmap_length? That being zero
clearly means there's effectively no map.

I think checking memmap_length is a better approach because as you say, the only time it will be zero is if no map was provided.

v/r,
dps



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.