All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	Mark Rutland <mark.rutland@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>
Subject: Re: [PATCH v2] arm64: Add basic JSON register parser
Date: Mon, 06 Jan 2025 16:30:18 +0000	[thread overview]
Message-ID: <8634hvq50l.wl-maz@kernel.org> (raw)
In-Reply-To: <63543c41-607e-45cd-9266-a60838ff233e@sirena.org.uk>

On Mon, 06 Jan 2025 15:19:55 +0000,
Mark Brown <broonie@kernel.org> wrote:
> 
> [1  <text/plain; us-ascii (quoted-printable)>]
> On Thu, Jan 02, 2025 at 02:43:39PM +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.
> 
> ...
> 
> > I completely expect this to quickly rewritten by people who know
> > what they are doing (I don't) and improved as we understand more
> > of the data model.
> 
> Thanks for jumping on this so quickly.

Things you do when you're drunk...

> Reviewed-by: Mark Brown <broonie@kernel.org>
> 
> to the extent I understand jq, and it seems to be doing sensible things
> for the registers I've tried it with.  This is going to be useful for
> getting started and it's helpful to see the feature dependencies.  Like
> you suggest it's a good basis for further development, even if we also
> get some other tools that won't stop this being useful.
> 
> What I was thinking with this stuff was to use something like Python and
> parse the files into data structures in memory before outputting them,

The moment you use a general purpose language, you end-up reinventing
JSON in another way, and I didn't have the courage to do that. Also,
jq feels like an exotic mix of functional programming and Forth,
something toxic enough to be irresistible.

> then we can hopefully use that for things like diffing two architecture
> versions while handling cases where we've intentionally diverged from
> how the architecture describes things. It'd be nice to have something
> that'd go through and check for updates to registers we already have
> mapped and provide an updated sysreg file.  It might however just be
> easier to use something like this and then work with sysreg files using
> text processing tools.

My current plan is somehow different: extract all the trapping
information for each register handled by KVM, and *automatically*
generate tests that check that KVM is doing the right thing. Or rather
convince someone to do that.

Then get rid of all such manually implemented tests from the kernel,
once and for all.

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2025-01-06 16:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02 14:43 [PATCH v2] arm64: Add basic JSON register parser Marc Zyngier
2025-01-06 15:19 ` Mark Brown
2025-01-06 16:30   ` Marc Zyngier [this message]
2025-01-06 18:06     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8634hvq50l.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.