Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6047imm; Tue, 28 Aug 2018 14:49:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYc90QT1d+ddnXevJmwTzr0K7k8odLfdkoiK6q00M1lg1XrYyP+J8n0VWVmicjeVBOJ8rRx X-Received: by 2002:a62:ac12:: with SMTP id v18-v6mr3203926pfe.126.1535492961707; Tue, 28 Aug 2018 14:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535492961; cv=none; d=google.com; s=arc-20160816; b=buOFnzmjvCoYMhS708yYSoH4TjHx0GghVj2BsEciXrB2n1b7R2xlz3XMCH9nBOchhL xmiR0JGOaiWO/KpOFj2uo0aD0+qL3VFSVDO8V7zTKay5jBDpP5yWJ9fLBLhBISxetDNK 30+wtnoAspCu4/CaIY3kqdEM82RgYQXUQquu3R5uPOxlT/4aU8ef5n2240GWsjvm2FJe yfBU7W3hO9elyTA3ZYgDXUYvtG7xVA6b+3wZPZD5xps7uKod3JPVdBYKzrR0Puioi2pC bmNZjLBkU/LjDr9nqUrudSNOt5OqcX8tn6PriIek7bDb212IE/fH4hndlvWH2fipKKb4 5Ulg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=Blv8Elejp5HDODlC/qvrYJGDZTSdenq/xVYBSbdb178=; b=hAR35wHQdyqBJkud5kctP7KKqGoGdCMV6IxBvcF0NqkzfJhcU2H1kpBIMkqeZSbbib OMLVLl2jfLaLVvls8ExfHhM7LjOiUgFGigLZL60A55IJ8hqLUbbCXw5JLoruveZD56H4 taVu7+QeFjyXneAH90JC+lHhLo5mqHCS18QbJcSmggjwxJz5o6zB67xaJZL5Ltgj+P5g /+vuisfdR1nNNa0Z/WaGdkJEkd/hyG4XDEwO5lJH1jqZbZfOmetKvvpzScTX5x5LMhVQ gBWLhSPXfMdkzxlEJdotUyOypsRexLRHwMNm+i/clqUn/PabLR+LFDdYENCq4uqEGqOj PcHw== ARC-Authentication-Results: i=1; mx.google.com; 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 h9-v6si2139061plk.461.2018.08.28.14.49.06; Tue, 28 Aug 2018 14:49:21 -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; 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 S1727385AbeH2Bju (ORCPT + 99 others); Tue, 28 Aug 2018 21:39:50 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:55378 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727166AbeH2Bju (ORCPT ); Tue, 28 Aug 2018 21:39:50 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 420Ml73rhdz1qtdm; Tue, 28 Aug 2018 23:46:10 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 420Ml64xLwz1qqlF; Tue, 28 Aug 2018 23:46:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id dRrDImarXeHg; Tue, 28 Aug 2018 23:46:09 +0200 (CEST) X-Auth-Info: vkGdbDEgOqmTzuM+9x8OUeVxIgF27j2cL7FvQ5qzyw3EnqqWaXT1JJXsOC2qtaOd Received: from igel.home (ppp-188-174-153-80.dynamic.mnet-online.de [188.174.153.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 28 Aug 2018 23:46:09 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 3A5602C12DD; Tue, 28 Aug 2018 23:46:09 +0200 (CEST) From: Andreas Schwab To: Guenter Roeck Cc: Palmer Dabbelt , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: Drop setup_initrd References: <1533874300-17656-1-git-send-email-linux@roeck-us.net> <20180828212505.GA24238@roeck-us.net> X-Yow: .. Like I always say -- nothing can beat the BRATWURST here in DUSSELDORF!! Date: Tue, 28 Aug 2018 23:46:09 +0200 In-Reply-To: <20180828212505.GA24238@roeck-us.net> (Guenter Roeck's message of "Tue, 28 Aug 2018 14:25:05 -0700") Message-ID: <87mut6b1we.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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."