From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CAAA2253A4; Thu, 20 Mar 2025 17:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742490968; cv=none; b=fWOxC01Zo1ne2GrY74pIbZu4aD2ZjomvnNYUSY64ZRpf/Jzi5neM3VT5bUfdwuJJ02P7rvpDowkXBHWO3j73o3ojwidtRAw5rI+AbOPT+p766XX8F2VBAISANGzAyvLvzQ5DhIZt1dE7zmsDFOIxCYt62mhet5Kw4Famr2L+MBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742490968; c=relaxed/simple; bh=RBXQglLrnsSCMUyUpcMctHHkbTvdcAUfxAPc3DDrCJA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ka4vGBpIY8oiydEb3LOnY0CIgIIeR44k1V8Nj63pLpy/YaMUK7PlLTkKwzLaVnxtX/xVKHjk5JTkfTIuyxN/XM6DiwCtKyEATaGp8RUbFIQ+vsfJq9DnnjaPPVAh6O9n4u9aiHp4aJBBGAazJ84j6bH77W576/3ZDoLtn7Y4ShQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TSJL1HWg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TSJL1HWg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43CC3C4CEDD; Thu, 20 Mar 2025 17:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742490967; bh=RBXQglLrnsSCMUyUpcMctHHkbTvdcAUfxAPc3DDrCJA=; h=From:To:Cc:Subject:Date:From; b=TSJL1HWgOfQfnUivOeHQa0IadphqPzG8l6kOjkYDivl9hUxvFwc9n11YuzBC2/Rot vGhbLAFF8awTO3tTsDDOM0x+AXePTUnUmd67FGZPAESypwiA7Zg5+1vqDe70RGi8cw aBmvWiVsFWvNwLcP/fQLCXepYPQ+9HMnlBSw4RbatMHY6/fykB5gOw36o/lK0olLI1 nN3EUjLZyfCu2PzXZ09Ra9MoQiIhLCJpXfh3kXGPS47NQ6FDxfV4ZAFUo6QsHjPVKu XRHAg7AWj0NxTin5K5vyqcwEzeRz1txEa87lJ9mNtWZGWVkQXO1QcZHIJtXoK5u0n5 vlzz9Zv6Uw2xA== From: Song Liu To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-toolchains@vger.kernel.org, live-patching@vger.kernel.org Cc: indu.bhagat@oracle.com, puranjay@kernel.org, wnliu@google.com, irogers@google.com, joe.lawrence@redhat.com, jpoimboe@kernel.org, mark.rutland@arm.com, peterz@infradead.org, roman.gushchin@linux.dev, rostedt@goodmis.org, will@kernel.org, kernel-team@meta.com, song@kernel.org Subject: [PATCH v3 0/2] arm64: livepatch: Enable livepatch without sframe Date: Thu, 20 Mar 2025 10:15:57 -0700 Message-ID: <20250320171559.3423224-1-song@kernel.org> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit There are recent efforts to enable livepatch for arm64, with sframe [1] or without sframe [2]. This set tries to enable livepatch without sframe. Some of the code, however, are from [1]. Although the sframe implementation is more promising in longer term, it suffers from the following issues: 1. sframe is not yet supported in llvm; 2. There is still bug in binutil [3], so that we cannot yet use sframe with gcc; 3. sframe unwinder hasn't been fully verified in the kernel. On the other hand, arm64 processors have become more and more important in the data center world. Therefore, it is getting critical to support livepatching of arm64 kernels. With recent change in arm64 unwinder [4], it is possible to reliably livepatch arm64 kernels without sframe. This is because we do not need arch_stack_walk_reliable() to get reliable stack trace in all scenarios. Instead, we only need arch_stack_walk_reliable() to detect when the stack trace is not reliable, then the livepatch logic can retry the patch transition at a later time. Given the increasing need of livepatching, and relatively long time before sframe is fully ready (for both gcc and clang), we would like to enable livepatch without sframe. Thanks! [1] https://lore.kernel.org/live-patching/20250127213310.2496133-1-wnliu@google.com/ [2] https://lore.kernel.org/live-patching/20250129232936.1795412-1-song@kernel.org/ [3] https://sourceware.org/bugzilla/show_bug.cgi?id=32589 [4] https://lore.kernel.org/linux-arm-kernel/20241017092538.1859841-1-mark.rutland@arm.com/ Changes v2 => v3: 1. Remove a redundant check for -ENOENT. (Josh Poimboeuf) 2. Add Tested-by and Acked-by on v1. (I forgot to add them in v2.) v2: https://lore.kernel.org/live-patching/20250319213707.1784775-1-song@kernel.org/ Changes v1 => v2: 1. Rework arch_stack_walk_reliable(). v1: https://lore.kernel.org/live-patching/20250308012742.3208215-1-song@kernel.org/ Song Liu (2): arm64: Implement arch_stack_walk_reliable arm64: Implement HAVE_LIVEPATCH arch/arm64/Kconfig | 3 ++ arch/arm64/include/asm/thread_info.h | 4 +- arch/arm64/kernel/entry-common.c | 4 ++ arch/arm64/kernel/stacktrace.c | 66 +++++++++++++++++++++------- 4 files changed, 60 insertions(+), 17 deletions(-) -- 2.47.1