Skip to content

Commit 2b7deea

Browse files
committed
Revert "kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h"
Effectively revert the movement of code from kvm_util.h => kvm_util_base.h, as the TL;DR of the justification for the move was to avoid #idefs and/or circular dependencies between what ended up being ucall_common.h and what was (and now again, is), kvm_util.h. But avoiding #ifdef and circular includes is trivial: don't do that. The cost of removing kvm_util_base.h is a few extra includes of ucall_common.h, but that cost is practically nothing. On the other hand, having a "base" version of a header that is really just the header itself is confusing, and makes it weird/hard to choose names for headers that actually are "base" headers, e.g. to hold core KVM selftests typedefs. For all intents and purposes, this reverts commit 7d9a662. Reviewed-by: Ackerley Tng <ackerleytng@google.com> Link: https://lore.kernel.org/r/20240314232637.2538648-2-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 87aa264 commit 2b7deea

28 files changed

Lines changed: 1156 additions & 12 deletions

tools/testing/selftests/kvm/aarch64/arch_timer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "gic.h"
1111
#include "processor.h"
1212
#include "timer_test.h"
13+
#include "ucall_common.h"
1314
#include "vgic.h"
1415

1516
#define GICD_BASE_GPA 0x8000000ULL

tools/testing/selftests/kvm/arch_timer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <sys/sysinfo.h>
2727

2828
#include "timer_test.h"
29+
#include "ucall_common.h"
2930

3031
struct test_args test_args = {
3132
.nr_vcpus = NR_VCPUS_DEF,

tools/testing/selftests/kvm/demand_paging_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "test_util.h"
2020
#include "memstress.h"
2121
#include "guest_modes.h"
22+
#include "ucall_common.h"
2223
#include "userfaultfd_util.h"
2324

2425
#ifdef __NR_userfaultfd

tools/testing/selftests/kvm/dirty_log_perf_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "test_util.h"
1919
#include "memstress.h"
2020
#include "guest_modes.h"
21+
#include "ucall_common.h"
2122

2223
#ifdef __aarch64__
2324
#include "aarch64/vgic.h"

tools/testing/selftests/kvm/dirty_log_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "test_util.h"
2121
#include "guest_modes.h"
2222
#include "processor.h"
23+
#include "ucall_common.h"
2324

2425
#define DIRTY_MEM_BITS 30 /* 1G */
2526
#define PAGE_SHIFT_4K 12

tools/testing/selftests/kvm/guest_memfd_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include <sys/types.h>
1818
#include <sys/stat.h>
1919

20+
#include "kvm_util.h"
2021
#include "test_util.h"
21-
#include "kvm_util_base.h"
2222

2323
static void test_file_read_write(int fd)
2424
{

tools/testing/selftests/kvm/guest_print_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "test_util.h"
1414
#include "kvm_util.h"
1515
#include "processor.h"
16+
#include "ucall_common.h"
1617

1718
struct guest_vals {
1819
uint64_t a;

tools/testing/selftests/kvm/include/aarch64/processor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#define SELFTEST_KVM_PROCESSOR_H
99

1010
#include "kvm_util.h"
11+
#include "ucall_common.h"
12+
1113
#include <linux/stringify.h>
1214
#include <linux/types.h>
1315
#include <asm/sysreg.h>

tools/testing/selftests/kvm/include/aarch64/ucall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef SELFTEST_KVM_UCALL_H
33
#define SELFTEST_KVM_UCALL_H
44

5-
#include "kvm_util_base.h"
5+
#include "kvm_util.h"
66

77
#define UCALL_EXIT_REASON KVM_EXIT_MMIO
88

0 commit comments

Comments
 (0)