Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4327856ybb; Tue, 7 Apr 2020 05:26:32 -0700 (PDT) X-Google-Smtp-Source: APiQypLVL0XRA78qzYhK2ToPt1rnUzPJ0miU2WkbpDmyUYw4CEmOn0Fr1bmbaIddpSGyLVNYlc86 X-Received: by 2002:aca:df06:: with SMTP id w6mr1485239oig.2.1586262392866; Tue, 07 Apr 2020 05:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586262392; cv=none; d=google.com; s=arc-20160816; b=IBdHjfV1SflHN+M6It6zd+ZmSJSkPbI5Je0JtL39LyScvZklRNivr4k3bXObE3m+ss pWjWpBkE7qd/S6awndUsaeld482O8z/tn86UTSdzgENfWD/ozsiD9ZCiIxVJyT4u5KwZ vbyZa1wrYJmHGbBQSLkMO70fCAmq2vsHkCDyL5L/dWbagvwn4liMrm+WUjuZVgEVL71g wfiL/ROolpJLG+4jSE4fyhqwfcNA6+aP3GxL9dbxhUdX2JrW5wxUPuvkC/5DDGsIa/G/ EDsKlUeivb0wppNTgNHDbuku+3tfpgsbsqS3AssU7xRSsA0I9c6SCM8jOHzaMR5RF7ZO MBPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Qcosx3zOods1ZrT/9F495oLQo2i1f+60srMg2RUuf7A=; b=FsnMToTM9T2AUEwUmokbR/rjq404PtZHkIwhw0q41v8OsgTe9wrYtXi3d5ksxdXqKz fUb01AoRAkV9kSDyr5FZJsOfo2K7t3wfn+gLZMD4Pwnm0AljK+pz/B5UoXaC/lZhpBbc YEhOrbiFUU6lpX7HXcP5/GXfRaqUH0Eu++035cTZXoPLWO3soon1vS1r6eOdJLAsxXGm k0b1rrxMNFnWOa1H763Zw8y3WErUrRyx/svRGIrEPTSmj4N6MxOdK5YcbRghkrYFJbmy nOCXVWsfHiVZh6ZmwPLSUJldY2FthQvmoSODTvLmzm+Kp5S5BRLXtzlg7vuz6TSgIDCM 4G/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b="ags5tFZ/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x64si1023037oig.34.2020.04.07.05.26.20; Tue, 07 Apr 2020 05:26: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=pass header.i=@flygoat.com header.s=mail header.b="ags5tFZ/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728555AbgDGMZp (ORCPT + 99 others); Tue, 7 Apr 2020 08:25:45 -0400 Received: from sender2-op-o12.zoho.com.cn ([163.53.93.243]:17543 "EHLO sender2-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728146AbgDGMZp (ORCPT ); Tue, 7 Apr 2020 08:25:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1586262323; s=mail; d=flygoat.com; i=jiaxun.yang@flygoat.com; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=Qcosx3zOods1ZrT/9F495oLQo2i1f+60srMg2RUuf7A=; b=ags5tFZ/0zZxTM73JceTG1Mmm3zVwPq29RPqq/7RBJz9wypY+9hjo1RIF1lnKAqZ coO3/cN3zC0K/wsMDwcKtP103XkOoTY9eAst8VpFAA7EG2Tx493vbYrS5SboxAECf2Z gVKizgoJxE7jo4OTgUFxct5tZP1yTpg30KRsA8K0= Received: from flygoat-x1e (60.177.191.213 [60.177.191.213]) by mx.zoho.com.cn with SMTPS id 15862623217966.568477178934359; Tue, 7 Apr 2020 20:25:21 +0800 (CST) Date: Tue, 7 Apr 2020 20:25:19 +0800 From: Jiaxun Yang To: "Xu, Yanfei" Cc: Thomas Bogendoerfer , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: BUG: mips: errors when compiling kernel with a large initramfs Message-ID: <20200407202519.4d384f3b@flygoat-x1e> In-Reply-To: <0c1e4eda-53c6-ea8b-c27b-eabc8569cc74@windriver.com> References: <0c1e4eda-53c6-ea8b-c27b-eabc8569cc74@windriver.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 Apr 2020 17:58:23 +0800 "Xu, Yanfei" wrote: > Hi, >=20 >=20 > It fails to compile mips kernel with large initramfs (at link time). >=20 > kernel version: 5.6.0 >=20 >=20 > Steps to reproduce: >=20 > 1. git clone mainline kernel >=20 > 2. set ARCH=3Dmips and CROSS_COMPILE=3Dmips-linux-gnu- >=20 > 3. make defconfig >=20 > 4.enable initramfs support and set the path about initramfs source > file >=20 > 5.make -j24 >=20 > [KEY] when your initramfs files is too large, and cause=20 > usr/initramfs_data.cpio.gz >=20 > compiled is larger than 225M, you will get the following error. BTW, > x86 doesn't >=20 > have this issue that I have tested. >=20 > ------------------------------error=20 > messages----------------------------------------- >=20 > =C2=A0 CHK=C2=A0=C2=A0=C2=A0=C2=A0 include/generated/compile.h > =C2=A0 LD=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 vmlinux.o > =C2=A0 MODPOST vmlinux.o > =C2=A0 MODINFO modules.builtin.modinfo > =C2=A0 GEN=C2=A0=C2=A0=C2=A0=C2=A0 modules.builtin > =C2=A0 LD=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .tmp_vmlinux.kallsyms1 > kernel/configs.o: In function `ikconfig_cleanup': > /home/wrsadmin/work/linux/kernel/linux-master/kernel/configs.c:72:(.exit.= text+0x8):=20 > relocation truncated to fit: R_MIPS_26 against `remove_proc_entry' > fs/binfmt_script.o: In function `exit_script_binfmt': > /home/wrsadmin/work/linux/kernel/linux-master/fs/binfmt_script.c:165:(.ex= it.text+0x4):=20 > relocation truncated to fit: R_MIPS_26 against `unregister_binfmt' > fs/binfmt_elf.o: In function `exit_elf_binfmt': > /home/wrsadmin/work/linux/kernel/linux-master/fs/binfmt_elf.c:2393:(.exit= .text+0x4):=20 > relocation truncated to fit: R_MIPS_26 against `unregister_binfmt' > fs/mbcache.o: In function `mbcache_exit': > /home/wrsadmin/work/linux/kernel/linux-master/fs/mbcache.c:429:(.exit.tex= t+0x4):=20 > relocation truncated to fit: R_MIPS_26 against `kmem_cache_destroy' > fs/nfs_common/grace.o: In function `exit_grace': > /home/wrsadmin/work/linux/kernel/linux-master/fs/nfs_common/grace.c:133:(= .exit.text+0x4):=20 > relocation truncated to fit: R_MIPS_26 against > `unregister_pernet_subsys' fs/ext4/super.o: In function > `ext4_destroy_lazyinit_thread': > /home/wrsadmin/work/linux/kernel/linux-master/fs/ext4/super.c:3456:(.exit= .text+0x24): > relocation truncated to fit: R_MIPS_26 against `kthread_stop' > fs/ext4/super.o: In function `unregister_as_ext2': > /home/wrsadmin/work/linux/kernel/linux-master/fs/ext4/super.c:6126:(.exit= .text+0x30): > relocation truncated to fit: R_MIPS_26 against > `unregister_filesystem' fs/ext4/super.o: In function > `unregister_as_ext3': > /home/wrsadmin/work/linux/kernel/linux-master/fs/ext4/super.c:6155:(.exit= .text+0x3c): > relocation truncated to fit: R_MIPS_26 against > `unregister_filesystem' fs/ext4/super.o: In function `ext4_exit_fs': > /home/wrsadmin/work/linux/kernel/linux-master/fs/ext4/super.c:6261:(.exit= .text+0x48): > relocation truncated to fit: R_MIPS_26 against > `unregister_filesystem' fs/ext4/super.o: In function > `destroy_inodecache': > /home/wrsadmin/work/linux/kernel/linux-master/fs/ext4/super.c:1218:(.exit= .text+0x50): > relocation truncated to fit: R_MIPS_26 against `rcu_barrier' > /home/wrsadmin/work/linux/kernel/linux-master/fs/ext4/super.c:1219:(.exit= .text+0x5c): > additional relocation overflows omitted from the output > Makefile:1086: recipe for target 'vmlinux' failed make[1]: *** > [vmlinux] Error 1 Makefile:1058: recipe for target > 'autoksyms_recursive' failed make: *** [autoksyms_recursive] Error 2 >=20 >=20 > Any comment will be appreciated. Actually I think that won't work even if you managed to workaround reloc issue. MIPS have limited LOW MEM range accessible via KSEG0 (512M, but can be less if your system place some MMIO register in that range). Kernel image will be placed here together with built-in initramfs, and a lot of memory like Page Table can only be allocated from here. Such a huge initrd will occupy the whole LOW MEM range leaving no space for others. It seems like your system is 32bit, we have no solution for that hardware limitaion. For 64bit system you may try to move your kernel into XKPHYS instead of KSEG0. Thanks -- Jiaxun Yang >=20 > Thanks, >=20 > Yanfei >=20