Skip to content

Commit 2b3f232

Browse files
committed
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.
2 parents 88e4cd8 + 6313e09 commit 2b3f232

File tree

9 files changed

+10
-23
lines changed

9 files changed

+10
-23
lines changed

tools/testing/selftests/kvm/include/ucall_common.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22
/*
3-
* tools/testing/selftests/kvm/include/kvm_util.h
4-
*
53
* Copyright (C) 2018, Google LLC.
64
*/
75
#ifndef SELFTEST_KVM_UCALL_COMMON_H

tools/testing/selftests/kvm/lib/guest_sprintf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,13 @@ int guest_vsnprintf(char *buf, int n, const char *fmt, va_list args)
200200
++fmt;
201201
}
202202

203+
/*
204+
* Play nice with %llu, %llx, etc. KVM selftests only support
205+
* 64-bit builds, so just treat %ll* the same as %l*.
206+
*/
207+
if (qualifier == 'l' && *fmt == 'l')
208+
++fmt;
209+
203210
/* default base */
204211
base = 10;
205212

tools/testing/selftests/kvm/lib/x86_64/apic.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* tools/testing/selftests/kvm/lib/x86_64/processor.c
4-
*
53
* Copyright (C) 2021, Google LLC.
64
*/
75

tools/testing/selftests/kvm/memslot_perf_test.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,9 +1033,8 @@ static bool test_loop(const struct test_data *data,
10331033
struct test_result *rbestruntime)
10341034
{
10351035
uint64_t maxslots;
1036-
struct test_result result;
1036+
struct test_result result = {};
10371037

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

10951094
if (!check_memory_sizes())
@@ -1098,19 +1097,17 @@ int main(int argc, char *argv[])
10981097
if (!parse_args(argc, argv, &targs))
10991098
return -1;
11001099

1101-
rbestslottime.slottimens = 0;
11021100
for (tctr = targs.tfirst; tctr <= targs.tlast; tctr++) {
11031101
const struct test_data *data = &tests[tctr];
11041102
unsigned int runctr;
1105-
struct test_result rbestruntime;
1103+
struct test_result rbestruntime = {};
11061104

11071105
if (tctr > targs.tfirst)
11081106
pr_info("\n");
11091107

11101108
pr_info("Testing %s performance with %i runs, %d seconds each\n",
11111109
data->name, targs.runs, targs.seconds);
11121110

1113-
rbestruntime.runtimens = 0;
11141111
for (runctr = 0; runctr < targs.runs; runctr++)
11151112
if (!test_loop(data, &targs,
11161113
&rbestslottime, &rbestruntime))

tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* KVM_GET/SET_* tests
4-
*
53
* Copyright (C) 2022, Red Hat, Inc.
64
*
75
* Tests for Hyper-V extensions to SVM.

tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* tools/testing/selftests/kvm/nx_huge_page_test.c
4-
*
53
* Usage: to be run via nx_huge_page_test.sh, which does the necessary
64
* environment setup and teardown
75
*

tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Wrapper script which performs setup and cleanup for nx_huge_pages_test.
55
# Makes use of root privileges to set up huge pages and KVM module parameters.
66
#
7-
# tools/testing/selftests/kvm/nx_huge_page_test.sh
87
# Copyright (C) 2022, Google LLC.
98

109
set -e

tools/testing/selftests/kvm/x86_64/tsc_scaling_sync.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* svm_vmcall_test
4-
*
53
* Copyright © 2021 Amazon.com, Inc. or its affiliates.
6-
*
7-
* Xen shared_info / pvclock testing
84
*/
95

106
#include "test_util.h"

tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* svm_vmcall_test
4-
*
53
* Copyright © 2021 Amazon.com, Inc. or its affiliates.
6-
*
7-
* Xen shared_info / pvclock testing
84
*/
95

106
#include "test_util.h"

0 commit comments

Comments
 (0)