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 X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 992E3C2B9F4 for ; Thu, 17 Jun 2021 18:34:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 583D4613DD for ; Thu, 17 Jun 2021 18:34:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 583D4613DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=CKlw38n4dC/OR1qPhugzqSDIPveS+jEoW5E1QAiRUzY=; b=pwz4PT2tPKNQxpeer3uOlvBom8 YxuTFaeA2S6ygjZmUO/976WoPQ/W20eBCApIlXoRpLG4mUyIBaUkvYcQOznBGQXzho/x8ddew5ykV ZUzix5KvNKrlwgwnsZMAyHiV434ltSqe9ZlBJ+uk5xLbE3f2NEX9H/Zp8Gq7wqeC5L3HiPZhJK38t AXtQKN4ePdtG/s+1fb224oxlJC0slSWxUJO3uGdFAGM31MHzDKh7yl8LO7PIhjKTT3vVuTgcdLH/1 7aan+NYDWTY0k4fKtiOSxJQGGulIH/efK/n32sYJPGpQj0nhHvrBeuQ97dmlFcCi0VbbPx+cjALcy 8SsARLDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltwoL-00BOnD-2F; Thu, 17 Jun 2021 18:32:17 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltwoG-00BOko-Kt for linux-arm-kernel@lists.infradead.org; Thu, 17 Jun 2021 18:32:14 +0000 Received: from [192.168.254.32] (unknown [47.187.214.213]) by linux.microsoft.com (Postfix) with ESMTPSA id 596D320B83DE; Thu, 17 Jun 2021 11:32:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 596D320B83DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1623954730; bh=LUzAs8YwcV9OEjtCvxPMYvniuVgxNyeebthHhcHDNUQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=kD5E+KGp4yOxOp+fj4nhFGdWt11PntzW4A2NBd2U7SL9Wq6IYTKJGhJ2Llf3RGlH6 BUxM+DWFZ1d/2vXkeI7mU0HYUo1l0qw6abtjuebcP7c7ZP9BRSkYZk76H7PkkJQvil 0x+dEVwDwzioelIYxXPSSVJu8UuooGch59mPIrMI= Subject: Re: [RFC PATCH 1/1] arm64: implement live patching To: "nobuta.keiya@fujitsu.com" , Suraj Jitindar Singh Cc: "linux-kernel@vger.kernel.org" , "live-patching@vger.kernel.org" , "catalin.marinas@arm.com" , "will@kernel.org" , "mark.rutland@arm.com" , "broonie@kernel.org" , "duwe@lst.de" , "sjitindarsingh@gmail.com" , "benh@kernel.crashing.org" , "linux-arm-kernel@lists.infradead.org" References: <20210604235930.603-1-surajjs@amazon.com> From: "Madhavan T. Venkataraman" Message-ID: <7080d2a9-6ec2-94e9-3577-e5f7233ad3ab@linux.microsoft.com> Date: Thu, 17 Jun 2021 13:32:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210617_113212_822798_84371F84 X-CRM114-Status: GOOD ( 16.96 ) 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 On 6/17/21 4:29 AM, nobuta.keiya@fujitsu.com wrote: > >> It's my understanding that the two pieces of work required to enable live >> patching on arm are in flight upstream; >> - Reliable stack traces as implemented by Madhavan T. Venkataraman [1] >> - Objtool as implemented by Julien Thierry [2] >> >> This is the remaining part required to enable live patching on arm. >> Based on work by Torsten Duwe [3] >> >> Allocate a task flag used to represent the patch pending state for the >> task. Also implement generic functions klp_arch_set_pc() & >> klp_get_ftrace_location(). >> >> In klp_arch_set_pc() it is sufficient to set regs->pc as in >> ftrace_common_return() the return address is loaded from the stack. >> >> ldr x9, [sp, #S_PC] >> >> ret x9 >> >> In klp_get_ftrace_location() it is necessary to advance the address by >> AARCH64_INSN_SIZE (4) to point to the BL in the callsite as 2 nops were >> placed at the start of the function, one to be patched to save the LR and >> another to be patched to branch to the ftrace call, and >> klp_get_ftrace_location() is expected to return the address of the BL. It >> may also be necessary to advance the address by another AARCH64_INSN_SIZE >> if CONFIG_ARM64_BTI_KERNEL is enabled due to the instruction placed at the >> branch target to satisfy BTI, >> >> Signed-off-by: Suraj Jitindar Singh >> >> [1] https://lkml.org/lkml/2021/5/26/1212 >> [2] https://lkml.org/lkml/2021/3/3/1135 >> [3] https://lkml.org/lkml/2018/10/26/536 >> --- > > AFAIU Madhavan's patch series linked in the above [1] is currently awaiting > review by Mark Rutland. It seems that not only this patch series but also the > implementation of arch_stack_walk_reliable() at the below link is required > to enable livepatch. > Yes. I have a patch ready for that. But I can submit that only after the previous series has been accepted. Thanks Madhavan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel