KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest
PATCH 1/1 KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest
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.
--- tools/testing/selftests/kvm/arm64/set_id_regs.c | 3 +++ 1 file changed, 3 insertions(+)
tools/testing/selftests/kvm/arm64/set_id_regs.c +3 -0
@@ -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 );
Signature · 1 line
2.34.1
Hi Zenghui,
Quoted 16 lines · 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 <[email protected]>--- tools/testing/selftests/kvm/arm64/set_id_regs.c | 3 +++ 1 file changed, 3 insertions(+)tools/testing/selftests/kvm/arm64/set_id_regs.c +0
-0@@ -249,11 +249,14 @@ static void guest_code(void)GUEST_REG_SYNC (SYS_ID_AA64ISAR2_EL1 );
tools/testing/selftests/kvm/arm64/set_id_regs.c static void guest_code(void) · line 259
Quoted 10 lines
tools/testing/selftests/kvm/arm64/set_id_regs.c +3
-0GUEST_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?
tools/testing/selftests/kvm/arm64/set_id_regs.c static void guest_code(void) · line 262
Quoted 3 lines
tools/testing/selftests/kvm/arm64/set_id_regs.c +0
-0GUEST_REG_SYNC (SYS_CTR_EL0 );GUEST_REG_SYNC (SYS_MIDR_EL1 );GUEST_REG_SYNC (SYS_REVIDR_EL1 );
Looks good to me.
Thanks,
Ben
Quoted 36 lines · Ben Horgan
Hi Zenghui,
Quoted 16 lines · 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 <[email protected]>--- tools/testing/selftests/kvm/arm64/set_id_regs.c | 3 +++ 1 file changed, 3 insertions(+)tools/testing/selftests/kvm/arm64/set_id_regs.c +0
-0@@ -249,11 +249,14 @@ static void guest_code(void)GUEST_REG_SYNC (SYS_ID_AA64ISAR2_EL1 );tools/testing/selftests/kvm/arm64/set_id_regs.c static void guest_code(void) · line 259
Quoted 10 lines
tools/testing/selftests/kvm/arm64/set_id_regs.c +3
-0GUEST_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?
tools/testing/selftests/kvm/arm64/set_id_regs.c static void guest_code(void) · line 262
Quoted 3 lines
tools/testing/selftests/kvm/arm64/set_id_regs.c +0
-0GUEST_REG_SYNC (SYS_CTR_EL0 );GUEST_REG_SYNC (SYS_MIDR_EL1 );GUEST_REG_SYNC (SYS_REVIDR_EL1 );
Quoted 7 lines
Looks good to me.
Reviewed-by Ben Horgan <[email protected]>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
Zenghui Yu
reviewerQuoted 26 lines · Ben Horgan
Quoted 23 lines · Ben Horgan
Hi Zenghui,
Quoted 20 lines · 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 <[email protected]>--- tools/testing/selftests/kvm/arm64/set_id_regs.c | 3 +++ 1 file changed, 3 insertions(+)tools/testing/selftests/kvm/arm64/set_id_regs.c +1
-0@@ -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 );
Quoted 8 lines
Quoted 8 lines
tools/testing/selftests/kvm/arm64/set_id_regs.c static void guest_code(void) · line 259
Quoted 6 lines
tools/testing/selftests/kvm/arm64/set_id_regs.c +2
-0GUEST_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().
Quoted 8 lines
Quoted 8 lines
tools/testing/selftests/kvm/arm64/set_id_regs.c static void guest_code(void) · line 262
Quoted 4 lines
tools/testing/selftests/kvm/arm64/set_id_regs.c +0
-0GUEST_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 <[email protected]>
Thanks!
Quoted 3 lines
On running this, I note
test_guest_reg_read()doesn't announce its presence. How about adding aksft_test_result_pass("%s\n", __func__)and bumping the number of tests?
Yup, I agreed.
Thanks,
Zenghui
Quoted 6 lines · 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.
Applied to fixes, thanks!
[1/1] KVM: arm64: selftests: Sync ID_AA64PFR1, MPIDR, CLIDR in guest
commit: 9a7f87eb587da49993f47f44c4c5535d8de76750
Cheers,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.