Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3011005ioo; Sun, 29 May 2022 09:54:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw48lliE/tG7Oe1GzmwIJ5Od4L3gwPZv+D4Apaq+Uy4rSudEzNHtZIUBEPjq4X4hEuCsjpj X-Received: by 2002:a65:6bcc:0:b0:3f6:1815:f541 with SMTP id e12-20020a656bcc000000b003f61815f541mr44445778pgw.183.1653843260774; Sun, 29 May 2022 09:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653843260; cv=none; d=google.com; s=arc-20160816; b=dwbHY/WaoLoaX6DMriPlrE1ZzREXe00VYBeasMcBwOZfGE6oxByPqTE042cL8gY71T ErCzl1rZ7dofe7iL0nbzbhL4Xn1P8NUu2l+FhADkGuk1Lbnldx8qPWr/SAECYCsZG91g WN7TCOJOi0+1nwOgPCgylDjJ1x0bL3gxwY0z4chdmfMU+MEgJZddv4cPn+V90MrO3pM5 gP6xOddih7N47S7iuP0g/MRbYlg7UeUPIOXIGtjeEgNVfJfBYVE7ytsv0uI8nFkcOxTC SyIDShW7CNHHEEIDJ/X/vIyxfBIucyCesNAvXVXUQcZRi93PEcPD3UNbgg4MFzIPgTvO 8/Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-filter; bh=ROb/W/+2IsIw99UuNX/wvckTYE+xEoi+uH7gZDy4cXY=; b=CI9ne5CdXHlu5U3DV0xQ9AwAQdd7rgzxXtzM5yk4biUhVkcHZLyMYYSFwNSrj1p9re IfDCBXkHgKbh3TYJ9zT564Qg0ibZNfee83mZuvpayivjl00uioG6QUIsR/aEBsGos31H LwDunRtYkctvxlN2fGTlRqKBmGQt5vLZL1n9rQEaQnl0XsAXxouxTRHZD2IxJGQPVYfl IW/WXYsYbIjv5mkKmqvRmCOCDZcSQy08BZQ2tINjhS83Eu65Gfw5GBPga9xR97I68NT8 ziYCd8Jv/6XXzIjABYIu3STtfkKd4n0svgxrzBrojDRAK0bG/y83KrAb80JY6TRwVKcB yPGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=an5IEXSZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a63c10d000000b003c642cb0fefsi14259891pgf.130.2022.05.29.09.53.43; Sun, 29 May 2022 09:54:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=an5IEXSZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231173AbiE2Pgg (ORCPT + 99 others); Sun, 29 May 2022 11:36:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231154AbiE2Pgd (ORCPT ); Sun, 29 May 2022 11:36:33 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EE256BF78; Sun, 29 May 2022 08:36:32 -0700 (PDT) Received: from [192.168.254.32] (unknown [47.189.24.195]) by linux.microsoft.com (Postfix) with ESMTPSA id ADE7620BA5BE; Sun, 29 May 2022 08:36:31 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com ADE7620BA5BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1653838592; bh=ROb/W/+2IsIw99UuNX/wvckTYE+xEoi+uH7gZDy4cXY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=an5IEXSZmn1efYGvhIMQvq9/f9ZuUi9v5rC3SmrLUsSoW+56mQGsMUFPwSV4T6PcM uqzKZFVpUESsFTgkg5K8PI1LbBxufNocS0EGYCIq/CZ6TUjk2UpEBTfKiumi0Zqp8Z 7FYeCTJxgsiCBulx+ZYsy4CKzcDMgjICBukMxrzY= Message-ID: Date: Sun, 29 May 2022 10:36:30 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [RFC PATCH v2 05/20] objtool: Reorganize ORC types Content-Language: en-US To: Chen Zhongjin , jpoimboe@redhat.com, peterz@infradead.org, mark.rutland@arm.com, broonie@kernel.org, nobuta.keiya@fujitsu.com, sjitindarsingh@gmail.com, catalin.marinas@arm.com, will@kernel.org, jamorris@linux.microsoft.com, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220524001637.1707472-1-madvenka@linux.microsoft.com> <20220524001637.1707472-6-madvenka@linux.microsoft.com> From: "Madhavan T. Venkataraman" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-21.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org See my responses inline... On 5/24/22 09:27, Chen Zhongjin wrote: > > > On 2022/5/24 8:16, madvenka@linux.microsoft.com wrote: >> From: "Madhavan T. Venkataraman" >> >> The ORC code needs to be reorganized into arch-specific and generic parts >> so that architectures other than X86 can use the generic parts. >> >> orc_types.h contains the following ORC definitions shared between objtool >> and the kernel: >> >> - ORC register definitions which are arch-specific. >> - orc_entry structure which is generic. > ... >> diff --git a/include/linux/orc_entry.h b/include/linux/orc_entry.h >> new file mode 100644 >> index 000000000000..3d49e3b9dabe >> --- /dev/null >> +++ b/include/linux/orc_entry.h >> @@ -0,0 +1,39 @@ >> +/* SPDX-License-Identifier: GPL-2.0-or-later */ >> +/* >> + * Copyright (C) 2017 Josh Poimboeuf >> + */ >> + >> +#ifndef _ORC_ENTRY_H >> +#define _ORC_ENTRY_H >> + >> +#ifndef __ASSEMBLY__ >> +#include >> + >> +/* >> + * This struct is more or less a vastly simplified version of the DWARF Call >> + * Frame Information standard. It contains only the necessary parts of DWARF >> + * CFI, simplified for ease of access by the in-kernel unwinder. It tells the >> + * unwinder how to find the previous SP and BP (and sometimes entry regs) on >> + * the stack for a given code address. Each instance of the struct corresponds >> + * to one or more code locations. >> + */ >> +struct orc_entry { >> + s16 sp_offset; >> + s16 fp_offset; >> +#if defined(__LITTLE_ENDIAN_BITFIELD) >> + unsigned sp_reg:4; >> + unsigned fp_reg:4; > Are sp_reg & fp_reg & end needed? I noticed that they are not used in > reliability checking. Yeah. The ORC entry structure is a superset of what I need for ARM64. But X86 requires all of it. (Although I think "end" is not needed anymore). And, other architectures might require all of it. So, I am keeping it as is. > >> + unsigned type:3; >> + unsigned end:1; >> +#elif defined(__BIG_ENDIAN_BITFIELD) >> + unsigned fp_reg:4; >> + unsigned sp_reg:4; >> + unsigned unused:4; >> + unsigned end:1; >> + unsigned type:3; >> +#endif >> +} __packed; >> + >> +#endif /* __ASSEMBLY__ */ >> + >> +#endif /* _ORC_ENTRY_H */ Thanks! Madhavan