| 1 |
|
| 2 | |
| 3 | * Type definitions for the Microsoft Hypervisor.
|
| 4 |
|
| 5 | #ifndef _HV_HVGDK_EXT_H
|
| 6 | #define _HV_HVGDK_EXT_H
|
| 7 |
|
| 8 | #include "hvgdk_mini.h"
|
| 9 |
|
| 10 |
|
| 11 | #define HV_EXT_CALL_QUERY_CAPABILITIES 0x8001
|
| 12 | #define HV_EXT_CALL_MEMORY_HEAT_HINT 0x8003
|
| 13 |
|
| 14 |
|
| 15 | enum {
|
| 16 | HV_EXTCALL_QUERY_CAPABILITIES = 0x8001,
|
| 17 | HV_EXTCALL_MEMORY_HEAT_HINT = 0x8003,
|
| 18 | };
|
| 19 |
|
| 20 |
|
| 21 | #define HV_EXT_CAPABILITY_MEMORY_COLD_DISCARD_HINT BIT(8)
|
| 22 |
|
| 23 | enum {
|
| 24 | HV_EXTMEM_HEAT_HINT_COLD = 0,
|
| 25 | HV_EXTMEM_HEAT_HINT_HOT = 1,
|
| 26 | HV_EXTMEM_HEAT_HINT_COLD_DISCARD = 2,
|
| 27 | HV_EXTMEM_HEAT_HINT_MAX
|
| 28 | };
|
| 29 |
|
| 30 | |
| 31 | * The whole argument should fit in a page to be able to pass to the hypervisor
|
| 32 | * in one hypercall.
|
| 33 |
|
| 34 | #define HV_MEMORY_HINT_MAX_GPA_PAGE_RANGES \
|
| 35 | ((HV_HYP_PAGE_SIZE - sizeof(struct hv_memory_hint)) / \
|
| 36 | sizeof(union hv_gpa_page_range))
|
| 37 |
|
| 38 |
|
| 39 | #define HV_EXT_MEMORY_HEAT_HINT_TYPE_COLD_DISCARD 2
|
| 40 | struct hv_memory_hint {
|
| 41 | u64 heat_type : 2;
|
| 42 | u64 reserved : 62;
|
| 43 | union hv_gpa_page_range ranges[];
|
| 44 | } __packed;
|
| 45 |
|
| 46 | #endif
|