From patchwork Sun Oct 6 21:49:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daniel P. Smith" X-Patchwork-Id: 13823894 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8EDF7CFB43F for ; Sun, 6 Oct 2024 21:56:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.811370.1224057 (Exim 4.92) (envelope-from ) id 1sxZEw-0005Aj-V0; Sun, 06 Oct 2024 21:56:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 811370.1224057; Sun, 06 Oct 2024 21:56:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxZEw-0005AI-QM; Sun, 06 Oct 2024 21:56:34 +0000 Received: by outflank-mailman (input) for mailman id 811370; Sun, 06 Oct 2024 21:56:33 +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 1sxZBo-00051E-MH for xen-devel@lists.xenproject.org; Sun, 06 Oct 2024 21:53:20 +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 650a9e33-842d-11ef-99a2-01e77a169b0f; Sun, 06 Oct 2024 23:53:18 +0200 (CEST) Received: by mx.zohomail.com with SMTPS id 1728251432400543.0775612505048; Sun, 6 Oct 2024 14:50:32 -0700 (PDT) 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: 650a9e33-842d-11ef-99a2-01e77a169b0f ARC-Seal: i=1; a=rsa-sha256; t=1728251434; cv=none; d=zohomail.com; s=zohoarc; b=Wo8l/iqs0v+YfsaZggX/JdItZU2EmCAUgfcamMKYsfid1EJDnECFn4sKQJAHUyxaeNoJZx77kzctPUMAiCEE3FPuZJdTVYq0mFoyNv0deqgNymhsgE2nZKxOE8hkqMDpgCj2do7bb8kxhFRMjFGTanGN0yBThnxHXBEsiXGyjeM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728251434; 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=DcuCOm6F9wLbL6EWI6TTjiee10KbQ7Dlc1P2+oEs++8=; b=OEG2q/wo8v1TSZnurKIcogeSRcN0SIJHJx4/3DPCCD5dqepJNRwK+THd/e1lBr9Fjz95vclJfhzCdHw4Qi9lyPxJ0hGvQBSbX3tnTV70N8A0IR8fPs+4Rs4QzRf7RaCpu3r8JSWmnuhFMpDEru3w0YeMjId5cKDEdDw2C7rIrew= 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=1728251434; 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=DcuCOm6F9wLbL6EWI6TTjiee10KbQ7Dlc1P2+oEs++8=; b=B0mBQ53ebkIPVGD6KF5U3rj4y012k0er12okRIsoW5dXagXZ1xAP9ZPE0hVUyqSG pbI6CLMhIRbcSQ8luiw7Y9dsHjrhQ4Wvhp7L7JmywDTwNcT/DU5vU4HTBzFVTwDPpu+ iZlCeOz+MOBnbtu++fqPqfxiZwc68GtGri85uFhg= 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_Pau_Monn=C3=A9?= Subject: [PATCH v5 24/44] x86/boot: remove module_map usage by ramdisk loading Date: Sun, 6 Oct 2024 17:49:35 -0400 Message-Id: <20241006214956.24339-25-dpsmith@apertussolutions.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20241006214956.24339-1-dpsmith@apertussolutions.com> References: <20241006214956.24339-1-dpsmith@apertussolutions.com> MIME-Version: 1.0 X-ZohoMailClient: External The ramdisk loading is the last user of module_map, remove its usage and any remaining remnants of module_map. Signed-off-by: Daniel P. Smith --- xen/arch/x86/setup.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index b0946216ea3f..0d2ee19998aa 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1037,7 +1037,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p) struct boot_info *bi; multiboot_info_t *mbi; module_t *mod; - unsigned long nr_pages, raw_max_page, module_map[1]; + unsigned long nr_pages, raw_max_page; int i, j, e820_warn = 0, bytes = 0; unsigned long eb_start, eb_end; bool acpi_boot_table_init_done = false, relocated = false; @@ -1187,15 +1187,14 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p) panic("dom0 kernel not specified. Check bootloader configuration\n"); /* Check that we don't have a silly number of modules. */ - if ( bi->nr_modules > sizeof(module_map) * 8 ) + if ( bi->nr_modules > MAX_NR_BOOTMODS + 1 ) { - bi->nr_modules = sizeof(module_map) * 8; - printk("Excessive boot modules - using the first %u only\n", + bi->nr_modules = MAX_NR_BOOTMODS + 1; + printk("Excessive multiboot modules - using the first %u only\n", bi->nr_modules); } - bitmap_fill(module_map, bi->nr_modules); - __clear_bit(0, module_map); /* Dom0 kernel is always first */ + /* Dom0 kernel is always first */ bi->mods[0].type = BOOTMOD_KERNEL; bi->mods[0].flags |= BOOTMOD_FLAG_X86_CONSUMED;