public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Andrew Jones <andrew.jones@linux.dev>
To: Mark Brown <broonie@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>,
	Oliver Upton <oliver.upton@linux.dev>,
	 James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	 Paolo Bonzini <pbonzini@redhat.com>,
	Shuah Khan <shuah@kernel.org>,
	 Catalin Marinas <catalin.marinas@arm.com>,
	Joey Gouly <joey.gouly@arm.com>,
	 linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	kvm@vger.kernel.org,  linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] KVM: selftests: arm64: Use generated defines for named system registers
Date: Tue, 6 Aug 2024 10:03:20 +0200	[thread overview]
Message-ID: <20240806-7d137744fa04e05689efac71@orel> (raw)
In-Reply-To: <20240802-kvm-arm64-get-reg-list-v1-2-3a5bf8f80765@kernel.org>

On Fri, Aug 02, 2024 at 10:57:54PM GMT, Mark Brown wrote:
> Currently the get-reg-list test uses directly specified numeric values to
> define system registers to validate. Since we already have a macro which
> allows us to use the generated system register definitions from the main
> kernel easily let's update all the registers where we have specified the
> name in a comment to just use that macro. This reduces the number of
> places where we need to validate the name to number mapping.
> 
> This conversion was done with the sed command:
> 
>   sed -i -E 's-ARM64_SYS_REG.*/\* (.*) \*/-KVM_ARM64_SYS_REG(SYS_\1),-' tools/testing/selftests/kvm/aarch64/get-reg-list.c
> 
> We still have a number of numerically specified registers, some of these
> are reserved registers without defined names (eg, unallocated ID registers)
> and others don't have kernel macro definitions yet.

FWIW, the "ARM64_SYS_REG(...encoding...), /* NAME */" format was
intentional. The idea was that when get-reg-list outputs new or missing
registers it discovers, or the user lists registers with --list, the best
it can do is output "ARM64_SYS_REG(...encoding...)". Putting that format
directly into the test enabled copy+paste of the list output into a test
case. However, the lack of names did lead to scripting the generation of
the name comments, which means it wasn't a direct copy+paste anyway. The
other benefit of the format was being able to directly grep the test for
the 'missing' registers. Anyway, maybe always going through asm/sysreg.h
with greps of '...encoding...' is the better approach.

Thanks,
drew


      parent reply	other threads:[~2024-08-06  8:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 21:57 [PATCH 0/2] KVM: selftests: arm64: Make use of sysreg defintions in get-reg-list Mark Brown
2024-08-02 21:57 ` [PATCH 1/2] KVM: selftests: arm64: Simplify specification of filtered registers Mark Brown
2024-08-04 11:24   ` Marc Zyngier
2024-08-02 21:57 ` [PATCH 2/2] KVM: selftests: arm64: Use generated defines for named system registers Mark Brown
2024-08-03  9:35   ` Marc Zyngier
2024-08-05 16:16     ` Mark Brown
2024-08-06  8:03   ` Andrew Jones [this message]

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=20240806-7d137744fa04e05689efac71@orel \
    --to=andrew.jones@linux.dev \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=shuah@kernel.org \
    --cc=suzuki.poulose@arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox