Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp14564imm; Tue, 28 Aug 2018 15:01:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY8nrHvHKDgGarQNJWHZAjttUXJRdoJBgQwSdBMSdt6OrlfjjPWqluLCkjjKJXoFsujjgny X-Received: by 2002:a63:3105:: with SMTP id x5-v6mr3233014pgx.323.1535493692332; Tue, 28 Aug 2018 15:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535493692; cv=none; d=google.com; s=arc-20160816; b=bnb77jGi/PYW5REDX5Twa3MfME5NvMUmK2kGuQjKtPVNoaqEZD9Vs7HL1eVvW2G9Lv KevLS4Hw6BkSiq57WUqqowWlkMAOvweYIuzM5Fwcg1kinPUiN28m6FrR2a7A1C0nyjGZ EtlvdxRc5n4oMcA3vKI4pIxPq6AvaWFqdmRtfpLHDWrrqvG2WyLTYY5JR48X/wu5ramQ 4R/b7h5cVZ7aBrQB89uXYV+6lKHzEcDTz+w1GkRg+TjkJWAC5DXRkarnDGWcNDTdFLPd LVj6U8VOC1hvYMAT1Thtc4+oNWbM7FGqyPBwi4ouK3bpwPh6QaBuKl2i7tRqJgkYwGmz jCkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=9XrLbb6tmalPVT45yux6sPLcBQjpkAuvKpcSsE2gIo8=; b=jt9aRpeKkGVaqWbdubOIDCeORQ3w44zcpxmCkkoCqgTcZ/eQ1vZUgWxN8wn0bbGP6H UYNDJdzdXdS4Uy9kSArC7Rr3O3se67Sg2lbXMn1ABikeVm7EsB4E2gnaRqYKobO1Oy9b dCfX1/E3ezOPx9gWS3uQxUFTdwmhA2uobJxpES/rtaPS5XzAK+xedotFYnHiWG/KN6Bu qw+8CahvtEDLfEScdLLec7ZicM4UgvVOrI54znq+hlNMOcsLLz+wQTywLQwCKvqOTiiZ d/QcZRnUPVmpGm57ysQvmZ/PS3DILW410381jOcYbuchfDmqs03ZoaSYMx8gqc0yNhgN Ty8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=O6a1lshE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12-v6si1843947plt.440.2018.08.28.15.01.16; Tue, 28 Aug 2018 15:01:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=O6a1lshE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727258AbeH2Bxl (ORCPT + 99 others); Tue, 28 Aug 2018 21:53:41 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43905 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbeH2Bxl (ORCPT ); Tue, 28 Aug 2018 21:53:41 -0400 Received: by mail-pg1-f196.google.com with SMTP id v66-v6so1348429pgb.10 for ; Tue, 28 Aug 2018 15:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9XrLbb6tmalPVT45yux6sPLcBQjpkAuvKpcSsE2gIo8=; b=O6a1lshEB6SbQBIqx8krXBSEDfsDHysVJcp5HLzhs7KL3s/YOOdh8ZENsOEcg7hR9I WilEF7ySpLkjz3l7ZPFsTtNtN1artDX6NzQqKZdF+Ag+YoHIonzKK1a2yFdk9kRATpuH tNQoQLmmo5rDN31nhA5mjbu1EzGbKrVR9Yb91qcCswzE8FLklffn2frInBRbsmfUNDdI IfqLx+T8T88nf4XdElqv8CvEWqfD6J1e4oVQPze8+Th+BF7zaHxcqlpnUGY+9/w+BIV7 QRDntu9kDZ3+6YqMMQ70Xi1r3zoUf9zI57w9t1LoOCXlY6FT48HStI6IPKCD4i+OpEiU J0lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=9XrLbb6tmalPVT45yux6sPLcBQjpkAuvKpcSsE2gIo8=; b=aGH3kIjhCRRfF/NKSM2Na/bIERc1V+JlN5iBkFETvXCqlQ3U1qGYkqFc1paXMk6cEc qsbhQ9oyYZ0wT9GlQkUPscCRQoIPRgT2psqS5cYw9wSrukpKVzpW+nOB7ugvrRUUSvtc rjY/dgazZnqlxui923wOH9rPEoW/eo18JjfBzN+hM4xdA8y/Bbk+qjHhAnOW7yCb+DFm cYGmsOAS5QnRICNJgHamW5aH2tejdtNLggssDAnXHHv6VWbc1M/nZorCgFjiv0LjP/Fn TShJDvkMa8AcGRXISi0kGLuurwVojRaXWk6qqsw2bcKNgOL1CH8G/yZK70o3WbLP4uLt dMnA== X-Gm-Message-State: APzg51AekQP7hs5nycqTMndpFVXTbbXrJSr1zv+DEK6cLYDjpsCe13G4 3D6agxjgBeWCTvISDY4VmsY= X-Received: by 2002:a63:d002:: with SMTP id z2-v6mr3252351pgf.262.1535493602149; Tue, 28 Aug 2018 15:00:02 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id h190-v6sm8582183pge.18.2018.08.28.15.00.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Aug 2018 15:00:01 -0700 (PDT) Date: Tue, 28 Aug 2018 14:59:59 -0700 From: Guenter Roeck To: Andreas Schwab Cc: Palmer Dabbelt , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: Drop setup_initrd Message-ID: <20180828215959.GA6279@roeck-us.net> References: <1533874300-17656-1-git-send-email-linux@roeck-us.net> <20180828212505.GA24238@roeck-us.net> <87mut6b1we.fsf@igel.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mut6b1we.fsf@igel.home> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 28, 2018 at 11:46:09PM +0200, Andreas Schwab wrote: > On Aug 28 2018, Guenter Roeck wrote: > > > On Tue, Aug 28, 2018 at 01:10:20PM -0700, Palmer Dabbelt wrote: > >> On Thu, 09 Aug 2018 21:11:40 PDT (-0700), linux@roeck-us.net wrote: > >> >setup_initrd() does not appear to serve a practical purpose other than > >> >preventing qemu boots with "-initrd" parameter, so let's drop it. > >> > > >> >Signed-off-by: Guenter Roeck > >> >--- > >> > arch/riscv/kernel/setup.c | 39 --------------------------------------- > >> > 1 file changed, 39 deletions(-) > >> > > >> >diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c > >> >index 2e56af3281f8..579f58a42974 100644 > >> >--- a/arch/riscv/kernel/setup.c > >> >+++ b/arch/riscv/kernel/setup.c > >> >@@ -82,41 +82,6 @@ EXPORT_SYMBOL(empty_zero_page); > >> > /* The lucky hart to first increment this variable will boot the other cores */ > >> > 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; > >> >- } > > > > The underlying problem is probably that __initramfs_size == 512 even > > if there is no embedded initrd. Result is that initrd_start and initrd_end > > are always overwritten, even if provided and even if there is no embedded > > initrd. Result is that initrd_start and initrd_end are always overwritten, > > and -initrd from the qemu command line is always ignored. > > > > A less invasive fix than mine would be > > > > - if (__initramfs_size > 0) { > > + if (__initramfs_size > 0 && !initrd_start) { > > > > Any chance you can test that with your setup ? > > You should just delete the last four lines above. They serve no purpose. > You mean the entire if() statement plus the variable declarations ? That works for me, for both embedded initrd and initrd specified with -initrd option, but we still need someone to test if it works for Palmer's use case, ie with vmlinux (and possibly initrd) embedded in bbl. Thanks, Guenter > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 > "And now for something completely different."