Skip to contentSkip to conversation

KVM: selftests: Fix RISC-V compilation

PATCH In review Andrew Jones 3 participants 4 messages Jun 3, 2024 – Jun 6, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: selftests: Fix RISC-V compilation

Due to commit 2b7deea3ec7c ("Revert "kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h"") kvm selftests now requires implicitly including ucall_common.h when needed. The commit added the directives everywhere they were needed at the time, but, by merge time, new places had been merged for RISC-V. Add those now to fix RISC-V's compilation.

Fixes dee7ea42a1eb ("Merge tag 'kvm-x86-selftests_utils-6.10' of https://github.com/kvm-x86/linux into HEAD")
---
 tools/testing/selftests/kvm/lib/riscv/ucall.c    | 1 +
 tools/testing/selftests/kvm/riscv/ebreak_test.c  | 1 +
 tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 1 +
 3 files changed, 3 insertions(+)
tools/testing/selftests/kvm/lib/riscv/ucall.c +1 -0
index 14ee17151a59..b5035c63d516 100644
@@ -9,6 +9,7 @@
 
 #include "kvm_util.h"
 #include "processor.h"
+#include "sbi.h"
 
 void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu)
 {
tools/testing/selftests/kvm/riscv/ebreak_test.c +1 -0
index 823c132069b4..0e0712854953 100644
@@ -6,6 +6,7 @@
  *
  */
 #include "kvm_util.h"
+#include "ucall_common.h"
 
 #define LABEL_ADDRESS(v) ((uint64_t)&(v))
 
tools/testing/selftests/kvm/riscv/sbi_pmu_test.c +1 -0
index 69bb94e6b227..f299cbfd23ca 100644
@@ -15,6 +15,7 @@
 #include "processor.h"
 #include "sbi.h"
 #include "arch_timer.h"
+#include "ucall_common.h"
 
 /* Maximum counters(firmware + hardware) */
 #define RISCV_MAX_PMU_COUNTERS 64
Signature · 1 line
2.45.1
#1 lore raw
Quoted 3 lines · Andrew Jones

Due to commit 2b7deea3ec7c ("Revert "kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h"") kvm selftests now requires implicitly including ucall_common.h when needed. The commit

^ of course I meant 'explicitly' here. Gota love brain inversions
and not reviewing commit messages closely until after posting... Should I post a v2 or just promise to buy a beer in exchange for a fixup-on-merge?

Thanks,
drew

Quoted 51 lines

added the directives everywhere they were needed at the time, but, by merge time, new places had been merged for RISC-V. Add those now to fix RISC-V's compilation.

Fixes dee7ea42a1eb ("Merge tag 'kvm-x86-selftests_utils-6.10' of https://github.com/kvm-x86/linux into HEAD")
---
 tools/testing/selftests/kvm/lib/riscv/ucall.c    | 1 +
 tools/testing/selftests/kvm/riscv/ebreak_test.c  | 1 +
 tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 1 +
 3 files changed, 3 insertions(+)
tools/testing/selftests/kvm/lib/riscv/ucall.c +1 -0
index 14ee17151a59..b5035c63d516 100644
@@ -9,6 +9,7 @@
 
 #include "kvm_util.h"
 #include "processor.h"
+#include "sbi.h"
 
 void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu)
 {
tools/testing/selftests/kvm/riscv/ebreak_test.c +1 -0
index 823c132069b4..0e0712854953 100644
@@ -6,6 +6,7 @@
  *
  */
 #include "kvm_util.h"
+#include "ucall_common.h"
 
 #define LABEL_ADDRESS(v) ((uint64_t)&(v))
 
tools/testing/selftests/kvm/riscv/sbi_pmu_test.c +1 -0
index 69bb94e6b227..f299cbfd23ca 100644
@@ -15,6 +15,7 @@
 #include "processor.h"
 #include "sbi.h"
 #include "arch_timer.h"
+#include "ucall_common.h"
 
 /* Maximum counters(firmware + hardware) */
 #define RISCV_MAX_PMU_COUNTERS 64
Signature · 1 line
2.45.1
#2 lore raw
Quoted 7 lines · Andrew Jones
Quoted 3 lines · Andrew Jones

Due to commit 2b7deea3ec7c ("Revert "kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h"") kvm selftests now requires implicitly including ucall_common.h when needed. The commit

^ of course I meant 'explicitly' here. Gota love brain inversions
and not reviewing commit messages closely until after posting... Should I post a v2 or just promise to buy a beer in exchange for a fixup-on-merge?

LOL, what kind of question is that? Beer must be a lot cheaper in your neck of the woods :-)

I'll grab this if no one jumps on it by tomorrow.

maintainer
#3 lore raw
In reply to Andrew Jones
Quoted 10 lines · On Mon, Jun 3, 2024 at 5:50?PM Andrew Jones <[email protected]> wrote:

Due to commit 2b7deea3ec7c ("Revert "kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h"") kvm selftests now requires implicitly including ucall_common.h when needed. The commit added the directives everywhere they were needed at the time, but, by merge time, new places had been merged for RISC-V. Add those now to fix RISC-V's compilation.

Fixes dee7ea42a1eb ("Merge tag 'kvm-x86-selftests_utils-6.10' of https://github.com/kvm-x86/linux into HEAD")

Queued this for Linux-6.10-rcX fixes.

Thanks,
Anup

Quoted 45 lines
---
 tools/testing/selftests/kvm/lib/riscv/ucall.c    | 1 +
 tools/testing/selftests/kvm/riscv/ebreak_test.c  | 1 +
 tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 1 +
 3 files changed, 3 insertions(+)
tools/testing/selftests/kvm/lib/riscv/ucall.c +1 -0
index 14ee17151a59..b5035c63d516 100644
@@ -9,6 +9,7 @@
 
 #include "kvm_util.h"
 #include "processor.h"
+#include "sbi.h"
 
 void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu)
 {
tools/testing/selftests/kvm/riscv/ebreak_test.c +1 -0
index 823c132069b4..0e0712854953 100644
@@ -6,6 +6,7 @@
  *
  */
 #include "kvm_util.h"
+#include "ucall_common.h"
 
 #define LABEL_ADDRESS(v) ((uint64_t)&(v))
 
tools/testing/selftests/kvm/riscv/sbi_pmu_test.c +1 -1
index 69bb94e6b227..f299cbfd23ca 100644
@@ -15,6 +15,7 @@
 #include "processor.h"
 #include "sbi.h"
 #include "arch_timer.h"
+#include "ucall_common.h"
 
 /* Maximum counters(firmware + hardware) */
 #define RISCV_MAX_PMU_COUNTERS 64
--

2.45.1