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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 64D20C02194 for ; Fri, 7 Feb 2025 14:15:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tgP7r-0005Oi-QY; Fri, 07 Feb 2025 09:14:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tgP7o-0005OV-Sd; Fri, 07 Feb 2025 09:14:32 -0500 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tgP7j-0002UZ-EF; Fri, 07 Feb 2025 09:14:32 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BCB955C6197; Fri, 7 Feb 2025 14:13:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 257FEC4CED1; Fri, 7 Feb 2025 14:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738937655; bh=9Q6k4uezwb7VUfhzCeqFc7EI03BM8d56WV2+2oon0wI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IMF89quzHiFrKbQeJHgRxksbqXc9XkoxNrvT4Vj7bLc+hgfn5RNEvgTCJqnnTR1YS kAko3RZPqpqae8Bv6Ihm0sLPDl0jWbiT8mdSKu3S+t/bpssPkv9PT/1kS0XbAVTAEK pLnQSly3b6TW08GNd1+fUeoTvNEAR50ADA2berl9oD5yWrmKdUYKiGEXN33ZYuv+Dw fuMwofG15M746zvxM0xZ25aNR6P9SIPjE4WbzzzE0f9WiSLPw+qlaTWOY+HC5j8Gim K7KwJIFrWBPMjnYrrPzZXHR7UrL5aLDMLulGiPIBwzIbxEDLxZtBWXe274foZSy5N5 RknoWtjXrRSEA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tgP7U-001eJU-VB; Fri, 07 Feb 2025 14:14:13 +0000 Date: Fri, 07 Feb 2025 14:14:12 +0000 Message-ID: <86ikplu9jf.wl-maz@kernel.org> From: Marc Zyngier To: Cornelia Huck Cc: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvmarm@lists.linux.dev, peter.maydell@linaro.org, richard.henderson@linaro.org, alex.bennee@linaro.org, oliver.upton@linux.dev, sebott@redhat.com, shameerali.kolothum.thodi@huawei.com, armbru@redhat.com, berrange@redhat.com, abologna@redhat.com, jdenemar@redhat.com, shahuang@redhat.com, mark.rutland@arm.com, philmd@linaro.org, pbonzini@redhat.com Subject: Re: [PATCH 14/15] arm/cpu: Add sysreg generation scripts In-Reply-To: <20250207110248.1580465-15-cohuck@redhat.com> References: <20250207110248.1580465-1-cohuck@redhat.com> <20250207110248.1580465-15-cohuck@redhat.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: cohuck@redhat.com, eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, kvmarm@lists.linux.dev, peter.maydell@linaro.org, richard.henderson@linaro.org, alex.bennee@linaro.org, oliver.upton@linux.dev, sebott@redhat.com, shameerali.kolothum.thodi@huawei.com, armbru@redhat.com, berrange@redhat.com, abologna@redhat.com, jdenemar@redhat.com, shahuang@redhat.com, mark.rutland@arm.com, philmd@linaro.org, pbonzini@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=maz@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Fri, 07 Feb 2025 11:02:47 +0000, Cornelia Huck wrote: > > From: Eric Auger > > Introduce scripts that automate the generation of system register > definitions from a given linux source tree arch/arm64/tools/sysreg. > > Invocation of > ./update-aarch64-sysreg-code.sh $PATH_TO_LINUX_SOURCE_TREE > in scripts directory do generate 2 qemu files: > - target/arm/cpu-sysreg-properties.c > - target/arm/cpu-sysregs.h.inc > > cpu-sysregs.h.inc creates defines for all system registers. > However cpu-sysreg-properties.c only cares about feature ID registers. > > update-aarch64-sysreg-code.sh calls two awk scripts. > gen-cpu-sysreg-properties.awk is inherited from kernel > arch/arm64/tools/gen-sysreg.awk. All credits to Mark Rutland > the original author of this script. > > [CH: update to handle current kernel sysregs structure, and to emit > the re-worked register structures] > Signed-off-by: Eric Auger > Signed-off-by: Cornelia Huck > --- > scripts/gen-cpu-sysreg-properties.awk | 325 ++++++++++++++++++++++++++ > scripts/gen-cpu-sysregs-header.awk | 70 ++++++ > scripts/update-aarch64-sysreg-code.sh | 30 +++ > 3 files changed, 425 insertions(+) > create mode 100755 scripts/gen-cpu-sysreg-properties.awk > create mode 100755 scripts/gen-cpu-sysregs-header.awk > create mode 100755 scripts/update-aarch64-sysreg-code.sh Shameless plug: https://lore.kernel.org/r/20250102144339.1564778-1-maz@kernel.org You could use (something like) this to generate the sysreg file itself from the architecture data, or another representation as required. M. -- Without deviation from the norm, progress is not possible.