Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp936087rwe; Thu, 1 Sep 2022 09:46:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Hud5UrASqfTe75UazYHGyKYyGD+XXB5A3/OrCHoZc5k85joLoxbZbt/X4Izj1MQ3qDaqZ X-Received: by 2002:a05:6402:5212:b0:446:6910:5549 with SMTP id s18-20020a056402521200b0044669105549mr29784237edd.345.1662050794453; Thu, 01 Sep 2022 09:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662050794; cv=none; d=google.com; s=arc-20160816; b=RcVmtrm/yhRhc4UGf6Vsm6YXuJDoGVSgn/abctDAY7ymyx8cEC+LOzrtsILbky7AOH eveYiNq76G0946ULrsj+evt89IJQ7efKdTx4Rvl8YYutkCRYHE13abViT73BaXcWzpEQ 1ZOGvcy2ERoeh3APix/0QU3/fMXBExI0uztWl7l4PS9tWcMbFYqyd5iXOWZQ/AohdFE2 X1l06afMq2SUq9K6YUN36vGERspfO7apmcETcAwsAMhamSL8vxd4MboDoKJ456e07RyZ EjB8bXamk+SvrVT5L9VyNcM25LbAi6LUdBO5MMRjUVh82P64X8NFWK4TJmHP/FtjcnmT GZgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=AFhiZuUx0VQFTEBXk13wB+ltGYDcqEIj5YRq4VN3NBs=; b=jSYtsvktaDndTyV0zD+izIe8kOCTg77/cLS26+NqPJ4P+x+LB40OmjwDGRMRw0VmDU BgePiqcKW6xi/uIP7kp4KWDk0l1eDxZCFQ/2oZ0k0juyfLb/0CXOdhSsHuBiLinnQrGt 1hM/gi9Tw9Aq6lKFtXPABBsZnNyV6Aib9MnzDV5Jy7GaxxTZ8jfT0esZvzuA+RaJBetG e5Wa8wlyLyVe0UfSCBkxY2Jc3waTOQ2JLgXGTMPAdgNreg82kfsIS8de6i1+R/k7a0kT Yd6ZasDVvpQb40zEHe3vn/T0ymWvTW+CkXWkBwfA92hpwWDnOIuekOrHRh8ergk1JHGx gtxA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg15-20020a170907970f00b0073306ff26besi13221713ejc.969.2022.09.01.09.46.06; Thu, 01 Sep 2022 09:46:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233284AbiIAPRy (ORCPT + 99 others); Thu, 1 Sep 2022 11:17:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232539AbiIAPRw (ORCPT ); Thu, 1 Sep 2022 11:17:52 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6960867C95 for ; Thu, 1 Sep 2022 08:17:51 -0700 (PDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 281FBJ1H024415; Thu, 1 Sep 2022 10:11:19 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 281FBHnO024414; Thu, 1 Sep 2022 10:11:17 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 1 Sep 2022 10:11:17 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Sathvika Vasireddy , "linuxppc-dev@lists.ozlabs.org" , "peterz@infradead.org" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "aik@ozlabs.ru" , "mingo@redhat.com" , "npiggin@gmail.com" , "jpoimboe@redhat.com" , "naveen.n.rao@linux.vnet.ibm.com" , "mbenes@suse.cz" , "chenzhongjin@huawei.com" Subject: Re: [PATCH v2 15/16] objtool/powerpc: Enable objtool to be built on ppc Message-ID: <20220901151117.GE25951@gate.crashing.org> References: <20220829055223.24767-1-sv@linux.ibm.com> <20220829055223.24767-16-sv@linux.ibm.com> <2fb92e17-2ad5-9732-560c-a7321e6a2528@csgroup.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2fb92e17-2ad5-9732-560c-a7321e6a2528@csgroup.eu> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Thu, Sep 01, 2022 at 09:32:46AM +0000, Christophe Leroy wrote: > Le 29/08/2022 ? 07:52, Sathvika Vasireddy a ?crit?: > > +int arch_decode_instruction(struct objtool_file *file, const struct section *sec, > > + unsigned long offset, unsigned int maxlen, > > + unsigned int *len, enum insn_type *type, > > + unsigned long *immediate, > > + struct list_head *ops_list) > > +{ > > + u32 insn; > > + > > + *immediate = 0; > > + insn = bswap_if_needed(file->elf, *(u32 *)(sec->data->d_buf + offset)); > > + *len = 4; > > Should be *len = 8 when insn >> 26 == 1. But please use ppc_inst_prefixed(). And just use ppc_inst_len() here? Not having convenience abstraction functions like that will give you much more work in the future -- currently all prefix insns use primary opcode 1, sure, and nothing else does; but this can change. Segher