From mboxrd@z Thu Jan 1 00:00:00 1970 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 89C5FC4332F for ; Mon, 13 Nov 2023 05:01:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229844AbjKMFBj (ORCPT ); Mon, 13 Nov 2023 00:01:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjKMFBe (ORCPT ); Mon, 13 Nov 2023 00:01:34 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF4DF107 for ; Sun, 12 Nov 2023 21:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699851645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0H6pBIlKItgej+nMcwGiXmrehlEQnc5Kln2hfEgiJXg=; b=IBJXk8IWUX5fDEu98bJ4b7sTemAj81Y0p3cJXDnekkUxTOuyM+Za1pdRDEzwAIIknz2H9V JmXWbKzq3x355ZrYbRCeMMYHZxiVqYTU3L7HA68wEqXKUab/QjlRYY8YKcelJ0PA9CkK+y ViXEvruFt5ib4LHLLczLslv5gWufJSU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-xhPcS1UqMAS1YtMMFYkbtQ-1; Mon, 13 Nov 2023 00:00:40 -0500 X-MC-Unique: xhPcS1UqMAS1YtMMFYkbtQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B0C0828CE8; Mon, 13 Nov 2023 05:00:39 +0000 (UTC) Received: from localhost (unknown [10.72.112.169]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66658502C; Mon, 13 Nov 2023 05:00:37 +0000 (UTC) Date: Mon, 13 Nov 2023 13:00:34 +0800 From: Baoquan He To: Yuntao Wang Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "Peter Zijlstra (Intel)" , Josh Poimboeuf , Juergen Gross , Alexander Shishkin , Saurabh Sengar Subject: Re: [PATCH] x86/setup: Make relocated_ramdisk a local variable of relocate_initrd() Message-ID: References: <20231113034026.130679-1-ytcoode@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231113034026.130679-1-ytcoode@gmail.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/13/23 at 11:40am, Yuntao Wang wrote: > 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. It's true. 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 > > -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 = 0; > } > > -u64 relocated_ramdisk; > - > #ifdef CONFIG_BLK_DEV_INITRD > > static u64 __init get_ramdisk_image(void) > @@ -261,7 +259,7 @@ static void __init relocate_initrd(void) > u64 area_size = PAGE_ALIGN(ramdisk_size); > > /* We need to move the initrd down into directly mapped mem */ > - relocated_ramdisk = memblock_phys_alloc_range(area_size, PAGE_SIZE, 0, > + u64 relocated_ramdisk = 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", > -- > 2.42.1 >