Skip to content

Commit fb5040e

Browse files
Tony Krowiakhcahca
authored andcommitted
KVM: s390: export kvm_s390_pv*_is_protected functions
Export the kvm_s390_pv_is_protected and kvm_s390_pv_cpu_is_protected functions so that they can be called from other modules that carry a GPL-compatible license. Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com> Tested-by: Viktor Mihajlovski <mihajlov@linux.ibm.com> Link: https://lore.kernel.org/r/20230815184333.6554-12-akrowiak@linux.ibm.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent cf3fa16 commit fb5040e

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

arch/s390/include/asm/kvm_host.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,9 @@ static inline int sie64a(struct kvm_s390_sie_block *sie_block, u64 *rsa)
10281028

10291029
extern char sie_exit;
10301030

1031+
bool kvm_s390_pv_is_protected(struct kvm *kvm);
1032+
bool kvm_s390_pv_cpu_is_protected(struct kvm_vcpu *vcpu);
1033+
10311034
extern int kvm_s390_gisc_register(struct kvm *kvm, u32 gisc);
10321035
extern int kvm_s390_gisc_unregister(struct kvm *kvm, u32 gisc);
10331036

arch/s390/kvm/kvm-s390.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,18 +270,6 @@ static inline u64 kvm_s390_pv_cpu_get_handle(struct kvm_vcpu *vcpu)
270270
return vcpu->arch.pv.handle;
271271
}
272272

273-
static inline bool kvm_s390_pv_is_protected(struct kvm *kvm)
274-
{
275-
lockdep_assert_held(&kvm->lock);
276-
return !!kvm_s390_pv_get_handle(kvm);
277-
}
278-
279-
static inline bool kvm_s390_pv_cpu_is_protected(struct kvm_vcpu *vcpu)
280-
{
281-
lockdep_assert_held(&vcpu->mutex);
282-
return !!kvm_s390_pv_cpu_get_handle(vcpu);
283-
}
284-
285273
/* implemented in interrupt.c */
286274
int kvm_s390_handle_wait(struct kvm_vcpu *vcpu);
287275
void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu);

arch/s390/kvm/pv.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@
1818
#include <linux/mmu_notifier.h>
1919
#include "kvm-s390.h"
2020

21+
bool kvm_s390_pv_is_protected(struct kvm *kvm)
22+
{
23+
lockdep_assert_held(&kvm->lock);
24+
return !!kvm_s390_pv_get_handle(kvm);
25+
}
26+
EXPORT_SYMBOL_GPL(kvm_s390_pv_is_protected);
27+
28+
bool kvm_s390_pv_cpu_is_protected(struct kvm_vcpu *vcpu)
29+
{
30+
lockdep_assert_held(&vcpu->mutex);
31+
return !!kvm_s390_pv_cpu_get_handle(vcpu);
32+
}
33+
EXPORT_SYMBOL_GPL(kvm_s390_pv_cpu_is_protected);
34+
2135
/**
2236
* struct pv_vm_to_be_destroyed - Represents a protected VM that needs to
2337
* be destroyed

0 commit comments

Comments
 (0)