Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4533647ybb; Tue, 14 Apr 2020 09:07:04 -0700 (PDT) X-Google-Smtp-Source: APiQypIQ0jKhFEsf/2UzpzaL6jlUJ/dU3IjESBI1/VnDLY4Lnsk+ZoHgYYi40xht9cbYS8SENj2W X-Received: by 2002:a05:6402:14c1:: with SMTP id f1mr8880031edx.221.1586880424287; Tue, 14 Apr 2020 09:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586880424; cv=none; d=google.com; s=arc-20160816; b=PfVIlVjIHbeRYMC38uEMVvAru8OO8/fcQ6wKfKJ57UeRjn23bseKkWZYqpIoFdx6N6 pqKPHQeSVdjgZLy4l3Jpgp/rmCppliOiBPwxlfq8p07Z2klqIwVjxuCKAgi8d8ENbX9o jBMcknuVeEGGX3ibAnoTx9WQIz0NK1LOEsMlVkD/TVpVUwfiDVT/nnbfFf+IF0lxIgdn azORoKrmQ98CvRx2eIqt/kL1RrBF77Yu21fGAlrmSEsUqnnyfCbBMlgWIBaa0OW2foJk hElmutMwesww6kUVUj+PhLE03b0F4UcVf5vqKAZSEcO29BwT6CbreIVg71KMycFO+le/ m9Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=bTcSJ4CEM5FZZK0mZvNwbCxZtyIONlR6rWwt1itPdho=; b=KrjGjyo3ZKkThyEVXSoBQZTsCxlCdFLuqhSnLLzQvFuXIv5DBHefVGi5zk0V2L8sBZ 0xAkmBbcovmqkDqgQgKPSSIIj+1JAKeiOGBIkei/+6J+abmvKVmH4LWTU9UWsSGJ7454 8aPfl1ZMnE+uZ7UL/sKnE4uDQCTWqleUh9Uck92dVerxArGnKeqrmpwsc9QlsI7rneZR mtGm+CRkVg5uv6bErhv1GWGwxE5BsN+IykfMRdFDrU0o1Z4CfWPl2aZoQ5sWZpLABJI7 mYnP68hwBv3iEZ5ORF//MZL1K5pJPCcgSO3fsTOdYPiNfT8oy5uDvrVLg1c0HWtXb8Tn 3Fbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QJ/qXXVL"; spf=pass (google.com: best guess record for 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i26si3954709ejg.474.2020.04.14.09.06.39; Tue, 14 Apr 2020 09:07:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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=@redhat.com header.s=mimecast20190719 header.b="QJ/qXXVL"; spf=pass (google.com: best guess record for 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388786AbgDNOBg (ORCPT + 99 others); Tue, 14 Apr 2020 10:01:36 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:41714 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388719AbgDNOBZ (ORCPT ); Tue, 14 Apr 2020 10:01:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586872884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bTcSJ4CEM5FZZK0mZvNwbCxZtyIONlR6rWwt1itPdho=; b=QJ/qXXVL4Dyv3UPEaUNEfhYVO7bNHuwK8DBeNJtATmZFYpdC701ZIfnr2t/lKG5FmFzkf3 mdBlRQq2AZi8DDeJQIlcTfp3es3/l/1iQCfj1HD5v7sXJtPiBH/M5pX5sNO5Dz9KE/d/tx 1wWRfsgx2kna2AGEPaN5fBs5nBgx2zk= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-TDXbBOUvPMmAHTqgAOUFjQ-1; Tue, 14 Apr 2020 10:01:22 -0400 X-MC-Unique: TDXbBOUvPMmAHTqgAOUFjQ-1 Received: by mail-wr1-f69.google.com with SMTP id m5so5611370wru.15 for ; Tue, 14 Apr 2020 07:01:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bTcSJ4CEM5FZZK0mZvNwbCxZtyIONlR6rWwt1itPdho=; b=KjxjAK/cFWgtHiAB+o3F4Jl5bwNuq92Mnguqtyh2dkpVN3Lhm36uJPNtfxWIkKvZbZ ij6AIepQVEvbnVhiKV07W7QFpJLa7jVJPn0xxxaknjFSjLY2B/IfCIeXapof4Yauuk1R RT0OBAacAC3ZUmrT1jWgy8pZkkmMRQmfcYTgLDkJRxPyCn1L8UqYeXU2pbDWTUom7SRB 1sc/kxf8ajJzxCiqGIDNMoGfR0AiGmqxvNLT6tPTaJg2bqY1kek+KjlCf/G4yLEOh4ff 92l2/IRbptvJkUy+T5mXLkEBOiHJ9CRW/8X6dukJjPHTG2PD6tY0k4e431ITngB1b9Mp TgCQ== X-Gm-Message-State: AGi0PuaRN8wwaVP3/YBrfD8GRvv2E+uyeRibSAo8x9UeK2rASV9CSIsv zni047B73x5pgkbiyK8/7Y+4yQgbR6P/6VEaBFVc78L1sj1/FqL2ctwYorDIzhG2cflfKYbkzBF Rv0cCoFjn2ElaKcFx5oSlOIBc X-Received: by 2002:adf:8149:: with SMTP id 67mr24763150wrm.60.1586872881243; Tue, 14 Apr 2020 07:01:21 -0700 (PDT) X-Received: by 2002:adf:8149:: with SMTP id 67mr24763118wrm.60.1586872881003; Tue, 14 Apr 2020 07:01:21 -0700 (PDT) Received: from ?IPv6:2a01:cb14:58d:8400:ecf6:58e2:9c06:a308? ([2a01:cb14:58d:8400:ecf6:58e2:9c06:a308]) by smtp.gmail.com with ESMTPSA id b11sm19265200wrq.26.2020.04.14.07.01.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Apr 2020 07:01:20 -0700 (PDT) Subject: Re: [RFC][PATCH 03/36] objtool: Enable compilation of objtool for all architectures To: Steven Rostedt Cc: Matt Helsley , linux-kernel@vger.kernel.org, Josh Poimboeuf , Peter Zijlstra , Ingo Molnar , Miroslav Benes References: <20200414094121.73f5c82a@gandalf.local.home> From: Julien Thierry Message-ID: <59db4518-2450-e6a3-5a69-e65b86c39489@redhat.com> Date: Tue, 14 Apr 2020 15:01:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200414094121.73f5c82a@gandalf.local.home> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/14/20 2:41 PM, Steven Rostedt wrote: > On Tue, 14 Apr 2020 08:39:23 +0100 > Julien Thierry wrote: > >> My concern with this it that most of the structures and code in arch.h >> and check.c can/should be reused across architectures. So, when >> providing support for a new architecutre, the first thing that will be >> needed is to move those back under tools/objtool whithout disturbing the >> arches that don't yet provide support for "check" subcommand. > > Are all the enums and structs in arch.h non-arch specific? While some definitions are very x86 specific (in particular PUSH/POP related definition), most other other things have similar concept in other architectures. And the "non-generic" definition here do not necessarily interfere with other architectures. E.g. if the instruction decoder never produces INSN_PUSH or INSN_POP, the corresponding branches in the validation code will simply not be taken. > > Or would they need to be split? > So far, for the arm64 work, I've left all those definitions where they are. In the future, some cleanup could encourage to split for some "arch specific" and "non-arch specific" instruction/stack-ops types, but this is not a hard requirement for introducing new architechtures. And I'd rather encourage to have complex arch specific instructions be divided into several simpler instructions (e.g. PUSH is just sub stack pointer + memory access) that could be reused for other architectures, as long as that is possible of course. >> >> So, if it is decided that recordmcount should be an objtool subcommand, >> the code itself should probably stay under tools/objtool and then have >> different compilation configurations for objtool depending on the >> architecture (e.g. HAVE_OBJTOOL_CHECK, HAVE_OBJTOOL_ORC) or something of >> the sort. > > That could work. > > -- Steve > -- Julien Thierry