treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / powerpc / include / asm / kvm_book3s_uvmem.h
blob5a9834e0e2d1d7122086ae7d4fcef118ec9b97d0
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_KVM_BOOK3S_UVMEM_H__
3 #define __ASM_KVM_BOOK3S_UVMEM_H__
5 #ifdef CONFIG_PPC_UV
6 int kvmppc_uvmem_init(void);
7 void kvmppc_uvmem_free(void);
8 int kvmppc_uvmem_slot_init(struct kvm *kvm, const struct kvm_memory_slot *slot);
9 void kvmppc_uvmem_slot_free(struct kvm *kvm,
10 const struct kvm_memory_slot *slot);
11 unsigned long kvmppc_h_svm_page_in(struct kvm *kvm,
12 unsigned long gra,
13 unsigned long flags,
14 unsigned long page_shift);
15 unsigned long kvmppc_h_svm_page_out(struct kvm *kvm,
16 unsigned long gra,
17 unsigned long flags,
18 unsigned long page_shift);
19 unsigned long kvmppc_h_svm_init_start(struct kvm *kvm);
20 unsigned long kvmppc_h_svm_init_done(struct kvm *kvm);
21 int kvmppc_send_page_to_uv(struct kvm *kvm, unsigned long gfn);
22 unsigned long kvmppc_h_svm_init_abort(struct kvm *kvm);
23 void kvmppc_uvmem_drop_pages(const struct kvm_memory_slot *free,
24 struct kvm *kvm, bool skip_page_out);
25 #else
26 static inline int kvmppc_uvmem_init(void)
28 return 0;
31 static inline void kvmppc_uvmem_free(void) { }
33 static inline int
34 kvmppc_uvmem_slot_init(struct kvm *kvm, const struct kvm_memory_slot *slot)
36 return 0;
39 static inline void
40 kvmppc_uvmem_slot_free(struct kvm *kvm, const struct kvm_memory_slot *slot) { }
42 static inline unsigned long
43 kvmppc_h_svm_page_in(struct kvm *kvm, unsigned long gra,
44 unsigned long flags, unsigned long page_shift)
46 return H_UNSUPPORTED;
49 static inline unsigned long
50 kvmppc_h_svm_page_out(struct kvm *kvm, unsigned long gra,
51 unsigned long flags, unsigned long page_shift)
53 return H_UNSUPPORTED;
56 static inline unsigned long kvmppc_h_svm_init_start(struct kvm *kvm)
58 return H_UNSUPPORTED;
61 static inline unsigned long kvmppc_h_svm_init_done(struct kvm *kvm)
63 return H_UNSUPPORTED;
66 static inline unsigned long kvmppc_h_svm_init_abort(struct kvm *kvm)
68 return H_UNSUPPORTED;
71 static inline int kvmppc_send_page_to_uv(struct kvm *kvm, unsigned long gfn)
73 return -EFAULT;
76 static inline void
77 kvmppc_uvmem_drop_pages(const struct kvm_memory_slot *free,
78 struct kvm *kvm, bool skip_page_out) { }
79 #endif /* CONFIG_PPC_UV */
80 #endif /* __ASM_KVM_BOOK3S_UVMEM_H__ */