arch/arm64/include/asm/mshyperv.h

Source file repositories/reference/linux-study-clean/arch/arm64/include/asm/mshyperv.h

File Facts

System
Linux kernel
Corpus path
arch/arm64/include/asm/mshyperv.h
Extension
.h
Size
1604 bytes
Lines
67
Domain
Architecture Layer
Bucket
arch/arm64
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef _ASM_MSHYPERV_H
#define _ASM_MSHYPERV_H

#include <linux/types.h>
#include <linux/arm-smccc.h>
#include <hyperv/hvhdk.h>

/*
 * Declare calls to get and set Hyper-V VP register values on ARM64, which
 * requires a hypercall.
 */

void hv_set_vpreg(u32 reg, u64 value);
u64 hv_get_vpreg(u32 reg);
void hv_get_vpreg_128(u32 reg, struct hv_get_vp_registers_output *result);

static inline void hv_set_msr(unsigned int reg, u64 value)
{
	hv_set_vpreg(reg, value);
}

static inline u64 hv_get_msr(unsigned int reg)
{
	return hv_get_vpreg(reg);
}

/*
 * Nested is not supported on arm64
 */
static inline void hv_set_non_nested_msr(unsigned int reg, u64 value)
{
	hv_set_msr(reg, value);
}

static inline u64 hv_get_non_nested_msr(unsigned int reg)
{
	return hv_get_msr(reg);
}

/* SMCCC hypercall parameters */
#define HV_SMCCC_FUNC_NUMBER	1
#define HV_FUNC_ID	ARM_SMCCC_CALL_VAL(			\
				ARM_SMCCC_STD_CALL,		\
				ARM_SMCCC_SMC_64,		\
				ARM_SMCCC_OWNER_VENDOR_HYP,	\
				HV_SMCCC_FUNC_NUMBER)

#include <asm-generic/mshyperv.h>

#endif

Annotation

Implementation Notes