Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp213553pxb; Wed, 11 Nov 2020 01:33:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXBa/YW1hqzHs3RQvJL15gp4qmyuhRS8htYKV9V0C73ZdlsTwoEm5VZ8HyxjPwTxEWJ7v3 X-Received: by 2002:a17:906:1f85:: with SMTP id t5mr23958812ejr.352.1605087197366; Wed, 11 Nov 2020 01:33:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605087197; cv=none; d=google.com; s=arc-20160816; b=YoHy3q3dXC19W0EAN+t9RNGas3S7vwS3AClD4clOFtCWKjjhjRo31XFxXkbuFXOHvp oGAXzI3oFQ48AsfExnJ46LuxDMicEuXyGqepwIACnex9Z+CD/Ai0X5S1vWz5zzux0u33 rakFTzWfeHWNqeN88SMemMR2LwNgtd1Erp6P++Co8g2T0BHgF4vqQDYtH2YwfBlqsFxc nSe/51Tza3FePkfKPuPMGG9yxYnHwq9XRpwe2ARL/sMOBwXHjn2Xi+D0d0GgERAO8NOy cK+b0O39SEoMRWMx3T7ZJ2xt+Dw2yyshIPVxAjvTUMOFx5ZpCoiAXeZYZt7LfCW2/6/Q 0JxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lbtdx1kurUsYGnG/x9Uam9zpAQgx8iNhPM2u5OetJYA=; b=reTUZdL9CYCdBW5eRbvyqel4no3BZ6RjcTXuyADX9aJ9BCI51L4Y/cKjGzi3yHb8h0 Wy9TZZEA70UXycu48ZjtxmQJ758jQ1rMV3QuX7VBQg/THVLXqswbEYEOlOzInThYVRIE YjkOgk8FRJ2HhPLRnngaUV29SqQRMY1z/KuDlPfkjZMELgvMA4UVT7Quc2TryWoT3mjo 4ydmPe4E1G79qgArWDTUI3HZOkBci4Nm9IORzDcGw+RvUd6/+p54Ip3/UvY3gbVaJpz/ 0TfnxKySVrVK8VDlJegAZfJmigL1EY7GRZ2KzJrQZ9eGQztwKFsSrSjlvd44ca40RlvH GRGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JmQ2zAh4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si925866ejz.656.2020.11.11.01.32.53; Wed, 11 Nov 2020 01:33:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JmQ2zAh4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727083AbgKKJba (ORCPT + 99 others); Wed, 11 Nov 2020 04:31:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:59482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725986AbgKKJb1 (ORCPT ); Wed, 11 Nov 2020 04:31:27 -0500 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B4C92067D; Wed, 11 Nov 2020 09:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605087085; bh=TaAgY+lXg95mPvCVhrS0CpZt2rhWBIm0s618ow6cMt8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JmQ2zAh4OMqK960v3coR9S3dRP14lKOZhwrdHkMHUT6Da8fZ+Fqe/YEDCeys2Y/p+ uBgw+FZsp4hrBpEYDIhT64E3puB3p+Ag3uZJbeXeZzqP17N6IYHb3DJTxaCLGJ4gmY m7zpeET+8tJSmqw3CPfYmvhcl8ILzjtsKTMAEIvE= Received: by mail-ot1-f45.google.com with SMTP id n11so1559970ota.2; Wed, 11 Nov 2020 01:31:25 -0800 (PST) X-Gm-Message-State: AOAM533RRMdIxQKrlkb5/FHqfQNX/+zmtkU9zZfGexCyP+CgKYQfWeUu fhUh9HHox7Kcgf9muSAH2+t5GxBYetjAGa9U5Qc= X-Received: by 2002:a9d:65d5:: with SMTP id z21mr15863879oth.251.1605087084745; Wed, 11 Nov 2020 01:31:24 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Arnd Bergmann Date: Wed, 11 Nov 2020 10:31:08 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: arm: kasan: WARNING: CPU: 0 PID: 0 at arch/arm/kernel/insn.c:47 __arm_gen_branch To: Ard Biesheuvel Cc: Naresh Kamboju , Linux ARM , Linux-Next Mailing List , open list , linux-mm , lkft-triage@lists.linaro.org, Linus Walleij , Arnd Bergmann , Andrew Morton , Masami Hiramatsu , Stephen Rothwell , Steven Rostedt Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 11, 2020 at 9:15 AM Ard Biesheuvel wrote: > > On Wed, 11 Nov 2020 at 07:13, Naresh Kamboju wrote: > > > > The following kernel warning noticed on arm KASAN enabled config while booting. > > > > [ 0.000000] Linux version 5.10.0-rc3-next-20201110 > > (tuxmake@e15fe3b4fdc6) (arm-linux-gnueabihf-gcc (Debian 9.3.0-13) > > 9.3.0, GNU ld (GNU Binutils for Debian) 2.35.1) #2 SMP Tue Nov 10 > > 07:49:47 UTC 2020 > > [ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d > > > > [ 0.000000] kasan: Truncating shadow for memory block at > > 0x40000000-0xffffffff to lowmem region at 0x70000000 > > [ 0.000000] kasan: Mapping kernel virtual memory block: > > c0000000-f0000000 at shadow: b7000000-bd000000 > > [ 0.000000] kasan: Mapping kernel virtual memory block: > > bf000000-c0000000 at shadow: b6e00000-b7000000 > > [ 0.000000] kasan: Kernel address sanitizer initialized > > > > [ 0.000000] ftrace: allocating 57178 entries in 112 pages > > [ 0.000000] ------------[ cut here ]------------ > > [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm/kernel/insn.c:47 > > __arm_gen_branch+0x78/0x80 > > [ 0.000000] Modules linked in: > > [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted > > 5.10.0-rc3-next-20201110 #2 > > [ 0.000000] Hardware name: Generic DT based system > > [ 0.000000] Backtrace: > > [ 0.000000] [] (dump_backtrace) from [] > > (show_stack+0x20/0x24) > > [ 0.000000] r9:00000080 r8:c2e00000 r7:c3023060 r6:600000d3 > > r5:00000000 r4:c3023060 > > [ 0.000000] [] (show_stack) from [] > > (dump_stack+0xe8/0x10c) > > [ 0.000000] [] (dump_stack) from [] (__warn+0x140/0x164) > > [ 0.000000] r10:00000009 r9:00000000 r8:c2e0e000 r7:00000009 > > r6:c031986c r5:0000002f > > [ 0.000000] r4:c1a0bbe0 r3:c2e06f50 > > [ 0.000000] [] (__warn) from [] > > (warn_slowpath_fmt+0xc0/0x128) > > [ 0.000000] r9:c031986c r8:0000002f r7:c1a0bbe0 r6:00000000 > > r5:c2e03ec0 r4:b75c07cc > > [ 0.000000] [] (warn_slowpath_fmt) from [] > > (__arm_gen_branch+0x78/0x80) > > [ 0.000000] r10:0000d247 r9:c4019238 r8:c400c104 r7:c2e070a0 > > r6:c400c108 r5:c0319250 > > [ 0.000000] r4:00000000 > > [ 0.000000] [] (__arm_gen_branch) from [] > > (ftrace_make_nop+0x30/0x48) > > [ 0.000000] r5:c0319250 r4:c2b00354 > > [ 0.000000] [] (ftrace_make_nop) from [] > > (ftrace_process_locs+0x470/0x5f0) > > [ 0.000000] r5:00001248 r4:c400c100 > > [ 0.000000] [] (ftrace_process_locs) from [] > > (ftrace_init+0xa8/0x158) > > [ 0.000000] r10:10c5387d r9:c1a87768 r8:c2cb9f98 r7:c2c82230 > > r6:00000001 r5:c2e070a0 > > [ 0.000000] r4:c37f5c40 > > [ 0.000000] [] (ftrace_init) from [] > > (start_kernel+0x174/0x3f8) > > [ 0.000000] r9:00000001 r8:c2e06f00 r7:00000000 r6:c2e06f00 > > r5:c37c0000 r4:ffffffff > > [ 0.000000] [] (start_kernel) from [<00000000>] (0x0) > > [ 0.000000] r9:410fd034 r8:48000000 r7:ffffffff r6:10c0387d > > r5:00000051 r4:c2b00334 > > [ 0.000000] random: get_random_bytes called from > > print_oops_end_marker+0x30/0xa0 with crng_init=0 > > [ 0.000000] ---[ end trace 0000000000000000 ]--- > > [ # > > 0.000000] ------------[ ftrace bug ]------------ > > [ 0.000000] ftrace failed to modify > > [ 0.000000] [] set_reset_devices+0x10/0x28 > > [ 0.000000] actual: 0a:3d:04:eb > > [ 0.000000] Initializing ftrace call sites > > [ 0.000000] ftrace record flags: 0 > > [ 0.000000] (0) > > [ 0.000000] expected tramp: c031925c > > [ 0.000000] ------------[ cut here ]------------ > > [ 0.000000] WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:2065 > > ftrace_bug+0x218/0x280 > > [ 0.000000] Modules linked in: > > [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W > > 5.10.0-rc3-next-20201110 #2 > > [ 0.000000] Hardware name: Generic DT based system > > [ 0.000000] Backtrace: > > [ 0.000000] [] (dump_backtrace) from [] > > (show_stack+0x20/0x24) > > [ 0.000000] r9:00000080 r8:c2e00000 r7:c3023060 r6:600000d3 > > r5:00000000 r4:c3023060 > > [ 0.000000] [] (show_stack) from [] > > (dump_stack+0xe8/0x10c) > > [ 0.000000] [] (dump_stack) from [] (__warn+0x140/0x164) > > [ 0.000000] r10:00000009 r9:00000000 r8:c2e0e000 r7:00000009 > > r6:c19a3790 r5:00000811 > > [ 0.000000] r4:c1a863c0 r3:c2e06f50 > > [ 0.000000] [] (__warn) from [] > > (warn_slowpath_fmt+0xc0/0x128) > > [ 0.000000] r9:c19a3790 r8:00000811 r7:c1a863c0 r6:00000000 > > r5:c2e03ee0 r4:b75c07d0 > > [ 0.000000] [] (warn_slowpath_fmt) from [] > > (ftrace_bug+0x218/0x280) > > [ 0.000000] r10:0000d247 r9:c4019238 r8:c400c104 r7:c37f5c40 > > r6:c1a86960 r5:c401923c > > [ 0.000000] r4:c4019238 > > [ 0.000000] [] (ftrace_bug) from [] > > (ftrace_process_locs+0x32c/0x5f0) > > [ 0.000000] r7:c2e070a0 r6:c400c108 r5:00001248 r4:c400c100 > > [ 0.000000] [] (ftrace_process_locs) from [] > > (ftrace_init+0xa8/0x158) > > [ 0.000000] r10:10c5387d r9:c1a87768 r8:c2cb9f98 r7:c2c82230 > > r6:00000001 r5:c2e070a0 > > [ 0.000000] r4:c37f5c40 > > [ 0.000000] [] (ftrace_init) from [] > > (start_kernel+0x174/0x3f8) > > [ 0.000000] r9:00000001 r8:c2e06f00 r7:00000000 r6:c2e06f00 > > r5:c37c0000 r4:ffffffff > > [ 0.000000] [] (start_kernel) from [<00000000>] (0x0) > > [ 0.000000] r9:410fd034 r8:48000000 r7:ffffffff r6:10c0387d > > r5:00000051 r4:c2b00334 > > [ 0.000000] ---[ end trace f68728a0d3053b52 ]--- > > [ 0.000000] ftrace: allocated 112 pages with 3 groups > > > > metadata: > > git branch: master > > git repo: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next > > git describe: next-20201110 > > make_kernelversion: 5.10.0-rc3 > > build : https://builds.tuxbuild.com/1k5bYasxkHF7omMh7mjtxjRtkMe/ > > > > The qemu boot command, > > ----------------------------------- > > /usr/bin/qemu-system-aarch64 -cpu host,aarch64=off -machine > > virt-2.10,accel=kvm -nographic -net > > nic,model=virtio,macaddr=BA:DD:AD:CC:09:03 -net tap -m 2048 -monitor > > none -kernel kernel/zImage --append "console=ttyAMA0 root=/dev/vda rw" > > -hda rpb-console-image-lkft-am57xx-evm-20201022181203-3085.rootfs.ext4 > > -m 4096 -smp 2 -nographic > > > > Full log: > > https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20201110/testrun/3420437/suite/linux-log-parser/test/check-kernel-warning-1927841/log > > > > The kernel you are building is too big. > > An ordinary multi_v7_defconfig+thumb2 has > > (10240K kernel code, 2232K rwdata, 5344K rodata, 2048K init, 441K bss, > 144040K reserved, 65536K cma-reserved, 3340512K highmem) > > whereas your kernel has > > (23552K kernel code, 9970K rwdata, 16736K rodata, 3072K init, 4849K > bss, 189072K reserved, 65536K cma-reserved, 2293756K highmem) > > and so the kernel text section is too large to resolve relative branches. > > Which config are you building? The config available from the 'build' link above: https://builds.tuxbuild.com/1k5bYasxkHF7omMh7mjtxjRtkMe/config This is a diff of that against multi_v7_defconfig: https://pastebin.com/v2uxkrCe I ran that on v5.10-rc1, so it's missing KASAN. I don't think any of the individual drivers is going to be a huge difference, but these are the ones that might add a percentage to the overall build: CONFIG_NAMESPACES CONFIG_KALLSYMS_ALL CONFIG_KPROBES CONFIG_KSM CONFIG_VIDEO_V4L2 CONFIG_FUNCTION_TRACER CONFIG_DYNAMIC_FTRACE CONFIG_IRQSOFF_TRACER CONFIG_KPROBE_EVENTS CONFIG_FTRACE_MCOUNT_RECORD CONFIG_UNWINDER_FRAME_POINTER CONFIG_KASAN My guess is that the combination of a few of the above doubles the size. Arnd