From: Maximilian Dittgen <mdittgen@amazon.de>
To: <maz@kernel.org>
Cc: <epetron@amazon.de>, <kvm@vger.kernel.org>,
<kvmarm@lists.linux.dev>, <linux-arm-kernel@lists.infradead.org>,
<linux-kselftest@vger.kernel.org>, <mdittgen@amazon.com>,
<mdittgen@amazon.de>, <nh-open-source@amazon.com>,
<oliver.upton@linux.dev>, <pbonzini@redhat.com>,
<shuah@kernel.org>
Subject: Re: [PATCH] KVM: selftests: fix ITS collection target addresses in vgic_lpi_stress
Date: Mon, 20 Oct 2025 14:12:20 +0200 [thread overview]
Message-ID: <20251020121220.83972-1-mdittgen@amazon.de> (raw)
In-Reply-To: <86v7kdwj8u.wl-maz@kernel.org>
On Fri, 17 Oct 2025 19:06:25 +0200,
Marc Zyngier <maz@kernel.org> wrote:
>
> * We use linear CPU numbers for redistributor addressing,
> * so GITS_TYPER.PTA is 0.
>
> It is not an address.
The issue is that its_encode_target in selftests is designed for
physical redistriubtor addresses (GITS_TYPER.PTA = 1) and thus
performs a right shift by 16 bits:
its_mask_encode(&cmd->raw_cmd[2], target_addr >> 16, 51, 16);
When the vgic_lpi_stress selftest passes in a linear vCPU id as
the redistributor address (GITS_TYPER.PTA = 0 behavior),
The its_encode_target function shifts the CPU numbers 16 bits right,
functionally zeroing them.
We need to either:
- Align this specific selftest with GITS_TYPER.PTA = 0 and not use
its_encode_target to encode the target vCPU id. Instead have a
dedicated encode function for the use case without a bit shift.
- Align all selftests with GITS_TYPER.PTA = 0 and refactor
its_encode_target to skip the bit shift altogether.
- Align selftests with GITS_TYPER.PTA = 1 and pass a redistributor
address, not a vCPU id, into its_send_mapc_cmd().
Otherwise, the selftest's current behavior incorrectly maps all
collections to target vCPU 0.
Thanks,
Maximilian
Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
next prev parent reply other threads:[~2025-10-20 12:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 16:19 [PATCH] KVM: selftests: fix ITS collection target addresses in vgic_lpi_stress Maximilian Dittgen
2025-10-17 17:06 ` Marc Zyngier
2025-10-20 12:12 ` Maximilian Dittgen [this message]
2025-10-20 13:01 ` Marc Zyngier
2025-10-20 15:13 ` Maximilian Dittgen
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=20251020121220.83972-1-mdittgen@amazon.de \
--to=mdittgen@amazon.de \
--cc=epetron@amazon.de \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maz@kernel.org \
--cc=mdittgen@amazon.com \
--cc=nh-open-source@amazon.com \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=shuah@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox