linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] riscv: Do not overwrite initrd_start and initrd_end
@ 2018-08-29  0:33 Guenter Roeck
  2018-08-30  9:00 ` Geert Uytterhoeven
  2018-08-31  6:20 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Guenter Roeck @ 2018-08-29  0:33 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Albert Ou, linux-riscv, linux-kernel, schwab, Guenter Roeck

setup_initrd() overwrites initrd_start and initrd_end if __initramfs_size
is larger than 0, which is always true even if there is no embedded
initramfs. This prevents booting qemu with "-initrd" parameter.
Overwriting initrd_start and initrd_end is not necessary since
__initramfs_start and __initramfs_size are used directly in
populate_rootfs() to load the built-in initramfs, so just drop
that code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Instead of dropping setup_initrd() entirely, only stop
    overwriting initrd_start and initrd_end. Adjust explanation
    accordingly.

 arch/riscv/kernel/setup.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index db20dc630e7e..aee603123030 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -85,15 +85,8 @@ atomic_t hart_lottery;
 #ifdef CONFIG_BLK_DEV_INITRD
 static void __init setup_initrd(void)
 {
-	extern char __initramfs_start[];
-	extern unsigned long __initramfs_size;
 	unsigned long size;
 
-	if (__initramfs_size > 0) {
-		initrd_start = (unsigned long)(&__initramfs_start);
-		initrd_end = initrd_start + __initramfs_size;
-	}
-
 	if (initrd_start >= initrd_end) {
 		printk(KERN_INFO "initrd not found or empty");
 		goto disable;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] riscv: Do not overwrite initrd_start and initrd_end
  2018-08-29  0:33 [PATCH v2] riscv: Do not overwrite initrd_start and initrd_end Guenter Roeck
@ 2018-08-30  9:00 ` Geert Uytterhoeven
  2018-08-31  6:20 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2018-08-30  9:00 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Palmer Dabbelt, aou, linux-riscv, Linux Kernel Mailing List,
	Andreas Schwab

Hi Guenter,

On Wed, Aug 29, 2018 at 2:34 AM Guenter Roeck <linux@roeck-us.net> wrote:
> setup_initrd() overwrites initrd_start and initrd_end if __initramfs_size
> is larger than 0, which is always true even if there is no embedded
> initramfs. This prevents booting qemu with "-initrd" parameter.
> Overwriting initrd_start and initrd_end is not necessary since
> __initramfs_start and __initramfs_size are used directly in

... since commit df52092f3c977885 ("fastboot: remove duplicate
unpack_to_rootfs()")...

To avoid -stable backporting this beyond v2.6.30 ;-)

> populate_rootfs() to load the built-in initramfs, so just drop
> that code.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] riscv: Do not overwrite initrd_start and initrd_end
  2018-08-29  0:33 [PATCH v2] riscv: Do not overwrite initrd_start and initrd_end Guenter Roeck
  2018-08-30  9:00 ` Geert Uytterhoeven
@ 2018-08-31  6:20 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2018-08-31  6:20 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Palmer Dabbelt, linux-riscv, Albert Ou, schwab, linux-kernel

On Tue, Aug 28, 2018 at 05:33:46PM -0700, Guenter Roeck wrote:
> setup_initrd() overwrites initrd_start and initrd_end if __initramfs_size
> is larger than 0, which is always true even if there is no embedded
> initramfs. This prevents booting qemu with "-initrd" parameter.
> Overwriting initrd_start and initrd_end is not necessary since
> __initramfs_start and __initramfs_size are used directly in
> populate_rootfs() to load the built-in initramfs, so just drop
> that code.
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-31  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-29  0:33 [PATCH v2] riscv: Do not overwrite initrd_start and initrd_end Guenter Roeck
2018-08-30  9:00 ` Geert Uytterhoeven
2018-08-31  6:20 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).