Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2685072pxb; Tue, 24 Aug 2021 05:21:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTi5J76OKK5d4CDfRlDboq0l0JKIjePdwkNJlKfyq2z9V2A9QWtfjv7mrGU95KcKDNd+M3 X-Received: by 2002:a05:6638:1448:: with SMTP id l8mr34253278jad.55.1629807667166; Tue, 24 Aug 2021 05:21:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629807667; cv=none; d=google.com; s=arc-20160816; b=tAZrMNRZJPj6t7g9KwgUsuBBnL/xnl+knUnQ3kCrmBsP4+Tro3kBH9MrS0Fq2HMlej iV2L4lUqRD6cqdDyAB/mDNyxcXxeDpRvi5Q6ECnaALR9lsRHvLSDXZTH6Mfm0DnLCR7U r7DCBPv1slbrS5SsHN8O1gP1K4Bv1ArQzLQiF2lylHcNWYBfDY8jkCJtBIT/FddzgvpT dG1BOvqqnbYjhCD9yuF5Z/V8RVVi09WHBXUy0+1+FDBqwkzk9ox10Bb5HYoKx5xVSb1/ wTQgPL8lBytC1YCLUnG5APsDiEdHuH00I7XCX0K4vo43rIXKpLV/96glIaYHeI1lROrX L9hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=2E2BthqVOdbe3t0YwvDr36tRv3x3At3+Zrr/r40y7RI=; b=ztR/Vcl+wF4tKHLtQsr5z72F5r9rKlFQDoOmPfXYZ8/vZ4BCuKOeupprvM+v1imZI2 cPKGHmbQmH/NvA5M24HrgQtYiBXnasAwez6REF35Lh2UdY+LVSWWE3JlSL2jdvTZk27G BhrYxq4zXeNcVPEub5xg/SQqp0k0uXwwTOYOS3oYi6VVlrIxzLt//uET40fsyNii74tL 4Ap6DCYcanKgfWccF/E6sOWLlCaXVFycgb7uUU+3zkMl4vk5lqBhljxAUX/se4NNPaIV PG9lNXBpxim6vLLizZFtlzTuiNVwMF/a9dY9YYW8zcszGgbogev98jtHRCktmMalHXUE qVNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=mR9DYLTN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si17020372jav.15.2021.08.24.05.20.55; Tue, 24 Aug 2021 05:21:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=mR9DYLTN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237148AbhHXMUj (ORCPT + 99 others); Tue, 24 Aug 2021 08:20:39 -0400 Received: from linux.microsoft.com ([13.77.154.182]:57860 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236676AbhHXMUi (ORCPT ); Tue, 24 Aug 2021 08:20:38 -0400 Received: from [192.168.254.32] (unknown [47.187.212.181]) by linux.microsoft.com (Postfix) with ESMTPSA id B35BD20B85E0; Tue, 24 Aug 2021 05:19:53 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B35BD20B85E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1629807594; bh=2E2BthqVOdbe3t0YwvDr36tRv3x3At3+Zrr/r40y7RI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=mR9DYLTNg0m86G7ZUVWEjSBEaT74uQ6YJ1vdiQ515TrjZfPVisZI2DnrylKPs15Zh EwYxTrM1e/V8gSsMdp9oyPgX205r5zm9fzlC6y1NBiiHmKsAT9Z3KUVNvYlPs+KePY 5AY08rQN8w5gYih+LZNJGU8NAcnDLh925So09CHE= Subject: Re: [RFC PATCH v8 3/4] arm64: Introduce stack trace reliability checks in the unwinder To: "nobuta.keiya@fujitsu.com" Cc: "mark.rutland@arm.com" , "broonie@kernel.org" , "jpoimboe@redhat.com" , "ardb@kernel.org" , "sjitindarsingh@gmail.com" , "catalin.marinas@arm.com" , "will@kernel.org" , "jmorris@namei.org" , "pasha.tatashin@soleen.com" , "jthierry@redhat.com" , "linux-arm-kernel@lists.infradead.org" , "live-patching@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20210812190603.25326-1-madvenka@linux.microsoft.com> <20210812190603.25326-4-madvenka@linux.microsoft.com> From: "Madhavan T. Venkataraman" Message-ID: <62d8969d-8ba1-4554-16b4-1c0bd4f8d9e7@linux.microsoft.com> Date: Tue, 24 Aug 2021 07:19:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-2022-jp Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/24/21 12:55 AM, nobuta.keiya@fujitsu.com wrote: > Hi Madhavan, > >> @@ -245,7 +271,36 @@ noinline notrace void arch_stack_walk(stack_trace_consume_fn consume_entry, >> fp = thread_saved_fp(task); >> pc = thread_saved_pc(task); >> } >> - unwind(consume_entry, cookie, task, fp, pc); >> + unwind(consume_entry, cookie, task, fp, pc, false); >> +} >> + >> +/* >> + * arch_stack_walk_reliable() may not be used for livepatch until all of >> + * the reliability checks are in place in unwind_consume(). However, >> + * debug and test code can choose to use it even if all the checks are not >> + * in place. >> + */ > > I'm glad to see the long-awaited function :) > > Does the above comment mean that this comment will be removed by > another patch series that about live patch enablement, instead of [PATCH 4/4]? > > It seems to take time... But I start thinking about test code. > Yes. This comment will be removed when livepatch will be enabled eventually. So, AFAICT, there are 4 pieces that are needed: - Reliable stack trace in the kernel. I am trying to address that with my patch series. - Mark Rutland's work for making patching safe on ARM64. - Objtool (or alternative method) for stack validation. - Suraj Jitindar Singh's patch for miscellaneous things needed to enable live patch. Once all of these pieces are in place, livepatch can be enabled. That said, arch_stack_walk_reliable() can be used for test and debug purposes anytime once this patch series gets accepted. Thanks. Madhavan