Merge tag 'smp-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / arch / powerpc / include / asm / kvm_para.h
CommitLineData
d94d71cb 1/* SPDX-License-Identifier: GPL-2.0-only */
bbf45ba5 2/*
bbf45ba5
HB
3 *
4 * Copyright IBM Corp. 2008
5 *
6 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
7 */
bbf45ba5
HB
8#ifndef __POWERPC_KVM_PARA_H__
9#define __POWERPC_KVM_PARA_H__
10
92cc6bf0 11#include <asm/kvm_guest.h>
2a342ed5 12
107c5500 13#include <uapi/asm/kvm_para.h>
2a342ed5 14
bbf45ba5
HB
15static inline int kvm_para_available(void)
16{
a21d1bec 17 return IS_ENABLED(CONFIG_KVM_GUEST) && is_kvm_guest();
bbf45ba5
HB
18}
19
20static inline unsigned int kvm_arch_para_features(void)
21{
2a342ed5
AG
22 unsigned long r;
23
24 if (!kvm_para_available())
25 return 0;
26
b1f0d94c 27 if(epapr_hypercall0_1(KVM_HCALL_TOKEN(KVM_HC_FEATURES), &r))
2a342ed5
AG
28 return 0;
29
30 return r;
bbf45ba5
HB
31}
32
a4429e53
WL
33static inline unsigned int kvm_arch_para_hints(void)
34{
35 return 0;
36}
37
3b5d56b9
EM
38static inline bool kvm_check_and_clear_guest_paused(void)
39{
40 return false;
41}
42
bbf45ba5 43#endif /* __POWERPC_KVM_PARA_H__ */