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 99A3BC433EF for ; Sun, 29 May 2022 15:37:56 +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:In-Reply-To:From:References:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hrBPhuxyQYh+PD0sgQ7nDT+gVGqz5ksySAeXER2u28o=; b=pR0K2NN/rUeSBk WqCu6LETma/UcJq0lPWFUpT8aCSQcLOLaflryTDlgZuoLrO+p0qdU9suzDCrS/xX7MI+4p4KsjFRK jQCetXQBKNqmqm9jFpZkk39rN1g5gf7MVtQtWzwF6orpHJfaJLbumqFeePda2g2pqqLJXUQ6RjFVI gSIXZuxxRcw6pAEjZO8w0oKWhZY8cT/bt9Npzy6CzfahT1dlPnDfzS1t91VHyNrSYupn8qaxIpCO4 XyKnx1R553YGcXz6MemOsQHYASAEwbyeNq/cnDFUz7vH2gA+AtBR3umOwXcNPTJhZe3aL8+K482r5 up4k7pfEBdnxVdaNNZaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvKy4-004B9u-B7; Sun, 29 May 2022 15:36:36 +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 1nvKy1-004B95-Kd for linux-arm-kernel@lists.infradead.org; Sun, 29 May 2022 15:36:35 +0000 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220529_083633_769876_AA3818E3 X-CRM114-Status: GOOD ( 17.39 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel