Skip to contentSkip to conversation

KVM: arm64: selftests: Fix multiple versions of GIC creation

PATCH Applied Zenghui Yu 3 participants 3 messages Oct 9, 2022 – Oct 10, 2022

Subsystems (3)
lore
Share & tools
lore

Zenghui Yu

author reviewer
#0 lore raw

PATCH 1/1 KVM: arm64: selftests: Fix multiple versions of GIC creation

Commit 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to separate helper") wrongly converted a "real" GIC device creation to __kvm_test_create_device() and caused the test failure on my D05 (which supports v2 emulation). Fix it.

Fixes 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to separate helper")
---
 tools/testing/selftests/kvm/aarch64/vgic_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/kvm/aarch64/vgic_init.c +2 -2
index e05ecb31823f..9c131d977a1b 100644
@@ -662,8 +662,8 @@ int test_kvm_device(uint32_t gic_dev_type)
 					     : KVM_DEV_TYPE_ARM_VGIC_V2;
 
 	if (!__kvm_test_create_device(v.vm, other)) {
-		ret = __kvm_test_create_device(v.vm, other);
-		TEST_ASSERT(ret && (errno == EINVAL || errno == EEXIST),
+		ret = __kvm_create_device(v.vm, other);
+		TEST_ASSERT(ret < 0 && (errno == EINVAL || errno == EEXIST),
 				"create GIC device while other version exists");
 	}
 
Signature · 1 line
2.33.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Zenghui Yu

Commit 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to separate helper") wrongly converted a "real" GIC device creation to __kvm_test_create_device() and caused the test failure on my D05 (which supports v2 emulation). Fix it.

Fixes 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to separate helper")

--
Thanks,
Oliver

Quoted 23 lines
---
 tools/testing/selftests/kvm/aarch64/vgic_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/kvm/aarch64/vgic_init.c +2 -2
index e05ecb31823f..9c131d977a1b 100644
@@ -662,8 +662,8 @@ int test_kvm_device(uint32_t gic_dev_type)
 					     : KVM_DEV_TYPE_ARM_VGIC_V2;
 
 	if (!__kvm_test_create_device(v.vm, other)) {
-		ret = __kvm_test_create_device(v.vm, other);
-		TEST_ASSERT(ret && (errno == EINVAL || errno == EEXIST),
+		ret = __kvm_create_device(v.vm, other);
+		TEST_ASSERT(ret < 0 && (errno == EINVAL || errno == EEXIST),
 				"create GIC device while other version exists");
 	}
 
Signature · 1 line
2.33.0

_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

maintainer Applied
#2 lore raw
In reply to Zenghui Yu
Quoted 4 lines · Zenghui Yu

Commit 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to separate helper") wrongly converted a "real" GIC device creation to __kvm_test_create_device() and caused the test failure on my D05 (which supports v2 emulation). Fix it.

Applied to fixes, thanks!

[1/1] KVM: arm64: selftests: Fix multiple versions of GIC creation

      commit: 8a6ffcbe26fd14d58075dcf3cbdf1b5b69b20402

Cheers,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.