linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: selftests: Fix multiple versions of GIC creation
@ 2022-10-09  3:31 Zenghui Yu
  2022-10-10  4:10 ` Oliver Upton
  2022-10-10  8:43 ` Marc Zyngier
  0 siblings, 2 replies; 3+ messages in thread
From: Zenghui Yu @ 2022-10-09  3:31 UTC (permalink / raw)
  To: kvmarm, kvmarm, kvm, linux-kernel
  Cc: maz, andrew.jones, james.morse, alexandru.elisei, suzuki.poulose,
	oliver.upton, pbonzini, seanjc, wanghaibin.wang, 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")
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---
 tools/testing/selftests/kvm/aarch64/vgic_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/kvm/aarch64/vgic_init.c b/tools/testing/selftests/kvm/aarch64/vgic_init.c
index e05ecb31823f..9c131d977a1b 100644
--- a/tools/testing/selftests/kvm/aarch64/vgic_init.c
+++ b/tools/testing/selftests/kvm/aarch64/vgic_init.c
@@ -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");
 	}
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: arm64: selftests: Fix multiple versions of GIC creation
  2022-10-09  3:31 [PATCH] KVM: arm64: selftests: Fix multiple versions of GIC creation Zenghui Yu
@ 2022-10-10  4:10 ` Oliver Upton
  2022-10-10  8:43 ` Marc Zyngier
  1 sibling, 0 replies; 3+ messages in thread
From: Oliver Upton @ 2022-10-10  4:10 UTC (permalink / raw)
  To: Zenghui Yu
  Cc: kvmarm, kvmarm, kvm, linux-kernel, maz, andrew.jones,
	james.morse, alexandru.elisei, suzuki.poulose, pbonzini, seanjc,
	wanghaibin.wang

On Sun, Oct 09, 2022 at 11:31:31AM +0800, Zenghui Yu wrote:
> 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")
> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>

Reviewed-by: Oliver Upton <oliver.upton@linux.dev>

--
Thanks,
Oliver

> ---
>  tools/testing/selftests/kvm/aarch64/vgic_init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/aarch64/vgic_init.c b/tools/testing/selftests/kvm/aarch64/vgic_init.c
> index e05ecb31823f..9c131d977a1b 100644
> --- a/tools/testing/selftests/kvm/aarch64/vgic_init.c
> +++ b/tools/testing/selftests/kvm/aarch64/vgic_init.c
> @@ -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");
>  	}
>  
> -- 
> 2.33.0
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: arm64: selftests: Fix multiple versions of GIC creation
  2022-10-09  3:31 [PATCH] KVM: arm64: selftests: Fix multiple versions of GIC creation Zenghui Yu
  2022-10-10  4:10 ` Oliver Upton
@ 2022-10-10  8:43 ` Marc Zyngier
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2022-10-10  8:43 UTC (permalink / raw)
  To: kvmarm, kvm, linux-kernel, kvmarm, Zenghui Yu
  Cc: alexandru.elisei, seanjc, oliver.upton, pbonzini, james.morse,
	andrew.jones, wanghaibin.wang, suzuki.poulose

On Sun, 9 Oct 2022 11:31:31 +0800, Zenghui Yu wrote:
> 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.
-- 
Without deviation from the norm, progress is not possible.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-10  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-09  3:31 [PATCH] KVM: arm64: selftests: Fix multiple versions of GIC creation Zenghui Yu
2022-10-10  4:10 ` Oliver Upton
2022-10-10  8:43 ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).