aboutsummaryrefslogtreecommitdiff
path: root/arch/s390/kvm/pv.c
diff options
context:
space:
mode:
authorTony Krowiak <[email protected]>2023-08-15 14:43:32 -0400
committerHeiko Carstens <[email protected]>2023-08-18 15:24:35 +0200
commitfb5040ef7f707525d0681cf6bfe424ccd1aadab7 (patch)
tree9e1fc7fe24b81cd878c8d6b77016756e98ff2afa /arch/s390/kvm/pv.c
parentcf3fa16a6fd49216ae83502e61bea0d8322b51eb (diff)
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 <[email protected]> Signed-off-by: Tony Krowiak <[email protected]> Tested-by: Viktor Mihajlovski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Carstens <[email protected]>
Diffstat (limited to 'arch/s390/kvm/pv.c')
-rw-r--r--arch/s390/kvm/pv.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c
index 2f34c7c3c5ab..856140e9942e 100644
--- a/arch/s390/kvm/pv.c
+++ b/arch/s390/kvm/pv.c
@@ -18,6 +18,20 @@
#include <linux/mmu_notifier.h>
#include "kvm-s390.h"
+bool kvm_s390_pv_is_protected(struct kvm *kvm)
+{
+ lockdep_assert_held(&kvm->lock);
+ return !!kvm_s390_pv_get_handle(kvm);
+}
+EXPORT_SYMBOL_GPL(kvm_s390_pv_is_protected);
+
+bool kvm_s390_pv_cpu_is_protected(struct kvm_vcpu *vcpu)
+{
+ lockdep_assert_held(&vcpu->mutex);
+ return !!kvm_s390_pv_cpu_get_handle(vcpu);
+}
+EXPORT_SYMBOL_GPL(kvm_s390_pv_cpu_is_protected);
+
/**
* struct pv_vm_to_be_destroyed - Represents a protected VM that needs to
* be destroyed