Skip to content

Commit 7f921a2

Browse files
committed
KVM: PPC: Move kvmhv_on_pseries() into kvm_ppc.h
We recently introduced a usage of kvmhv_on_pseries() in powerpc.c, which causes a build error for ppc64_book3e_allmodconfig: arch/powerpc/kvm/powerpc.c:716:8: error: implicit declaration of function ‘kvmhv_on_pseries’ 716 | if (kvmhv_on_pseries()) { | ^~~~~~~~~~~~~~~~ Fix it by moving kvmhv_on_pseries() into kvm_ppc.h so that the stub version is available for book3e builds. Fixes: f771b55 ("KVM: PPC: Use KVM_CAP_PPC_AIL_MODE_3") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent e4ff775 commit 7f921a2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

arch/powerpc/include/asm/kvm_book3s_64.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@
1616
#include <asm/ppc-opcode.h>
1717
#include <asm/pte-walk.h>
1818

19-
#ifdef CONFIG_PPC_PSERIES
20-
static inline bool kvmhv_on_pseries(void)
21-
{
22-
return !cpu_has_feature(CPU_FTR_HVMODE);
23-
}
24-
#else
25-
static inline bool kvmhv_on_pseries(void)
26-
{
27-
return false;
28-
}
29-
#endif
30-
3119
/*
3220
* Structure for a nested guest, that is, for a guest that is managed by
3321
* one of our guests.

arch/powerpc/include/asm/kvm_ppc.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,18 @@ static inline bool kvm_hv_mode_active(void) { return false; }
586586

587587
#endif
588588

589+
#ifdef CONFIG_PPC_PSERIES
590+
static inline bool kvmhv_on_pseries(void)
591+
{
592+
return !cpu_has_feature(CPU_FTR_HVMODE);
593+
}
594+
#else
595+
static inline bool kvmhv_on_pseries(void)
596+
{
597+
return false;
598+
}
599+
#endif
600+
589601
#ifdef CONFIG_KVM_XICS
590602
static inline int kvmppc_xics_enabled(struct kvm_vcpu *vcpu)
591603
{

0 commit comments

Comments
 (0)