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 48B1EC43334 for ; Thu, 9 Jun 2022 14:51:33 +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: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:In-Reply-To:References: List-Owner; bh=u9JjDXkW6iUieH/d+6poFzb3iqgRRT+IfkKymxDAZEA=; b=nGfQaSskrKde3h LDlU7DT+5ZQrJfYtiucVizf51PcGVio+eOVY2/8XG0DqfKeut6uaLDoZ5pF+V8GAaxK/kuRPqAnoG nx5AQbPUqJqA2Rm8kJgQYC8MGnfH2/dXNwot7I1HVNI3BKc7S9Yvw31xyef9PfDPo3vfuPOASdMP0 fuUVCFdfmjxgaLkLGyJlXoI5sBWeoFJvuPnTXweX7eYeObUuM7fIXCOm/s1bLpWXAzSdenN6A30t1 59HbDOgdvxr3MSMUwuvB4gQNOUH2bqhpCMVQPQQZ0lASH3qOh1F9DMvX0FlIWY9Ke0m3ySGfp8Ark UGOkxdSVUeu9bqxkcLog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzJUR-002Z4O-W6; Thu, 09 Jun 2022 14:50:28 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzJUI-002Z0w-3D for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2022 14:50:19 +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 743C961E83; Thu, 9 Jun 2022 14:50:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44E13C34114; Thu, 9 Jun 2022 14:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654786216; bh=tuhMND7Ir9YWhKMT0dct8qZbTvfSkU/ADxGFnRoTBB4=; h=From:To:Cc:Subject:Date:From; b=C7RHRYAPG3fp02skKK1QlNZTHI1bmO0coT29vqKEzUkRu0fRcZfmXRJ7qUeB+h9mY 1FYoOFDcBK9YRZNWmoUg+a1DKM0ikT2bO9Xjy0zl5Wsu/6O/k7GEn/dMO+gYklDJS3 /fchauD+A0Nbyw0YhyMshT6VLLwb1M/r7YFSzq6ag2Aqx2CQxi1oUfpLUTA10TZAIt FzAbcAMr9wbThi8biMMBHFncr1AsXSegow8pJP2cYs8xOLCxxQEZsxL89Z89s2kjDc HT69FvMA7H9Cw56nvU/AH45jEv1xsQkWNJVIJ3swmsmUMpAL/eNZAJKfwVlDRXUi/J D12fsD7YX8xLA== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , will@kernel.org, maz@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, keescook@chromium.org Subject: [PATCH v4 0/2] arm64: apply G-to-nG conversion for KPTI with MMU enabled Date: Thu, 9 Jun 2022 16:50:08 +0200 Message-Id: <20220609145010.3602229-1-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1620; h=from:subject; bh=tuhMND7Ir9YWhKMT0dct8qZbTvfSkU/ADxGFnRoTBB4=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBiogieNPrL32WyJnMRWV5Ahll4nQv01K2I/hZtawOd NQaliMGJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYqIIngAKCRDDTyI5ktmPJFmxC/ 40Uo6NAvOZwfazsBD4x/5bf0xdF4OBOqLVODrKdY57xtV3F2QOCCVPrUQUdWYzuaIpiicpwd8aynuP pI035/JGunw4kqPpyGlHZmTORilOhwJim/IS88X2w6bbV7BsNvrz9EFTZfmb/ya4x3AYnSGrEBoETr kECvpPmiPhf725Nk65OXmKkSn85XuUPnOjJI9O0FYBKVRIURPn7RCkqZH+0unJRVjrrgI6OjvYwEVS PFBocKhKhGPzJjAXy2WSD7p5UoHNTikLz1IwCuNLrmbhRHr8eYIvF232J6+pmizWZY3oLyd8ZfPzfG zWTUP/ysQxXQrDqrEVJ0/5/vwwpZvfvZxD4o1T5oTTI2F8qtXqMfu25SJXvLnZGLRmQJS+Zm759bQt kAxBsjlqiFdDuTod69/uWyOeXk3kyZIx2kNTJ9/ezLa02J63gGFYdgsvBDd9z9f1YRXUkzOKJ6mHnw nmbnxVPAcE5RblfqESX7Sr5FSRnYfhrpTXZyTqng+ZJm8= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220609_075018_223811_8CA293F3 X-CRM114-Status: GOOD ( 11.72 ) 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 Rationale for the series is in patch #2. Changes since v3 [0]: - fix issue pointed out by Mark in patch #1, and add his Rb/Tb; - move shared flag back into the ID map, as this allows us to revert to the existing synchronization scheme, and drastically simplify the patch - we can move the flag into a separate page later, if needed; - use symbol alias to access __create_pgd_mapping() so we are not forced to expose it in general. Changes since v2 [1]: - reinstate optimization that avoids descending into the same page tables repeatedly when KASAN is enabled; - use broadcast TLB maintenance when doing BBM for the temporary mappings, to prevent potential TLB conflicts on the secondary cores that are running from the same set of temporary page tables; - remove a wait loop in the C code, by using 'num_cpus + 1' as the signal value rather then 0x0; - declutter and simplify the asm helper code, to make it more maintainable. Cc: will@kernel.org Cc: maz@kernel.org Cc: mark.rutland@arm.com Cc: catalin.marinas@arm.com Cc: keescook@chromium.org [0] https://lore.kernel.org/linux-arm-kernel/20220421140339.1329019-1-ardb@kernel.org/ [1] https://lore.kernel.org/linux-arm-kernel/20220413121848.787565-1-ardb@kernel.org/ Ard Biesheuvel (2): arm64: kpti-ng: simplify page table traversal logic arm64: mm: install KPTI nG mappings with MMU enabled arch/arm64/kernel/cpufeature.c | 54 +++++- arch/arm64/mm/mmu.c | 7 + arch/arm64/mm/proc.S | 173 ++++++++++---------- 3 files changed, 145 insertions(+), 89 deletions(-) -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel