From nobody Wed Dec 31 00:36:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4D10C4332F for ; Mon, 13 Nov 2023 03:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233025AbjKMDo2 (ORCPT ); Sun, 12 Nov 2023 22:44:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230457AbjKMDo0 (ORCPT ); Sun, 12 Nov 2023 22:44:26 -0500 Received: from mail-vk1-xa2f.google.com (mail-vk1-xa2f.google.com [IPv6:2607:f8b0:4864:20::a2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88E82D1 for ; Sun, 12 Nov 2023 19:44:23 -0800 (PST) Received: by mail-vk1-xa2f.google.com with SMTP id 71dfb90a1353d-4ac4cd60370so1848288e0c.3 for ; Sun, 12 Nov 2023 19:44:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699847062; x=1700451862; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=48Iu1w7OYQwIayu8Jx3+JPx7265SInmYaxh77kvRm6I=; b=ij6+Rm1QPLif1BIMiuQGGjCUc9AtqZEHcxhBIhID6GT4nd0JpJCkQQhLyMqjD+BLFN 6XyhjdMpYgsHriRoGI+GDhd8bcqlRCKfCBNELefAUl6lfmpKpl2jahXaNH43Epbm6Bnq GdbdjtBvhjgkxBXs6gFk/0b5TgQWcnJpoKbdGUlkwkVlwbpdE7dMZCc10Ol+VwIHzzF3 g4NW0ik2URodVQWlBFBlUxlGijBeluUCKRIgACY1ba6ryJtQ0+vwq1TPbOOrm8KRzZu3 mxRLzmfGLjhcN8adqHSp2a2XsItYosUsh5IdW53XHBCSvbf33qBx4tNW4IxV0CPRT8Tg T3MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699847062; x=1700451862; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=48Iu1w7OYQwIayu8Jx3+JPx7265SInmYaxh77kvRm6I=; b=r/WqUYfIKNhel0Wi18tcZIinVWqKn5ZY9CK4SSmm8c26wFgdNVcF8tsTL8TTDbe7xR 3uW34tdIJVd9DoeYbh+5VeY1xZKVtR7Irxsl0wJ5mMoo/dvmXNc57GNw9+miWEqeYIH0 9XFXwbp6kY+KCKcqmdatW53ROJC+47rXUi4EqO3T4NqxnJlqydLNppkEbMC5tFTIruWG 6qoeb7zFs40ERNlTZkuQ5K44MQln9AKN8k/OmDHjnWA1+ByXeAqAxytR22uz09F9OUWI d1S1X5nv6GybjlPnikhza4ccUS+T2GCbPajwTFjnfCD9D+H/c4OUhEn4J2jdc8mGRxjq b/Qg== X-Gm-Message-State: AOJu0YwYjquntp6SBtbb7qR7VkvieB4DsT7Yc/CMRg88CVX38TK6YQCj u36xOGff/HntcFdgNTEB/VE= X-Google-Smtp-Source: AGHT+IHq1n8X8+IEnFifaPzZWCJXiigLf0tO99hZvXxJjKCPB7z4aJwQNS190yJF6dTuK70BEhAfWg== X-Received: by 2002:a05:6122:1055:b0:495:c10c:ec39 with SMTP id z21-20020a056122105500b00495c10cec39mr4911611vkn.2.1699847062482; Sun, 12 Nov 2023 19:44:22 -0800 (PST) Received: from code.. ([144.202.108.46]) by smtp.gmail.com with ESMTPSA id bu19-20020a056122239300b0049a9ad3336dsm823729vkb.25.2023.11.12.19.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Nov 2023 19:44:22 -0800 (PST) From: Yuntao Wang To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "Peter Zijlstra (Intel)" , Josh Poimboeuf , Juergen Gross , Baoquan He , Alexander Shishkin , Saurabh Sengar , Yuntao Wang Subject: [PATCH] x86/setup: Make relocated_ramdisk a local variable of relocate_initrd() Date: Mon, 13 Nov 2023 11:40:26 +0800 Message-ID: <20231113034026.130679-1-ytcoode@gmail.com> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" After commit 0b62f6cb0773 ("x86/microcode/32: Move early loading after paging enable"), the global variable relocated_ramdisk is no longer used anywhere except for the relocate_initrd() function. Make it a local variable of that function. Signed-off-by: Yuntao Wang Reviewed-by: Baoquan He --- arch/x86/include/asm/setup.h | 2 -- arch/x86/kernel/setup.c | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index bf483fcb4e57..5c83729c8e71 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h @@ -31,8 +31,6 @@ #include #include =20 -extern u64 relocated_ramdisk; - /* Interrupt control for vSMPowered x86_64 systems */ #ifdef CONFIG_X86_64 void vsmp_init(void); diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 1526747bedf2..ec2c21a1844e 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -226,8 +226,6 @@ static void __init reserve_brk(void) _brk_start =3D 0; } =20 -u64 relocated_ramdisk; - #ifdef CONFIG_BLK_DEV_INITRD =20 static u64 __init get_ramdisk_image(void) @@ -261,7 +259,7 @@ static void __init relocate_initrd(void) u64 area_size =3D PAGE_ALIGN(ramdisk_size); =20 /* We need to move the initrd down into directly mapped mem */ - relocated_ramdisk =3D memblock_phys_alloc_range(area_size, PAGE_SIZE, 0, + u64 relocated_ramdisk =3D memblock_phys_alloc_range(area_size, PAGE_SIZE,= 0, PFN_PHYS(max_pfn_mapped)); if (!relocated_ramdisk) panic("Cannot find place for new RAMDISK of size %lld\n", --=20 2.42.1