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 F137FE7718F for ; Fri, 27 Dec 2024 17:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Taxkd1fzYnCoq6iB+7ASSYph4vaDdSZYJa18jegXyUQ=; b=c7cmR+EYxXZSm7HRuqv8zQNOxB HR0T2vpAU6nUKaXf2qcuxOMU4Zi2+VAVSe5cY4wk4bpkgQcGKewf6lB1hscHFFs1SzejnKqwUgoHd 4/+2PIuBG1UuVUdyIemK4Bo9usNG6n0/FUgQk0FwZ6cUuNvNKyduUZ4osGoKYJBNm2/N0bsaGQPnB CC0qjuKRWgfxFwrifFLrU2njdBubJ265YKEJTtEj/1k7EjEuS1j7qHCtOCjjGl7KZWdJMdxcZvQMe OmOdiEA/zn61906D3Ve0Sl7rsbfqjrZhhoVjaCVzyY8X8AYpMtFm+UQvVvYOyLzQPf/w4oSr+sNju 0dVwazaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRESE-00000000kaS-0VLN; Fri, 27 Dec 2024 17:48:54 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRER3-00000000kW5-0wCG for linux-arm-kernel@lists.infradead.org; Fri, 27 Dec 2024 17:47:42 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 17F765C59C8; Fri, 27 Dec 2024 17:46:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FE7EC4CED0; Fri, 27 Dec 2024 17:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735321660; bh=5ybEnyvzb1jTkiqCHqAb4mfATDyONGwSfj6K7gcz2G0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=S5ckq9ZJbaAQ+L3YSdtyVi49YcRv7EneyjkA5f1o39kQgevZCZ7BSni6MGbAplKOB sem9kV1kv15Srt1KF0IJnXLbMlSglbHj2TpdSYwlfjd147xclFspz1mve9h28hVdCO mD7so8BjfiY+59zy+69dan46Syfj4RuJ3y86M+CBJHRkaDTp4yWiHcc+HYPMpoalUW L/5QF5gcI9haNQDZyCl/sWFrKzFvlA5tlrEJqD+w29+pdNNM2AUwgvholWKaxVWqNI 09CQshmL1AgOvNZkCyGe7qh8O5M1F8qGqO8a1qKoK1n70x7lERnGrJIyqxcurHiSjR 2uff9X/t7MDsQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.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 1tRER0-007GkL-21; Fri, 27 Dec 2024 17:47:38 +0000 Date: Fri, 27 Dec 2024 17:47:37 +0000 Message-ID: <878qs1ow5i.wl-maz@kernel.org> From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Cc: Mark Rutland , Catalin Marinas , Will Deacon , Mark Brown Subject: Re: [PATCH] arm64: Add basic JSON register parser In-Reply-To: <20241225185711.582648-1-maz@kernel.org> References: <20241225185711.582648-1-maz@kernel.org> 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 (x86_64-pc-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: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, catalin.marinas@arm.com, will@kernel.org, broonie@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_094741_313921_CA902111 X-CRM114-Status: GOOD ( 18.77 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 25 Dec 2024 18:57:11 +0000, Marc Zyngier wrote: > > We currently populate the sysreg file by hand from the ARM ARM, > resulting in a bunch of errors being introduced on a regular basis. > While there is an XML dump of the architecture produced on a quarterly > basis, the license that comes attached to it excludes any sort of > open-source usage. > > However, ARM has recently made available a JSON dump[1] that contains > a reduced set of information under a BSD license. This has enough > data to extract what is relevant to the sysreg file. > > This is achieved using a JQ script that I cobbled together over > the holiday, and while it has a number of limitations, it already > works well enough to extract useful data. > > As an example, here's what the script returns for TCR_EL1: > > $ jq -r --arg REG TCR_EL1 -f arch/arm64/tools/dumpreg.jq ~/Work/XML/2024-12/AARCHMRS_BSD_A_profile/Registers.json > TCR_EL1 [3,0,0,2,2] MRS > TCR_EL1 [3,0,0,2,2] MSRregister > TCR_EL12 [3,5,0,2,2] MRS > TCR_EL12 [3,5,0,2,2] MSRregister > TCRALIAS_EL1 [3,0,7,2,6] MRS > TCRALIAS_EL1 [3,0,7,2,6] MSRregister The eagle-eyed reviewers will have certainly noticed that the encodings have a couple of fields swapped. I've since fixed this locally, together with a bunch of other issues. I'll post v2 in the new year. For those interested in the current of affairs, I've pushed out a branch at [1]. M. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=arm64/dumpreg. -- Without deviation from the norm, progress is not possible.