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 X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53100C433E0 for ; Wed, 3 Feb 2021 17:32:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED18B64E40 for ; Wed, 3 Feb 2021 17:32:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED18B64E40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZYN5zjPzAmm6/tvY8l6I54mBZIfEsVM3wA7eGG+GjNw=; b=dYSNcOzL8XatqRyXR6lW4HfHx RPgzUqyDkFaWsyKBrQlMQnFf+Hu8XpuBFODE2Ed0pgirvSgRh94gFpeVwnAGKS1DhD2WIvRD9IzMV mzuS5YkMDBgXISp2fCiOMX0hhAzDCBnIYsoerPuHxIiUL+qP2K9vp4heVvcj6sJwKJEC7ixGLBME5 3NFzhLYsXNyJCzMQwRppk1HVQQaYgtDYw9/1I6WwvIsPJv7b2jbsGfsV/UbLGnDrd+jaDE9rHRbKH gyr3PXUua3vMq/BFmX19YRaT1F7SpxOAIK+98SGUAh5CmC9WhXBd/2LaA/cFgYzMudVBjQgOiSNZL h8CDo5jwA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7Lze-0000zF-1T; Wed, 03 Feb 2021 17:31:06 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7Lzb-0000yG-H1 for linux-arm-kernel@lists.infradead.org; Wed, 03 Feb 2021 17:31:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373461; 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=2f47O+xthY5btHVP656wCtRgwd+ND0mPdvSru9EXT8I=; b=HeIJ5u3PeeG/WqH09gFowmWstYDOKr6XWVPOhQ3GGKjWjvJtogJT44EdVOW7mVzUkpjj8F ySZH3w0YAsivPuC6v1Fv8x25ydrALc2riXtXQyIU7zUlpe90ZnABth9JvNTkhcMqPfLdSF UFjfw1L8gX4lh/Y0HVyYtP09nC59Vd0= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-49-31LXh_JKORWI620qTeJIMQ-1; Wed, 03 Feb 2021 12:30:59 -0500 X-MC-Unique: 31LXh_JKORWI620qTeJIMQ-1 Received: by mail-wm1-f69.google.com with SMTP id j204so104278wmj.4 for ; Wed, 03 Feb 2021 09:30:59 -0800 (PST) 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=2f47O+xthY5btHVP656wCtRgwd+ND0mPdvSru9EXT8I=; b=QDrUoNMGAw6wNl+AFdaHCe/T2njB6Y5Rqr0szcG9sM1EXhHMkQTpC7dPy2iMqjz2o7 YRIBLTD3PTOESxk0kwbvD0GWNzHe9yiugViJdc20XixdofK/NoO7b7PDmrNhRp9uvkyO CvJcKbGomzh0+m9ytsriMXB+urdVeKIwyTRR71WF8A3462rOC32cBAB2PoK1vfRQkP+k fC5HnVn85GiPk8kuSOhow0+kkwuOZ+iF2Z9i/+X+NnJgmnrLi2lG7FQCSH4oE1lz7nU/ 6nwW0D14Zzuaw5AdBRfhRmx6imQEUC60Zm76iNR5TIx7NLuUTZcehahpNV+M24lrWGTH YahQ== X-Gm-Message-State: AOAM532KLbn7tLN+YMxRsSUBuGQCgkM754ama2m2Q96dmLeaAsAqy4/U 5n+X9GgIkMKnPVBrKszHe5HiAgbDNXBh2d+VrjVXUkui72qbVUR05ho1wSOQ6t4+ysA/G0JQEbM b8CdDU1YDCpXse2c68WOJVjHTgY1rQCVqWR8= X-Received: by 2002:a5d:4d8d:: with SMTP id b13mr4594931wru.178.1612373458597; Wed, 03 Feb 2021 09:30:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhw9U9nnZ8kINGuWmHahAnAIa4/7Q5FJWf34LwunkpylIlpm0/I/LgNC/qZwHvuydMLz4RYg== X-Received: by 2002:a5d:4d8d:: with SMTP id b13mr4594904wru.178.1612373458321; Wed, 03 Feb 2021 09:30:58 -0800 (PST) Received: from ?IPv6:2a01:cb14:499:3d00:cd47:f651:9d80:157a? ([2a01:cb14:499:3d00:cd47:f651:9d80:157a]) by smtp.gmail.com with ESMTPSA id r17sm4577139wro.46.2021.02.03.09.30.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Feb 2021 09:30:57 -0800 (PST) Subject: Re: [RFC PATCH 1/5] arm64: Move instruction encoder/decoder under lib/ To: Mark Rutland References: <20210120171745.1657762-1-jthierry@redhat.com> <20210120171745.1657762-2-jthierry@redhat.com> <20210202101755.GB59049@C02TD0UTHF1T.local> <9c01f293-2c98-43e6-a497-89610fe5970e@redhat.com> <20210203111240.GB55896@C02TD0UTHF1T.local> From: Julien Thierry Message-ID: <75b53229-f518-09f1-2449-ecac2352663c@redhat.com> Date: Wed, 3 Feb 2021 18:30:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20210203111240.GB55896@C02TD0UTHF1T.local> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jthierry@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210203_123103_674155_C87B684E X-CRM114-Status: GOOD ( 24.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, broonie@kernel.org, will@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/3/21 12:12 PM, Mark Rutland wrote: > On Wed, Feb 03, 2021 at 09:26:45AM +0100, Julien Thierry wrote: >> On 2/2/21 11:17 AM, Mark Rutland wrote: >>> On Wed, Jan 20, 2021 at 06:17:41PM +0100, Julien Thierry wrote: >>>> Aarch64 instruction set encoding and decoding logic can prove useful >>>> for some features/tools both part of the kernel and outside the kernel. >>>> >>>> Isolate the function dealing only with encoding/decoding instructions, >>>> with minimal dependency on kernel utilities in order to be able to reuse >>>> that code. >>>> >>>> Code was only moved, no code should have been added, removed nor >>>> modifier. >>>> >>>> Signed-off-by: Julien Thierry >>> >>> This looks sound, but the diff is a little hard to check. >> >> Yes, I was expecting this change to be hard to digest. >> >>> Would it be possible to split this into two patches, where: >>> >>> 1) Refactoring definitions into insn.h and insn.c, leaving those files >>> in their current locations. >> >> I'm not quite sure I understand the suggestions. After this patch insn.h and >> insn.c still contain some definitions that can't really be used outside of >> kernel code which is why I split them into insn.* and aarch64-insn.* (the >> latter containing what could be used by tools). > > Sorry; I hadn't appreciated what was getting left behind. With the > series applied I see that's some kernel patching logic, and AArch32 insn > bits. > > How about we invert the move, and split those bits out of insn.c first, > then move the rest in one go, i.e. > > 1) Factor the patching bits out into new patching.{c,h} files. > > 2) Move insn.c to arch/arm64/lib/ > > 3) Split insn.* into aarch64-insn.* and aarch32-insn.* > > ... if that makes any sense? > > We might not even need to split the aarch32 bits out given they all have > an aarch32_* prefix. > Yes, that approach sounds good. I'll if the aarchxx-insn is necessary but as you say, all in the same file shouldn't cause trouble. Thanks, -- Julien Thierry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel