Commit 2b3f2325 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

Merge tag 'kvm-x86-selftests-6.6-fixes' of https://github.com/kvm-x86/linux into HEAD

KVM selftests fixes for 6.6:

 - Play nice with %llx when formatting guest printf and assert statements.

 - Clean up stale test metadata.

 - Zero-initialize structures in memslot perf test to workaround a suspected
   "may be used uninitialized" false positives from GCC.
parents 88e4cd89 6313e096
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * tools/testing/selftests/kvm/include/kvm_util.h
 *
 * Copyright (C) 2018, Google LLC.
 */
#ifndef SELFTEST_KVM_UCALL_COMMON_H
+7 −0
Original line number Diff line number Diff line
@@ -200,6 +200,13 @@ int guest_vsnprintf(char *buf, int n, const char *fmt, va_list args)
			++fmt;
		}

		/*
		 * Play nice with %llu, %llx, etc.  KVM selftests only support
		 * 64-bit builds, so just treat %ll* the same as %l*.
		 */
		if (qualifier == 'l' && *fmt == 'l')
			++fmt;

		/* default base */
		base = 10;

+0 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * tools/testing/selftests/kvm/lib/x86_64/processor.c
 *
 * Copyright (C) 2021, Google LLC.
 */

+3 −6
Original line number Diff line number Diff line
@@ -1033,9 +1033,8 @@ static bool test_loop(const struct test_data *data,
		      struct test_result *rbestruntime)
{
	uint64_t maxslots;
	struct test_result result;
	struct test_result result = {};

	result.nloops = 0;
	if (!test_execute(targs->nslots, &maxslots, targs->seconds, data,
			  &result.nloops,
			  &result.slot_runtime, &result.guest_runtime)) {
@@ -1089,7 +1088,7 @@ int main(int argc, char *argv[])
		.seconds = 5,
		.runs = 1,
	};
	struct test_result rbestslottime;
	struct test_result rbestslottime = {};
	int tctr;

	if (!check_memory_sizes())
@@ -1098,11 +1097,10 @@ int main(int argc, char *argv[])
	if (!parse_args(argc, argv, &targs))
		return -1;

	rbestslottime.slottimens = 0;
	for (tctr = targs.tfirst; tctr <= targs.tlast; tctr++) {
		const struct test_data *data = &tests[tctr];
		unsigned int runctr;
		struct test_result rbestruntime;
		struct test_result rbestruntime = {};

		if (tctr > targs.tfirst)
			pr_info("\n");
@@ -1110,7 +1108,6 @@ int main(int argc, char *argv[])
		pr_info("Testing %s performance with %i runs, %d seconds each\n",
			data->name, targs.runs, targs.seconds);

		rbestruntime.runtimens = 0;
		for (runctr = 0; runctr < targs.runs; runctr++)
			if (!test_loop(data, &targs,
				       &rbestslottime, &rbestruntime))
+0 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * KVM_GET/SET_* tests
 *
 * Copyright (C) 2022, Red Hat, Inc.
 *
 * Tests for Hyper-V extensions to SVM.
Loading