lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZVGtclq4f33e/TWZ@MiWiFi-R3L-srv>
Date:   Mon, 13 Nov 2023 13:00:34 +0800
From:   Baoquan He <bhe@...hat.com>
To:     Yuntao Wang <ytcoode@...il.com>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Josh Poimboeuf <jpoimboe@...nel.org>,
        Juergen Gross <jgross@...e.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Saurabh Sengar <ssengar@...ux.microsoft.com>
Subject: Re: [PATCH] x86/setup: Make relocated_ramdisk a local variable of
 relocate_initrd()

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 <bhe@...hat.com>

> ---
>  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 <asm/bootparam.h>
>  #include <asm/x86_init.h>
>  
> -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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