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 610FEC25B07 for ; Mon, 8 Aug 2022 01:50:07 +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=Zo4MMdXvfA7ftC 5OKrZ5b4FtWWpvgP0xxubNEhVLP2fQt6Br+fg/ZaSFsK5WkzuUROC/UnpHzDLyMrY9VgZK8I5diiT 8ecbDIAtynPyeAPmBlsNrqx80k/wjVJ+EOqCUrS90gh83ruB9aciD0UUj1MiONdpJdk2A3SPWaChI SnY8LvmS/cEvKCSKnyXHtra4fn5C39uU1pKSw3G3kQif4E2W15rG19k7pI2vU4sIfrZkTyzkExfYs jV+SwGjtIQtp0r51syGooDMZKcy3ABX0Jsk1BP8JaIJot8+PPxcTfXPU3l21nRbQ7gBlYzBOenqyW fJIGsu5ZhD8tJW7us6lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKrt0-007jPG-A5; Mon, 08 Aug 2022 01:48:55 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKree-007cVi-As for linux-arm-kernel@lists.infradead.org; Mon, 08 Aug 2022 01:34: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 ams.source.kernel.org (Postfix) with ESMTPS id CE2A6B80DDF; Mon, 8 Aug 2022 01:34:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69DF4C433C1; Mon, 8 Aug 2022 01:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659922441; bh=m0hTkEbkuaXphWWnC/gxMUIwGj3LqHqY6oqSiCR51TA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fx/oLxxB3mn9nKWGnwxYgZhwfpefqaKwIUUmcbqwq+8EAiMLJhzZO+09Qxgrzldsv mWBvXwoc+0/pLzGEkbJpMIlNy6sLVUSFakBHa/5vlbG+AQLFS+ZYalPGKd6j+Td0ua 4hAeOmb8UYB8PooB/FrRd/j1SjHy/7tEOhoAzMguINhqWJzcKujfgHf0N5Td0GU/3n rdrM8SitRs0utx0b9dHCh9VJVrKXnUygpvPwT7TInWsr0xB9tpNnMwdwoIlJLmkogl yYN6u/d6KZFZCTgsn2Yv/BZnXodqYHI7YsIu4IIPi4Nh1Wp3dD/o2dpc5+K7oJARoV m7KQojQPFTvXA== 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, hca@linux.ibm.com, Jason@zx2c4.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.18 03/53] arm64: kernel: drop unnecessary PoC cache clean+invalidate Date: Sun, 7 Aug 2022 21:32:58 -0400 Message-Id: <20220808013350.314757-3-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220808013350.314757-1-sashal@kernel.org> References: <20220808013350.314757-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_183404_679972_6C9312AF 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