diff mbox series

KVM: selftests: Fix unknown ucall command asserts

Message ID 20200224161049.18545-1-drjones@redhat.com (mailing list archive)
State New, archived
Headers show
Series KVM: selftests: Fix unknown ucall command asserts | expand

Commit Message

Andrew Jones Feb. 24, 2020, 4:10 p.m. UTC
The TEST_ASSERT in x86_64/platform_info_test.c would have print 'ucall'
instead of 'uc.cmd'. Also fix all uc.cmd format types.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c       | 2 +-
 tools/testing/selftests/kvm/x86_64/evmcs_test.c                | 2 +-
 tools/testing/selftests/kvm/x86_64/platform_info_test.c        | 3 +--
 tools/testing/selftests/kvm/x86_64/state_test.c                | 2 +-
 .../testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c | 2 +-
 tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c        | 2 +-
 tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c       | 2 +-
 7 files changed, 7 insertions(+), 8 deletions(-)

Comments

Paolo Bonzini Feb. 24, 2020, 7:06 p.m. UTC | #1
On 24/02/20 17:10, Andrew Jones wrote:
> The TEST_ASSERT in x86_64/platform_info_test.c would have print 'ucall'
> instead of 'uc.cmd'. Also fix all uc.cmd format types.
> 
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c       | 2 +-
>  tools/testing/selftests/kvm/x86_64/evmcs_test.c                | 2 +-
>  tools/testing/selftests/kvm/x86_64/platform_info_test.c        | 3 +--
>  tools/testing/selftests/kvm/x86_64/state_test.c                | 2 +-
>  .../testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c | 2 +-
>  tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c        | 2 +-
>  tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c       | 2 +-
>  7 files changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c b/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
> index 63cc9c3f5ab6..003d1422705a 100644
> --- a/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
> @@ -106,7 +106,7 @@ int main(int argc, char *argv[])
>  		case UCALL_DONE:
>  			goto done;
>  		default:
> -			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
> +			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
>  		}
>  	}
>  
> diff --git a/tools/testing/selftests/kvm/x86_64/evmcs_test.c b/tools/testing/selftests/kvm/x86_64/evmcs_test.c
> index 92915e6408e7..185226c39c03 100644
> --- a/tools/testing/selftests/kvm/x86_64/evmcs_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/evmcs_test.c
> @@ -117,7 +117,7 @@ int main(int argc, char *argv[])
>  		case UCALL_DONE:
>  			goto done;
>  		default:
> -			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
> +			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
>  		}
>  
>  		/* UCALL_SYNC is handled here.  */
> diff --git a/tools/testing/selftests/kvm/x86_64/platform_info_test.c b/tools/testing/selftests/kvm/x86_64/platform_info_test.c
> index f9334bd3cce9..54a960ff63aa 100644
> --- a/tools/testing/selftests/kvm/x86_64/platform_info_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/platform_info_test.c
> @@ -58,8 +58,7 @@ static void test_msr_platform_info_enabled(struct kvm_vm *vm)
>  			exit_reason_str(run->exit_reason));
>  	get_ucall(vm, VCPU_ID, &uc);
>  	TEST_ASSERT(uc.cmd == UCALL_SYNC,
> -			"Received ucall other than UCALL_SYNC: %u\n",
> -			ucall);
> +			"Received ucall other than UCALL_SYNC: %lu\n", uc.cmd);
>  	TEST_ASSERT((uc.args[1] & MSR_PLATFORM_INFO_MAX_TURBO_RATIO) ==
>  		MSR_PLATFORM_INFO_MAX_TURBO_RATIO,
>  		"Expected MSR_PLATFORM_INFO to have max turbo ratio mask: %i.",
> diff --git a/tools/testing/selftests/kvm/x86_64/state_test.c b/tools/testing/selftests/kvm/x86_64/state_test.c
> index 9d2daffd6110..164774206170 100644
> --- a/tools/testing/selftests/kvm/x86_64/state_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/state_test.c
> @@ -160,7 +160,7 @@ int main(int argc, char *argv[])
>  		case UCALL_DONE:
>  			goto done;
>  		default:
> -			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
> +			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
>  		}
>  
>  		/* UCALL_SYNC is handled here.  */
> diff --git a/tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c b/tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c
> index 5dfb53546a26..cc17a3d67e1f 100644
> --- a/tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c
> @@ -81,7 +81,7 @@ int main(int argc, char *argv[])
>  			TEST_ASSERT(false, "%s", (const char *)uc.args[0]);
>  			/* NOT REACHED */
>  		default:
> -			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
> +			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
>  		}
>  	}
>  }
> diff --git a/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c b/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c
> index a223a6401258..fe0734d9ef75 100644
> --- a/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c
> @@ -152,7 +152,7 @@ int main(int argc, char *argv[])
>  			done = true;
>  			break;
>  		default:
> -			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
> +			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
>  		}
>  	}
>  }
> diff --git a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
> index 64f7cb81f28d..5f46ffeedbf0 100644
> --- a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
> @@ -158,7 +158,7 @@ int main(int argc, char *argv[])
>  		case UCALL_DONE:
>  			goto done;
>  		default:
> -			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
> +			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
>  		}
>  	}
>  
> 

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c b/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
index 63cc9c3f5ab6..003d1422705a 100644
--- a/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
+++ b/tools/testing/selftests/kvm/x86_64/cr4_cpuid_sync_test.c
@@ -106,7 +106,7 @@  int main(int argc, char *argv[])
 		case UCALL_DONE:
 			goto done;
 		default:
