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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 2ECA4C433E0 for ; Thu, 4 Feb 2021 13:04:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C074164F45 for ; Thu, 4 Feb 2021 13:04:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C074164F45 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=1vOZ8cOlF4ClQK7AQPAqn1Wft276/1dCun0YwGJwLxI=; b=P/bGKpCt1Ln5+PB728MiFaa6vr s5O6IrhoMcFakzxTgTdjnizA71qoiq1np1dp6RWraY8bxELc5uGXMoPCzZXrHbytOWYj7n/1PAlKb Sj2YcX/TiU9bDv5O+KVP35i3pU36Z9XLJPLqZgAstIbrgM+7XL1KHVlCx1LybDsmVH0gju4E42GKx TqNFy5Vsy4bAFog/QTfwUNywgKj5HrX3toC++nnG+MmPnUw7Dcj191F4/4UJWOhjsm9p6tOpU/BS1 9Ff0yc8kSCHbx+nZ85y+ggftvMiZvUQhWYxzPnF/oszZJH9KbVKhNVh4OiMSeYlerZ9BOw30nydbr 8vntEn6Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7eI9-0004Ej-MW; Thu, 04 Feb 2021 13:03:25 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7eI5-0004DU-Rr for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2021 13:03:24 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A050964E34; Thu, 4 Feb 2021 13:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612443801; bh=I7PS1sVunAJHln+kcg44Uy9FS4jhi5y1K6vF7E3KH7M=; h=From:To:Cc:Subject:Date:From; b=M9CWWvOT9/8qBN0yrJM+WPrfPlt1ASK2B1UXOkq0bNDUlMssC3epBcyghjqMFufCs BDKS0iI+kN7N+VRGhtJj893Z2Hx3koMZ0auktYwOB0igfyd+X/eND9E2LSBUBc98B5 pzPN3G6W1ZL0K0lBmH0fp8bgh1X50TZeMCCIIhRcTEKjb0AHF7kUpeyCAI0TlkIj0o 5baMAm8Fn0p1mPbWgqRDRJMsTeM0/Z1mLI+Z1z8Ritntmt1/rBu0T1X1RDZoamQmQc L6iT5mbmmM6iRiZR8dayDQOaBiq5RRwXUmcZP0ZIX+ehFXsodNelm4gItItr9iw4cm cVBF0lBE/moFQ== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: decompressor: clean decompressed kernel from cache twice on v7 Date: Thu, 4 Feb 2021 14:02:09 +0100 Message-Id: <20210204130209.114928-1-ardb@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210204_080322_096644_0F5980BC X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "kernelci.org bot" , maz@kernel.org, linus.walleij@linaro.org, linux@armlinux.org.uk, guillaume.tucker@collabora.com, Ard Biesheuvel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 5a29552af92dbd62 ("ARM: 9052/1: decompressor: cover BSS in cache clean and reorder with MMU disable on v7") moved cleaning of the kernel image to after the point where the MMU and caches are disabled, which is more in line with the architectural requirements. Unfortunately, doing so caused a regression on Clang builds, crashing before any diagnostic output is printed. Given that the full cleaning the cache afterwards is required in any case, let's reinstate the original cache clean of just the decompressed image occurring beforehand, amounting to a partial revert of the commit in question. Doing so has been confirmed by the reporter of the regression to mitigate it. Fixes: 5a29552af92dbd62 ("ARM: 9052/1: decompressor: cover BSS in ...") Reported-by: "kernelci.org bot" Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/head.S | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 5c97d341de6b..4e49ac64bf49 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -616,14 +616,18 @@ not_relocated: mov r0, #0 @ operations on the range [R0, R1], making this prior call to @ cache_clean_flush() redundant. In other cases, the clean is @ performed by set/way and R0/R1 are ignored. + @ However, not performing the redundant cache clean before + @ turning the MMU and caches off has been observed to cause + @ regressions, so on v7+ systems, the decompressed kernel image + @ is cleaned twice. @ - mov r0, #0 - mov r1, #0 + get_inflated_image_size r6, r2, r3 + mov r0, r4 @ start of decompressed kernel + add r1, r0, r6 @ end of decompressed kernel bl cache_clean_flush - get_inflated_image_size r1, r2, r3 ldr r2, =_kernel_bss_size - add r1, r1, r2 + add r1, r2, r6 mov r0, r4 @ start of decompressed kernel add r1, r1, r0 @ end of kernel BSS -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel