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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62399C19F2A for ; Mon, 8 Aug 2022 02:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7HuDz5iiidQhfnNy4khdcAVcQ1DuJ2b+EPvW8fwK8BY=; b=tXjicHF4RgjSUN 3jzoTPeYEQRW8slSFCfE4W+Ctj24/8gshhHf4GZ79qLBeCkQ3yE7GIrUAl5EOq/r0nvzrPTk/7zeC cDtUDo8sNXE1C6FK67W75mvnn1xVMd5OIqxIQcD4ddVfkey9fli4Gdm3ho0ctW1iz5/kA8VuptK0Q dfmOuTgbGil/YtHMgNAIuKXp/aGhJbZkdbbCCReoyauDKllvgGfBd675DJOZYhqpEPsJJv8TTlCH3 iajvZN5wuC3vu5KCBxJASiaRAprCLQn2y+3UKJCGLBQw5seYbHcJxBoX7XEGNMZqxiTZSH+Rmhxx7 LPV7R0VpykkhBHe+6idQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKsB2-007rYo-3f; Mon, 08 Aug 2022 02:07:32 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKrga-007deL-F7 for linux-arm-kernel@lists.infradead.org; Mon, 08 Aug 2022 01:36:06 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E776260E8E; Mon, 8 Aug 2022 01:36:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CA7BC4347C; Mon, 8 Aug 2022 01:36:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659922563; bh=m0hTkEbkuaXphWWnC/gxMUIwGj3LqHqY6oqSiCR51TA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gvJ6Sm3mUE2wqR/XxnJfQ7J16HU1CsHnVsAvoCizf5FPoFcwKOKFls1Xd7RlHxAk2 1kmJlLRClpEDuCGtodvsUbBc+rTUAjhmZzNu0CW55FimSTmefsdsRWFvfZiph5nizM eN1sGylAJALEjRxweoaGRBRZdvcD46c+5RMIUE2gHntqYsbowjSscrTvD24g2OxsY+ MLzG6GkefhuOY4c/gktFOIAty6yRxArYNQm1qKYl/sWio3NObWMlVLT3QcBtFIUM/V mFBb8VMT7S+uZhKdQzLMspIHDHgArlNESDUAbGQfBqdNQHStffXgW6kQ94zqssJaie atZa9GVk208Mw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ard Biesheuvel , Anshuman Khandual , Will Deacon , Sasha Levin , catalin.marinas@arm.com, mark.rutland@arm.com, hca@linux.ibm.com, Jason@zx2c4.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 03/45] arm64: kernel: drop unnecessary PoC cache clean+invalidate Date: Sun, 7 Aug 2022 21:35:07 -0400 Message-Id: <20220808013551.315446-3-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220808013551.315446-1-sashal@kernel.org> References: <20220808013551.315446-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220807_183604_621711_C0797F5D X-CRM114-Status: GOOD ( 16.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 From: Ard Biesheuvel [ Upstream commit 2e945851e26836c0f2d34be3763ddf55870e49fe ] Some early boot code runs before the virtual placement of the kernel is finalized, and we used to go back to the very start and recreate the ID map along with the page tables describing the virtual kernel mapping, and this involved setting some global variables with the caches off. In order to ensure that global state created by the KASLR code is not corrupted by the cache invalidation that occurs in that case, we needed to clean those global variables to the PoC explicitly. This is no longer needed now that the ID map is created only once (and the associated global variable updates are no longer repeated). So drop the cache maintenance that is no longer necessary. Signed-off-by: Ard Biesheuvel Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20220624150651.1358849-9-ardb@kernel.org Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/kernel/kaslr.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/arch/arm64/kernel/kaslr.c b/arch/arm64/kernel/kaslr.c index 418b2bba1521..d5542666182f 100644 --- a/arch/arm64/kernel/kaslr.c +++ b/arch/arm64/kernel/kaslr.c @@ -13,7 +13,6 @@ #include #include -#include #include #include #include @@ -72,9 +71,6 @@ u64 __init kaslr_early_init(void) * we end up running with module randomization disabled. */ module_alloc_base = (u64)_etext - MODULES_VSIZE; - dcache_clean_inval_poc((unsigned long)&module_alloc_base, - (unsigned long)&module_alloc_base + - sizeof(module_alloc_base)); /* * Try to map the FDT early. If this fails, we simply bail, @@ -174,13 +170,6 @@ u64 __init kaslr_early_init(void) module_alloc_base += (module_range * (seed & ((1 << 21) - 1))) >> 21; module_alloc_base &= PAGE_MASK; - dcache_clean_inval_poc((unsigned long)&module_alloc_base, - (unsigned long)&module_alloc_base + - sizeof(module_alloc_base)); - dcache_clean_inval_poc((unsigned long)&memstart_offset_seed, - (unsigned long)&memstart_offset_seed + - sizeof(memstart_offset_seed)); - return offset; } -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel