162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2020 IBM Corporation
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#ifndef _ASM_POWERPC_KVM_GUEST_H_
762306a36Sopenharmony_ci#define _ASM_POWERPC_KVM_GUEST_H_
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_KVM_GUEST)
1062306a36Sopenharmony_ci#include <linux/jump_label.h>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciDECLARE_STATIC_KEY_FALSE(kvm_guest);
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_cistatic inline bool is_kvm_guest(void)
1562306a36Sopenharmony_ci{
1662306a36Sopenharmony_ci	return static_branch_unlikely(&kvm_guest);
1762306a36Sopenharmony_ci}
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ciint __init check_kvm_guest(void);
2062306a36Sopenharmony_ci#else
2162306a36Sopenharmony_cistatic inline bool is_kvm_guest(void) { return false; }
2262306a36Sopenharmony_cistatic inline int check_kvm_guest(void) { return 0; }
2362306a36Sopenharmony_ci#endif
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci#endif /* _ASM_POWERPC_KVM_GUEST_H_ */
26