1d94d71cbSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2b8b572e1SStephen Rothwell /* 3b8b572e1SStephen Rothwell * 4b8b572e1SStephen Rothwell * Copyright IBM Corp. 2008 5b8b572e1SStephen Rothwell * 6b8b572e1SStephen Rothwell * Authors: Hollis Blanchard <hollisb@us.ibm.com> 7b8b572e1SStephen Rothwell */ 8b8b572e1SStephen Rothwell #ifndef __POWERPC_KVM_PARA_H__ 9b8b572e1SStephen Rothwell #define __POWERPC_KVM_PARA_H__ 10b8b572e1SStephen Rothwell 1192cc6bf0SSrikar Dronamraju #include <asm/kvm_guest.h> 12107c5500SNicholas Piggin 13c3617f72SDavid Howells #include <uapi/asm/kvm_para.h> 14b8b572e1SStephen Rothwell 152a342ed5SAlexander Graf static inline int kvm_para_available(void) 162a342ed5SAlexander Graf { 17*a21d1becSSrikar Dronamraju return IS_ENABLED(CONFIG_KVM_GUEST) && is_kvm_guest(); 182a342ed5SAlexander Graf } 192a342ed5SAlexander Graf 20b8b572e1SStephen Rothwell static inline unsigned int kvm_arch_para_features(void) 21b8b572e1SStephen Rothwell { 222a342ed5SAlexander Graf unsigned long r; 232a342ed5SAlexander Graf 242a342ed5SAlexander Graf if (!kvm_para_available()) 25b8b572e1SStephen Rothwell return 0; 262a342ed5SAlexander Graf 27b1f0d94cSBharat Bhushan if(epapr_hypercall0_1(KVM_HCALL_TOKEN(KVM_HC_FEATURES), &r)) 282a342ed5SAlexander Graf return 0; 292a342ed5SAlexander Graf 302a342ed5SAlexander Graf return r; 31b8b572e1SStephen Rothwell } 32b8b572e1SStephen Rothwell 33a4429e53SWanpeng Li static inline unsigned int kvm_arch_para_hints(void) 34a4429e53SWanpeng Li { 35a4429e53SWanpeng Li return 0; 36a4429e53SWanpeng Li } 37a4429e53SWanpeng Li 383b5d56b9SEric B Munson static inline bool kvm_check_and_clear_guest_paused(void) 393b5d56b9SEric B Munson { 403b5d56b9SEric B Munson return false; 413b5d56b9SEric B Munson } 423b5d56b9SEric B Munson 43b8b572e1SStephen Rothwell #endif /* __POWERPC_KVM_PARA_H__ */ 44