From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2055FC433E0 for ; Mon, 22 Mar 2021 15:01:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CADE5619AF for ; Mon, 22 Mar 2021 15:01:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230087AbhCVPA6 (ORCPT ); Mon, 22 Mar 2021 11:00:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:35000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230113AbhCVPA2 (ORCPT ); Mon, 22 Mar 2021 11:00:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3FC4F619AA; Mon, 22 Mar 2021 15:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616425226; bh=Tdl+jH0DCIHhMb38FkH2YhNtJCVJTdPV88LbcXPwM1U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VuDjKR5WvLIrDs4yXI1DXjAtxGW73aRo6U1NreSlOD5tU+Q4+Z7qVKuoBY6gln5VN 4KpYhsfzp70ugauxrjHmRc/oZY2SoVUEC4DOQotflhTPPLS57MRzfyq2ugmp/ZXcjS 3EFa4qkWQH4HD0dfjXxDio6zvI0jRroM97AtKrjs= Date: Mon, 22 Mar 2021 16:00:24 +0100 From: Greg Kroah-Hartman To: Naresh Kamboju Cc: Kamal Dasu , Serge Semin , open list , linux-stable , Mike Rapoport , Florian Fainelli , Thomas Bogendoerfer , Sasha Levin , Serge Semin , lkft-triage@lists.linaro.org, linux-mips@vger.kernel.org Subject: Re: [PATCH 5.10 103/157] MIPS: kernel: Reserve exception base early to prevent corruption Message-ID: References: <20210322121933.746237845@linuxfoundation.org> <20210322121937.040307268@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 22, 2021 at 07:44:05PM +0530, Naresh Kamboju wrote: > On Mon, 22 Mar 2021 at 18:14, Greg Kroah-Hartman > wrote: > > > > From: Thomas Bogendoerfer > > > > [ Upstream commit bd67b711bfaa02cf19e88aa2d9edae5c1c1d2739 ] > > > > BMIPS is one of the few platforms that do change the exception base. > > After commit 2dcb39645441 ("memblock: do not start bottom-up allocations > > with kernel_end") we started seeing BMIPS boards fail to boot with the > > built-in FDT being corrupted. > > > > Before the cited commit, early allocations would be in the [kernel_end, > > RAM_END] range, but after commit they would be within [RAM_START + > > PAGE_SIZE, RAM_END]. > > > > The custom exception base handler that is installed by > > bmips_ebase_setup() done for BMIPS5000 CPUs ends-up trampling on the > > memory region allocated by unflatten_and_copy_device_tree() thus > > corrupting the FDT used by the kernel. > > > > To fix this, we need to perform an early reservation of the custom > > exception space. Additional we reserve the first 4k (1k for R3k) for > > either normal exception vector space (legacy CPUs) or special vectors > > like cache exceptions. > > > > Huge thanks to Serge for analysing and proposing a solution to this > > issue. > > > > Fixes: 2dcb39645441 ("memblock: do not start bottom-up allocations with kernel_end") > > Reported-by: Kamal Dasu > > Debugged-by: Serge Semin > > Acked-by: Mike Rapoport > > Tested-by: Florian Fainelli > > Reviewed-by: Serge Semin > > Signed-off-by: Thomas Bogendoerfer > > Signed-off-by: Sasha Levin > > --- > > arch/mips/include/asm/traps.h | 3 +++ > > arch/mips/kernel/cpu-probe.c | 6 ++++++ > > arch/mips/kernel/cpu-r3k-probe.c | 3 +++ > > arch/mips/kernel/traps.c | 10 +++++----- > > mipc tinyconfig and allnoconfig builds failed on stable-rc 5.10 branch > > make --silent --keep-going --jobs=8 > O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=mips > CROSS_COMPILE=mips-linux-gnu- 'CC=sccache mips-linux-gnu-gcc' > 'HOSTCC=sccache gcc' > WARNING: modpost: vmlinux.o(.text+0x6a88): Section mismatch in > reference from the function reserve_exception_space() to the function > .meminit.text:memblock_reserve() > The function reserve_exception_space() references > the function __meminit memblock_reserve(). > This is often because reserve_exception_space lacks a __meminit > annotation or the annotation of memblock_reserve is wrong. > > FATAL: modpost: Section mismatches detected. > Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. > make[2]: *** [/builds/linux/scripts/Makefile.modpost:59: > vmlinux.symvers] Error 1 > > Here is the list of build failed, > - gcc-8-allnoconfig > - gcc-8-tinyconfig > - gcc-9-allnoconfig > - gcc-9-tinyconfig > - gcc-10-allnoconfig > - gcc-10-tinyconfig > - clang-10-tinyconfig > - clang-10-allnoconfig > - clang-11-allnoconfig > - clang-11-tinyconfig > - clang-12-tinyconfig > - clang-12-allnoconfig > > Reported-by: Naresh Kamboju > > link: > https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc/-/jobs/1117167411#L142 > > steps to reproduce: > --------------------------- > # TuxMake is a command line tool and Python library that provides > # portable and repeatable Linux kernel builds across a variety of > # architectures, toolchains, kernel configurations, and make targets. > # > # TuxMake supports the concept of runtimes. > # See https://docs.tuxmake.org/runtimes/, for that to work it requires > # that you install podman or docker on your system. > # > # To install tuxmake on your system globally: > # sudo pip3 install -U tuxmake > # > # See https://docs.tuxmake.org/ for complete documentation. > > > tuxmake --runtime podman --target-arch mips --toolchain gcc-10 > --kconfig tinyconfig > Thanks for letting me know, I'll go drop this and push out a new -rc... greg k-h