-			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
+			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
 		}
 	}
 
diff --git a/tools/testing/selftests/kvm/x86_64/evmcs_test.c b/tools/testing/selftests/kvm/x86_64/evmcs_test.c
index 92915e6408e7..185226c39c03 100644
--- a/tools/testing/selftests/kvm/x86_64/evmcs_test.c
+++ b/tools/testing/selftests/kvm/x86_64/evmcs_test.c
@@ -117,7 +117,7 @@  int main(int argc, char *argv[])
 		case UCALL_DONE:
 			goto done;
 		default:
-			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
+			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
 		}
 
 		/* UCALL_SYNC is handled here.  */
diff --git a/tools/testing/selftests/kvm/x86_64/platform_info_test.c b/tools/testing/selftests/kvm/x86_64/platform_info_test.c
index f9334bd3cce9..54a960ff63aa 100644
--- a/tools/testing/selftests/kvm/x86_64/platform_info_test.c
+++ b/tools/testing/selftests/kvm/x86_64/platform_info_test.c
@@ -58,8 +58,7 @@  static void test_msr_platform_info_enabled(struct kvm_vm *vm)
 			exit_reason_str(run->exit_reason));
 	get_ucall(vm, VCPU_ID, &uc);
 	TEST_ASSERT(uc.cmd == UCALL_SYNC,
-			"Received ucall other than UCALL_SYNC: %u\n",
-			ucall);
+			"Received ucall other than UCALL_SYNC: %lu\n", uc.cmd);
 	TEST_ASSERT((uc.args[1] & MSR_PLATFORM_INFO_MAX_TURBO_RATIO) ==
 		MSR_PLATFORM_INFO_MAX_TURBO_RATIO,
 		"Expected MSR_PLATFORM_INFO to have max turbo ratio mask: %i.",
diff --git a/tools/testing/selftests/kvm/x86_64/state_test.c b/tools/testing/selftests/kvm/x86_64/state_test.c
index 9d2daffd6110..164774206170 100644
--- a/tools/testing/selftests/kvm/x86_64/state_test.c
+++ b/tools/testing/selftests/kvm/x86_64/state_test.c
@@ -160,7 +160,7 @@  int main(int argc, char *argv[])
 		case UCALL_DONE:
 			goto done;
 		default:
-			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
+			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
 		}
 
 		/* UCALL_SYNC is handled here.  */
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c b/tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c
index 5dfb53546a26..cc17a3d67e1f 100644
--- a/tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c
+++ b/tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c
@@ -81,7 +81,7 @@  int main(int argc, char *argv[])
 			TEST_ASSERT(false, "%s", (const char *)uc.args[0]);
 			/* NOT REACHED */
 		default:
-			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
+			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
 		}
 	}
 }
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c b/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c
index a223a6401258..fe0734d9ef75 100644
--- a/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c
+++ b/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c
@@ -152,7 +152,7 @@  int main(int argc, char *argv[])
 			done = true;
 			break;
 		default:
-			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
+			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
 		}
 	}
 }
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
index 64f7cb81f28d..5f46ffeedbf0 100644
--- a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
+++ b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
@@ -158,7 +158,7 @@  int main(int argc, char *argv[])
 		case UCALL_DONE:
 			goto done;
 		default:
-			TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
+			TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd);
 		}
 	}