From: Marc Zyngier <maz@kernel.org>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
Steffen Eiden <seiden@linux.ibm.com>,
Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Oliver Upton <oupton@kernel.org>,
Zenghui Yu <yuzenghui@huawei.com>,
Yuchao Zhang <ndaugoing@gmail.com>, Fuad Tabba <tabba@google.com>
Subject: Re: [PATCH v1 2/2] KVM: arm64: selftests: Add an ITS MOVALL test
Date: Wed, 30 Sep 2026 13:21:51 +0100 [thread overview]
Message-ID: <861pab3p5s.wl-maz@kernel.org> (raw)
In-Reply-To: <e6bf4bc51a311df19866a0ee3e27970846257b70.1790708299.git.fuad.tabba@linux.dev>
On Tue, 29 Sep 2026 20:04:52 +0100,
Fuad Tabba <fuad.tabba@linux.dev> wrote:
>
> Map LPI A to vCPU0's collection and LPI B to vCPU1's, remap vCPU0's
> collection to vCPU2 and MOVALL vCPU0's LPIs there, then inject both. A
> must be taken on vCPU2 and B on vCPU1. KVM's MAPC handling already moves
> A to vCPU2, so only MOVALL handling can move B: without "KVM: arm64:
> vgic-its: Fix MOVALL handling of source redistributor", it moves B to
> vCPU2 as well.
MOVALL is about moving the pending bits (see 5.3.13 in the IHI0069H.b
spec). Doing MOVALL first and only then injecting the interrupts
doesn't quite check the MOVALL requirement. That doesn't impact KVM
itself (we don't use pending tables at all), but you probably don't
want to hardcode implementation specific behaviours here.
>
> Assisted-by: LLM
> Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
> ---
> tools/testing/selftests/kvm/Makefile.kvm | 1 +
> .../selftests/kvm/arm64/vgic_its_movall.c | 341 ++++++++++++++++++
> 2 files changed, 342 insertions(+)
> create mode 100644 tools/testing/selftests/kvm/arm64/vgic_its_movall.c
>
> diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
> index 908bdc7cf4f58..fb0bc99242975 100644
> --- a/tools/testing/selftests/kvm/Makefile.kvm
> +++ b/tools/testing/selftests/kvm/Makefile.kvm
> @@ -190,6 +190,7 @@ TEST_GEN_PROGS_arm64 += arm64/stage2_block_transitions
> TEST_GEN_PROGS_arm64 += arm64/vcpu_width_config
> TEST_GEN_PROGS_arm64 += arm64/vgic_init
> TEST_GEN_PROGS_arm64 += arm64/vgic_irq
> +TEST_GEN_PROGS_arm64 += arm64/vgic_its_movall
> TEST_GEN_PROGS_arm64 += arm64/vgic_its_save
> TEST_GEN_PROGS_arm64 += arm64/vgic_lpi_stress
> TEST_GEN_PROGS_arm64 += arm64/vgic_v5
> diff --git a/tools/testing/selftests/kvm/arm64/vgic_its_movall.c b/tools/testing/selftests/kvm/arm64/vgic_its_movall.c
> new file mode 100644
> index 0000000000000..41918576bdf63
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/arm64/vgic_its_movall.c
> @@ -0,0 +1,341 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * vgic_its_movall - MOVALL does not move the LPIs of other redistributors.
> + *
> + * Two LPIs, A and B, target two different redistributors. A's collection is
> + * remapped to a third redistributor with MAPC, followed by MOVALL from the
> + * first redistributor to the third. Both LPIs are then injected. A must be
> + * taken on the third redistributor, and B must stay on its own, which is not
> + * MOVALL's source.
> + *
> + * Copyright (c) 2026 Google LLC
> + * Author: Fuad Tabba <fuad.tabba@linux.dev>
> + */
> +
> +#include <linux/sizes.h>
> +#include <pthread.h>
> +#include <stdatomic.h>
> +
> +#include "kvm_util.h"
> +#include "gic.h"
> +#include "gic_v3.h"
> +#include "gic_v3_its.h"
> +#include "processor.h"
> +#include "ucall.h"
> +#include "vgic.h"
> +
> +#define TEST_MEMSLOT_INDEX 1
> +
> +#define GIC_LPI_OFFSET 8192
> +#define NR_VCPUS 3
> +#define NR_LPIS 2
> +#define DEVICE_ID 0
> +
> +/* LPI A (event 0) starts on vCPU0 and moves to vCPU2; B (event 1) stays on vCPU1 */
> +#define LPI_A_COLL 0
> +#define LPI_B_COLL 1
> +#define MOVALL_FROM 0
> +#define MOVALL_TO 2
> +#define LPI_B_VCPU 1
> +
> +#define LPI_PROP_DEFAULT_PRIO 0xa0
> +
> +static gpa_t gpa_base;
> +
> +static struct kvm_vm *vm;
> +static struct kvm_vcpu *vcpus[NR_VCPUS];
> +static int its_fd;
> +
> +static struct test_data {
> + bool request_vcpus_stop;
> +
> + gpa_t device_table;
> + gpa_t collection_table;
> + gpa_t cmdq_base;
> + void *cmdq_base_va;
> + gpa_t itt_table;
> +
> + gpa_t lpi_prop_table;
> + gpa_t lpi_pend_tables;
> +} test_data;
There seem to be a lot of commonality with the existing
vgic_lpi_stress test. I'd rather we make this test the container for
most ITS-related tests, instead of coming up with new individual
tests.
Thanks,
N,
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2026-09-30 12:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 9:35 [PATCH v2 0/7] KVM: arm64: vgic-v3: Make LPI disabling robust (and more) Marc Zyngier
2026-09-29 9:35 ` [PATCH v2 1/7] KVM: arm64: Move OUTSIDE_GUEST_MODE publication past context being saved Marc Zyngier
2026-09-29 12:59 ` Fuad Tabba
2026-09-29 14:13 ` Marc Zyngier
2026-09-29 14:46 ` Fuad Tabba
2026-10-02 13:07 ` Will Deacon
2026-09-29 9:35 ` [PATCH v2 2/7] KVM: arm64: Turn vcpu->arch.pause into a counter Marc Zyngier
2026-09-29 13:22 ` Fuad Tabba
2026-09-29 9:35 ` [PATCH v2 3/7] KVM: arm64: vgic: Allow last_lr_irq to be NULL when LRs are not overflowing Marc Zyngier
2026-09-29 9:35 ` [PATCH v2 4/7] KVM: arm64: vgic: Take a refcount on IRQs referenced by last_lr_irq Marc Zyngier
2026-09-29 9:35 ` [PATCH v2 5/7] KVM: arm64: vgic: Stop the VM when disabling LPIs Marc Zyngier
2026-09-29 9:35 ` [PATCH v2 6/7] KVM: arm64: vgic-its: Fix MOVALL handling of source redistributor Marc Zyngier
2026-09-29 18:14 ` Fuad Tabba
2026-09-29 9:35 ` [PATCH v2 7/7] KVM: arm64: vgic-its: Stop the VM when handling MOVALL Marc Zyngier
2026-09-29 18:45 ` Fuad Tabba
2026-09-29 19:04 ` [PATCH v1 0/2] KVM: arm64: selftests: Cover the ITS MOVALL command Fuad Tabba
2026-09-29 19:04 ` [PATCH v1 1/2] KVM: arm64: selftests: Add a MOVALL command to the ITS library Fuad Tabba
2026-09-29 19:04 ` [PATCH v1 2/2] KVM: arm64: selftests: Add an ITS MOVALL test Fuad Tabba
2026-09-30 12:21 ` Marc Zyngier [this message]
2026-09-30 12:34 ` Fuad Tabba
2026-09-29 19:32 ` (subset) [PATCH v2 0/7] KVM: arm64: vgic-v3: Make LPI disabling robust (and more) Oliver Upton
2026-10-08 18:15 ` Fuad Tabba
2026-10-08 20:28 ` Oliver Upton
2026-10-09 6:45 ` Fuad Tabba
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=861pab3p5s.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=ndaugoing@gmail.com \
--cc=oupton@kernel.org \
--cc=seiden@linux.ibm.com \
--cc=suzuki.poulose@arm.com \
--cc=tabba@google.com \
--cc=yuzenghui@huawei.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