Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hv headers directly in the repo #165

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions hv-headers/hvgdk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Type definitions for the hypervisor guest interface.
*/
#ifndef _HVGDK_H
#define _HVGDK_H

#include "hvgdk_mini.h"

#define HVGDK_H_VERSION (25125)

#if defined(__x86_64__)

enum hv_unimplemented_msr_action {
HV_UNIMPLEMENTED_MSR_ACTION_FAULT = 0,
HV_UNIMPLEMENTED_MSR_ACTION_IGNORE_WRITE_READ_ZERO = 1,
HV_UNIMPLEMENTED_MSR_ACTION_COUNT = 2,
};

#endif

#endif /* _HVGDK_H */
45 changes: 45 additions & 0 deletions hv-headers/hvgdk_ext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_HV_HVGDK_EXT_H
#define _UAPI_HV_HVGDK_EXT_H

#include "hvgdk_mini.h"

#define HVGDK_EXT_VERSION (25294)

/* Extended hypercalls */
#define HV_EXT_CALL_QUERY_CAPABILITIES 0x8001
#define HV_EXT_CALL_MEMORY_HEAT_HINT 0x8003

/* Extended hypercalls */
enum { /* HV_EXT_CALL */
HV_EXTCALL_QUERY_CAPABILITIES = 0x8001,
HV_EXTCALL_MEMORY_HEAT_HINT = 0x8003,
};

/* HV_EXT_OUTPUT_QUERY_CAPABILITIES */
#define HV_EXT_CAPABILITY_MEMORY_COLD_DISCARD_HINT BIT(8)

enum { /* HV_EXT_MEMORY_HEAT_HINT_TYPE */
HV_EXTMEM_HEAT_HINT_COLD = 0,
HV_EXTMEM_HEAT_HINT_HOT = 1,
HV_EXTMEM_HEAT_HINT_COLD_DISCARD = 2,
HV_EXTMEM_HEAT_HINT_MAX
};

/*
* The whole argument should fit in a page to be able to pass to the hypervisor
* in one hypercall.
*/
#define HV_MEMORY_HINT_MAX_GPA_PAGE_RANGES \
((HV_HYP_PAGE_SIZE - sizeof(struct hv_memory_hint)) / \
sizeof(union hv_gpa_page_range))

/* HvExtCallMemoryHeatHint hypercall */
#define HV_EXT_MEMORY_HEAT_HINT_TYPE_COLD_DISCARD 2
struct hv_memory_hint { /* HV_EXT_INPUT_MEMORY_HEAT_HINT */
__u64 heat_type:2; /* HV_EXTMEM_HEAT_HINT_* */
__u64 reserved:62;
union hv_gpa_page_range ranges[];
} __packed;

#endif /* _UAPI_HV_HVGDK_EXT_H */
Loading
Loading