linux/arch/x86/kvm/vmx/vmx_onhyperv.h

/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef __ARCH_X86_KVM_VMX_ONHYPERV_H__
#define __ARCH_X86_KVM_VMX_ONHYPERV_H__

#include <asm/hyperv-tlfs.h>
#include <asm/mshyperv.h>

#include <linux/jump_label.h>

#include "capabilities.h"
#include "hyperv_evmcs.h"
#include "vmcs12.h"

#define current_evmcs

#if IS_ENABLED(CONFIG_HYPERV)

DECLARE_STATIC_KEY_FALSE(__kvm_is_using_evmcs);

static __always_inline bool kvm_is_using_evmcs(void)
{}

static __always_inline int get_evmcs_offset(unsigned long field,
					    u16 *clean_field)
{}

static __always_inline void evmcs_write64(unsigned long field, u64 value)
{}

static __always_inline void evmcs_write32(unsigned long field, u32 value)
{}

static __always_inline void evmcs_write16(unsigned long field, u16 value)
{}

static __always_inline u64 evmcs_read64(unsigned long field)
{}

static __always_inline u32 evmcs_read32(unsigned long field)
{}

static __always_inline u16 evmcs_read16(unsigned long field)
{}

static inline void evmcs_load(u64 phys_addr)
{}

void evmcs_sanitize_exec_ctrls(struct vmcs_config *vmcs_conf);
#else /* !IS_ENABLED(CONFIG_HYPERV) */
static __always_inline bool kvm_is_using_evmcs(void) { return false; }
static __always_inline void evmcs_write64(unsigned long field, u64 value) {}
static __always_inline void evmcs_write32(unsigned long field, u32 value) {}
static __always_inline void evmcs_write16(unsigned long field, u16 value) {}
static __always_inline u64 evmcs_read64(unsigned long field) { return 0; }
static __always_inline u32 evmcs_read32(unsigned long field) { return 0; }
static __always_inline u16 evmcs_read16(unsigned long field) { return 0; }
static inline void evmcs_load(u64 phys_addr) {}
#endif /* IS_ENABLED(CONFIG_HYPERV) */

#endif /* __ARCH_X86_KVM_VMX_ONHYPERV_H__ */