From nobody Fri Nov 22 05:48:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=dpsmith@apertussolutions.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=apertussolutions.com) ARC-Seal: i=2; a=rsa-sha256; t=1729184895; cv=pass; d=zohomail.com; s=zohoarc; b=KG1bpY+RWyWPkvbAq8Ni51ItlEcwE8myOTP1V8PRfV8xaK0v+M2G7K+sx2pAjl2EFVom2f6L7D7JV6HbEOPhBKi9QXxMSetZMR1Q2t3dXgTB6OtR5B7osW6OE3fd97MBOL3uBhFpr93coFM9UVnWr3RMBN6zaHWUJ+7riPuuAkw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729184895; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3fsfruenGzMW022TyDqthGbN65HLKdpAAZMOHPTj6cg=; b=MwQDdw86/7Vfzd1fa+cJrTuJUv27FqolpI+XFVXclvSxCyH1rFJYMD8Cu4Gy34DZIYClCJQlxmyStLsD2htSdWVfMGxTaQzGWoXA5XVtl/5Y+ErhXsKXkyhpj8tSG0S9DhNNkMp4aD8DaFOUB/tskPKdMdn6sf7BGPnuNzoi5Xo= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=dpsmith@apertussolutions.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=apertussolutions.com) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1729184895739761.9901340030736; Thu, 17 Oct 2024 10:08:15 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.820889.1234589 (Exim 4.92) (envelope-from ) id 1t1Tyd-0005tJ-BW; Thu, 17 Oct 2024 17:07:55 +0000 Received: by outflank-mailman (output) from mailman id 820889.1234589; Thu, 17 Oct 2024 17:07:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t1Tyd-0005tC-8L; Thu, 17 Oct 2024 17:07:55 +0000 Received: by outflank-mailman (input) for mailman id 820889; Thu, 17 Oct 2024 17:07:53 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t1Tv4-0006TN-7w for xen-devel@lists.xenproject.org; Thu, 17 Oct 2024 17:04:14 +0000 Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d412f094-8ca9-11ef-99a3-01e77a169b0f; Thu, 17 Oct 2024 19:04:12 +0200 (CEST) Received: by mx.zohomail.com with SMTPS id 1729184619793164.3023967873388; Thu, 17 Oct 2024 10:03:39 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d412f094-8ca9-11ef-99a3-01e77a169b0f ARC-Seal: i=1; a=rsa-sha256; t=1729184622; cv=none; d=zohomail.com; s=zohoarc; b=cQk1zZ7TwRBci2G9oF6og8rdWMqi3KtNbdnlRxViRtcKnaW9xnnpQ/QW2lVfu8AwXmcFWi74fDK7H0oMV48tBLgP7v8IBm34qYjbivmNZEe6PCTqpNHR63Y5MvMRKyItrPtP2iKenrS+X9wU19nWur/IVZ0u4bP+IB8qenIU2Bo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729184622; h=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=3fsfruenGzMW022TyDqthGbN65HLKdpAAZMOHPTj6cg=; b=Zay2ybEtCrHNIWi/jHt36aQFMMY3HOPjUeNSYbYWMGpZ0bne9jjuinavfDPcoPaxFsVSnfBhSGJh9Ocicflwz2MXMF5NNth755MzJxJNYKDK3rNgCXe0XWycjc9ZbBuxviryB9RJdVbJQWyycCccELdOqBe5kRcWYfqTw1gvWQE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1729184622; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=3fsfruenGzMW022TyDqthGbN65HLKdpAAZMOHPTj6cg=; b=p1dnh5wu2HChCm67ww/Dz9smgUzf0jbdB+ZDPt61AWymLWVp7LS1BZa1mdg74Sc1 b0LPdA8UMQRKksuGZ29LmKYpTl0kZ7Gc2TMObaLpDcpqTrIiBpkStXNzaIY/YQmAXNX kyHQ5nMZJhwIoPYk4G6Vf8EACMWJlkxDXUeajnhE= From: "Daniel P. Smith" To: xen-devel@lists.xenproject.org Cc: "Daniel P. Smith" , jason.andryuk@amd.com, christopher.w.clark@gmail.com, stefano.stabellini@amd.com, Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v6 04/44] x86/boot: move mmap info to boot info Date: Thu, 17 Oct 2024 13:02:44 -0400 Message-Id: <20241017170325.3842-5-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241017170325.3842-1-dpsmith@apertussolutions.com> References: <20241017170325.3842-1-dpsmith@apertussolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-ZohoMail-DKIM: pass (identity dpsmith@apertussolutions.com) X-ZM-MESSAGEID: 1729184917370116600 Content-Type: text/plain; charset="utf-8" Transition the memory map info to be held in struct boot_info. No functional change intended. Signed-off-by: Daniel P. Smith Reviewed-by: Jason Andryuk --- Changes since v5: - reorder of struct boot_module fields - changed to memmap_length check for memmap detection --- xen/arch/x86/include/asm/bootinfo.h | 5 +++++ xen/arch/x86/setup.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm= /bootinfo.h index efbbd30cc514..f75a7e72a700 100644 --- a/xen/arch/x86/include/asm/bootinfo.h +++ b/xen/arch/x86/include/asm/bootinfo.h @@ -8,6 +8,8 @@ #ifndef __XEN_X86_BOOTINFO_H__ #define __XEN_X86_BOOTINFO_H__ =20 +#include + /* * Xen internal representation of information provided by the * bootloader/environment, or derived from the information. @@ -16,6 +18,9 @@ struct boot_info { const char *loader; const char *cmdline; =20 + paddr_t memmap_addr; + size_t memmap_length; + unsigned int nr_modules; }; =20 diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 037cdd17386c..f7ea482920ef 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -296,6 +296,12 @@ static struct boot_info *__init multiboot_fill_boot_in= fo(unsigned long mbi_p) else bi->cmdline =3D ""; =20 + if ( mbi->flags & MBI_MEMMAP ) + { + bi->memmap_addr =3D mbi->mmap_addr; + bi->memmap_length =3D mbi->mmap_length; + } + return bi; } =20 @@ -1185,13 +1191,13 @@ void asmlinkage __init noreturn __start_xen(unsigne= d long mbi_p) { memmap_type =3D "Xen-e820"; } - else if ( mbi->flags & MBI_MEMMAP ) + else if ( bi->memmap_length ) { memmap_type =3D "Multiboot-e820"; - while ( bytes < mbi->mmap_length && + while ( bytes < bi->memmap_length && e820_raw.nr_map < ARRAY_SIZE(e820_raw.map) ) { - memory_map_t *map =3D __va(mbi->mmap_addr + bytes); + memory_map_t *map =3D __va(bi->memmap_addr + bytes); =20 /* * This is a gross workaround for a BIOS bug. Some bootloaders= do --=20 2.30.2