* [PATCH] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest
@ 2025-10-12 15:43 Zenghui Yu
2025-10-13 12:20 ` Ben Horgan
2025-10-13 16:56 ` Marc Zyngier
0 siblings, 2 replies; 5+ messages in thread
From: Zenghui Yu @ 2025-10-12 15:43 UTC (permalink / raw)
To: kvmarm, linux-arm-kernel
Cc: maz, oliver.upton, joey.gouly, suzuki.poulose, Zenghui Yu
We forgot to sync several registers (ID_AA64PFR1, MPIDR, CLIDR) in guest to
make sure that the guest had seen the written value.
Add them to the list.
Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev>
---
tools/testing/selftests/kvm/arm64/set_id_regs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/kvm/arm64/set_id_regs.c b/tools/testing/selftests/kvm/arm64/set_id_regs.c
index 8ff1e853f7f8..5e24f77868b5 100644
--- a/tools/testing/selftests/kvm/arm64/set_id_regs.c
+++ b/tools/testing/selftests/kvm/arm64/set_id_regs.c
@@ -249,11 +249,14 @@ static void guest_code(void)
GUEST_REG_SYNC(SYS_ID_AA64ISAR2_EL1);
GUEST_REG_SYNC(SYS_ID_AA64ISAR3_EL1);
GUEST_REG_SYNC(SYS_ID_AA64PFR0_EL1);
+ GUEST_REG_SYNC(SYS_ID_AA64PFR1_EL1);
GUEST_REG_SYNC(SYS_ID_AA64MMFR0_EL1);
GUEST_REG_SYNC(SYS_ID_AA64MMFR1_EL1);
GUEST_REG_SYNC(SYS_ID_AA64MMFR2_EL1);
GUEST_REG_SYNC(SYS_ID_AA64MMFR3_EL1);
GUEST_REG_SYNC(SYS_ID_AA64ZFR0_EL1);
+ GUEST_REG_SYNC(SYS_MPIDR_EL1);
+ GUEST_REG_SYNC(SYS_CLIDR_EL1);
GUEST_REG_SYNC(SYS_CTR_EL0);
GUEST_REG_SYNC(SYS_MIDR_EL1);
GUEST_REG_SYNC(SYS_REVIDR_EL1);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest
2025-10-12 15:43 [PATCH] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest Zenghui Yu
@ 2025-10-13 12:20 ` Ben Horgan
2025-10-13 16:14 ` Ben Horgan
2025-10-13 16:56 ` Marc Zyngier
1 sibling, 1 reply; 5+ messages in thread
From: Ben Horgan @ 2025-10-13 12:20 UTC (permalink / raw)
To: Zenghui Yu, kvmarm, linux-arm-kernel
Cc: maz, oliver.upton, joey.gouly, suzuki.poulose
Hi Zenghui,
On 10/12/25 16:43, Zenghui Yu wrote:
> We forgot to sync several registers (ID_AA64PFR1, MPIDR, CLIDR) in guest to
> make sure that the guest had seen the written value.
>
> Add them to the list.
>
> Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev>
> ---
> tools/testing/selftests/kvm/arm64/set_id_regs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/arm64/set_id_regs.c b/tools/testing/selftests/kvm/arm64/set_id_regs.c
> index 8ff1e853f7f8..5e24f77868b5 100644
> --- a/tools/testing/selftests/kvm/arm64/set_id_regs.c
> +++ b/tools/testing/selftests/kvm/arm64/set_id_regs.c
> @@ -249,11 +249,14 @@ static void guest_code(void)
> GUEST_REG_SYNC(SYS_ID_AA64ISAR2_EL1);
> GUEST_REG_SYNC(SYS_ID_AA64ISAR3_EL1);
> GUEST_REG_SYNC(SYS_ID_AA64PFR0_EL1);
> + GUEST_REG_SYNC(SYS_ID_AA64PFR1_EL1);
> GUEST_REG_SYNC(SYS_ID_AA64MMFR0_EL1);
> GUEST_REG_SYNC(SYS_ID_AA64MMFR1_EL1);
> GUEST_REG_SYNC(SYS_ID_AA64MMFR2_EL1);
> GUEST_REG_SYNC(SYS_ID_AA64MMFR3_EL1);
> GUEST_REG_SYNC(SYS_ID_AA64ZFR0_EL1);
> + GUEST_REG_SYNC(SYS_MPIDR_EL1);
> + GUEST_REG_SYNC(SYS_CLIDR_EL1);
Why did you choose this position in the list for these 2?
> GUEST_REG_SYNC(SYS_CTR_EL0);
> GUEST_REG_SYNC(SYS_MIDR_EL1);
> GUEST_REG_SYNC(SYS_REVIDR_EL1);
Looks good to me.
Reviewed-By: Ben Horgan <ben.horgan@arm.com>
Thanks,
Ben
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest
2025-10-13 12:20 ` Ben Horgan
@ 2025-10-13 16:14 ` Ben Horgan
2025-10-14 6:59 ` Zenghui Yu
0 siblings, 1 reply; 5+ messages in thread
From: Ben Horgan @ 2025-10-13 16:14 UTC (permalink / raw)
To: Zenghui Yu, kvmarm, linux-arm-kernel
Cc: maz, oliver.upton, joey.gouly, suzuki.poulose
On 10/13/25 13:20, Ben Horgan wrote:
> Hi Zenghui,
>
> On 10/12/25 16:43, Zenghui Yu wrote:
>> We forgot to sync several registers (ID_AA64PFR1, MPIDR, CLIDR) in guest to
>> make sure that the guest had seen the written value.
>>
>> Add them to the list.
>>
>> Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev>
>> ---
>> tools/testing/selftests/kvm/arm64/set_id_regs.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/tools/testing/selftests/kvm/arm64/set_id_regs.c b/tools/testing/selftests/kvm/arm64/set_id_regs.c
>> index 8ff1e853f7f8..5e24f77868b5 100644
>> --- a/tools/testing/selftests/kvm/arm64/set_id_regs.c
>> +++ b/tools/testing/selftests/kvm/arm64/set_id_regs.c
>> @@ -249,11 +249,14 @@ static void guest_code(void)
>> GUEST_REG_SYNC(SYS_ID_AA64ISAR2_EL1);
>> GUEST_REG_SYNC(SYS_ID_AA64ISAR3_EL1);
>> GUEST_REG_SYNC(SYS_ID_AA64PFR0_EL1);
>> + GUEST_REG_SYNC(SYS_ID_AA64PFR1_EL1);
>> GUEST_REG_SYNC(SYS_ID_AA64MMFR0_EL1);
>> GUEST_REG_SYNC(SYS_ID_AA64MMFR1_EL1);
>> GUEST_REG_SYNC(SYS_ID_AA64MMFR2_EL1);
>> GUEST_REG_SYNC(SYS_ID_AA64MMFR3_EL1);
>> GUEST_REG_SYNC(SYS_ID_AA64ZFR0_EL1);
>> + GUEST_REG_SYNC(SYS_MPIDR_EL1);
>> + GUEST_REG_SYNC(SYS_CLIDR_EL1);
>
> Why did you choose this position in the list for these 2?
>
>> GUEST_REG_SYNC(SYS_CTR_EL0);
>> GUEST_REG_SYNC(SYS_MIDR_EL1);
>> GUEST_REG_SYNC(SYS_REVIDR_EL1);
>
> Looks good to me.
>
> Reviewed-By: Ben Horgan <ben.horgan@arm.com>
> Thanks,
>
> Ben
>
On running this, I note test_guest_reg_read() doesn't announce its
presence. How about adding a ksft_test_result_pass("%s\n", __func__) and
bumping the number of tests?
Thanks,
Ben
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest
2025-10-12 15:43 [PATCH] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest Zenghui Yu
2025-10-13 12:20 ` Ben Horgan
@ 2025-10-13 16:56 ` Marc Zyngier
1 sibling, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2025-10-13 16:56 UTC (permalink / raw)
To: kvmarm, linux-arm-kernel, Zenghui Yu
Cc: oliver.upton, joey.gouly, suzuki.poulose
On Sun, 12 Oct 2025 23:43:52 +0800, Zenghui Yu wrote:
> We forgot to sync several registers (ID_AA64PFR1, MPIDR, CLIDR) in guest to
> make sure that the guest had seen the written value.
>
> Add them to the list.
>
>
Applied to fixes, thanks!
[1/1] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest
commit: 9a7f87eb587da49993f47f44c4c5535d8de76750
Cheers,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest
2025-10-13 16:14 ` Ben Horgan
@ 2025-10-14 6:59 ` Zenghui Yu
0 siblings, 0 replies; 5+ messages in thread
From: Zenghui Yu @ 2025-10-14 6:59 UTC (permalink / raw)
To: Ben Horgan
Cc: Zenghui Yu, kvmarm, linux-arm-kernel, maz, oliver.upton,
joey.gouly, suzuki.poulose
On 2025/10/14 0:14, Ben Horgan wrote:
>
>
> On 10/13/25 13:20, Ben Horgan wrote:
> > Hi Zenghui,
> >
> > On 10/12/25 16:43, Zenghui Yu wrote:
> > > We forgot to sync several registers (ID_AA64PFR1, MPIDR, CLIDR) in guest to
> > > make sure that the guest had seen the written value.
> > >
> > > Add them to the list.
> > >
> > > Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev>
> > > ---
> > > tools/testing/selftests/kvm/arm64/set_id_regs.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/tools/testing/selftests/kvm/arm64/set_id_regs.c b/tools/testing/selftests/kvm/arm64/set_id_regs.c
> > > index 8ff1e853f7f8..5e24f77868b5 100644
> > > --- a/tools/testing/selftests/kvm/arm64/set_id_regs.c
> > > +++ b/tools/testing/selftests/kvm/arm64/set_id_regs.c
> > > @@ -249,11 +249,14 @@ static void guest_code(void)
> > > GUEST_REG_SYNC(SYS_ID_AA64ISAR2_EL1);
> > > GUEST_REG_SYNC(SYS_ID_AA64ISAR3_EL1);
> > > GUEST_REG_SYNC(SYS_ID_AA64PFR0_EL1);
> > > + GUEST_REG_SYNC(SYS_ID_AA64PFR1_EL1);
> > > GUEST_REG_SYNC(SYS_ID_AA64MMFR0_EL1);
> > > GUEST_REG_SYNC(SYS_ID_AA64MMFR1_EL1);
> > > GUEST_REG_SYNC(SYS_ID_AA64MMFR2_EL1);
> > > GUEST_REG_SYNC(SYS_ID_AA64MMFR3_EL1);
> > > GUEST_REG_SYNC(SYS_ID_AA64ZFR0_EL1);
> > > + GUEST_REG_SYNC(SYS_MPIDR_EL1);
> > > + GUEST_REG_SYNC(SYS_CLIDR_EL1);
> >
> > Why did you choose this position in the list for these 2?
Technically there are no restrictions on the order. I just want it to
look consistent with test_reset_preserves_id_regs().
> >
> >> GUEST_REG_SYNC(SYS_CTR_EL0);
> >> GUEST_REG_SYNC(SYS_MIDR_EL1);
> >> GUEST_REG_SYNC(SYS_REVIDR_EL1);
> >
> > Looks good to me.
> >
> > Reviewed-By: Ben Horgan <ben.horgan@arm.com>
Thanks!
> On running this, I note test_guest_reg_read() doesn't announce its
> presence. How about adding a ksft_test_result_pass("%s\n", __func__) and
> bumping the number of tests?
Yup, I agreed.
Thanks,
Zenghui
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-10-14 6:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-12 15:43 [PATCH] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest Zenghui Yu
2025-10-13 12:20 ` Ben Horgan
2025-10-13 16:14 ` Ben Horgan
2025-10-14 6:59 ` Zenghui Yu
2025-10-13 16:56 ` Marc Zyngier
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.