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 D132EC25B07 for ; Mon, 8 Aug 2022 01:33:02 +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=SDMNL8X+DBvu/3 V13Uge7jqIqrcP7wuoW37J8HleVsixRzBPA5zqME56mKvFBTnM1zTzn58DQXdjqh6D8fbcqOXv1d+ RirYOzJwOm1zbig0DI9S6NJWO6w3of2U2bKTOAeaPB98Z6dwuYGYvWpsC3M76VM2x51ComahPNuMY ZpiLWe+RJztFLPY+MNXzaMPYt/iQLYi2geKORBANlvakVY/b4sl8IR/bbheNc7BZAZhHMkDgc+Xrl 9qrK4wz2dkRYhzcUtAtY6vc5wLGFzWo1/Qm8dsAnfKBfB9ykzRE9L1/044jc9oUAWHiEpxZnzzaz3 vIPiYhXPWpSUD6EO2WBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKrcZ-007bOb-9d; Mon, 08 Aug 2022 01:31:55 +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 1oKrcL-007bMM-Gm for linux-arm-kernel@lists.infradead.org; Mon, 08 Aug 2022 01:31:43 +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 098D660DB9; Mon, 8 Aug 2022 01:31:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6277C433D6; Mon, 8 Aug 2022 01:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659922300; bh=m0hTkEbkuaXphWWnC/gxMUIwGj3LqHqY6oqSiCR51TA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fwe78hh7sY/zfPysrHoiFQf+E0Hml2Yu06XapvElwS7X0FU9ix8Tz/OAHPk+Mt6Vb Z7/2BDYhnyS4NHzGejFPdq7dTn+A2V+Ac2qY0a7D0yI9xHK8OZNogFSVV+YmXtFtfo YbNs6r8bKKuADN/DVG1KEQ8trF3BFTlbLfbfhEBw2gUcmLl12GCvMokuy3Un1pbvas b8ZLyUAmi0hl8XjPGsvdS96lVL5eZHgX+GfM3nTtO6JfLl7DjO2x8fSR0nRnLTd49M g7JeDNZsBrXvuEO0lDzk5SlBJSe5ecqmP17DSOt3BwsA6/F0eG0RSn22EHVPRb6RqZ W01TLpG0Yr/mg== 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, bp@suse.de, Jason@zx2c4.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.19 05/58] arm64: kernel: drop unnecessary PoC cache clean+invalidate Date: Sun, 7 Aug 2022 21:30:23 -0400 Message-Id: <20220808013118.313965-5-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220808013118.313965-1-sashal@kernel.org> References: <20220808013118.313965-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_183141_699383_847889EA X-CRM114-Status: GOOD ( 15.89 ) 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