Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mshv: Add definitions for MSHV sleep state configuration

Add the definitions required to configure sleep states in mshv hypervsior.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Co-developed-by: Anatol Belski <anbelski@linux.microsoft.com>
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
Reviewed-by: Easwar Hariharan <easwar.hariharan@linux.microsoft.com>
Reviewed-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Acked-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Praveen K Paladugu and committed by
Wei Liu
723c47a2 b9a66cd5

+43 -1
+3 -1
include/hyperv/hvgdk_mini.h
··· 465 465 #define HVCALL_RESET_DEBUG_SESSION 0x006b 466 466 #define HVCALL_MAP_STATS_PAGE 0x006c 467 467 #define HVCALL_UNMAP_STATS_PAGE 0x006d 468 + #define HVCALL_SET_SYSTEM_PROPERTY 0x006f 468 469 #define HVCALL_ADD_LOGICAL_PROCESSOR 0x0076 469 470 #define HVCALL_GET_SYSTEM_PROPERTY 0x007b 470 471 #define HVCALL_MAP_DEVICE_INTERRUPT 0x007c 471 472 #define HVCALL_UNMAP_DEVICE_INTERRUPT 0x007d 472 473 #define HVCALL_RETARGET_INTERRUPT 0x007e 473 474 #define HVCALL_NOTIFY_PARTITION_EVENT 0x0087 475 + #define HVCALL_ENTER_SLEEP_STATE 0x0084 474 476 #define HVCALL_NOTIFY_PORT_RING_EMPTY 0x008b 475 477 #define HVCALL_REGISTER_INTERCEPT_RESULT 0x0091 476 478 #define HVCALL_ASSERT_VIRTUAL_INTERRUPT 0x0094 477 479 #define HVCALL_CREATE_PORT 0x0095 478 480 #define HVCALL_CONNECT_PORT 0x0096 479 481 #define HVCALL_START_VP 0x0099 480 - #define HVCALL_GET_VP_INDEX_FROM_APIC_ID 0x009a 482 + #define HVCALL_GET_VP_INDEX_FROM_APIC_ID 0x009a 481 483 #define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE 0x00af 482 484 #define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_LIST 0x00b0 483 485 #define HVCALL_SIGNAL_EVENT_DIRECT 0x00c0
+40
include/hyperv/hvhdk_mini.h
··· 140 140 141 141 enum hv_system_property { 142 142 /* Add more values when needed */ 143 + HV_SYSTEM_PROPERTY_SLEEP_STATE = 3, 143 144 HV_SYSTEM_PROPERTY_SCHEDULER_TYPE = 15, 144 145 HV_DYNAMIC_PROCESSOR_FEATURE_PROPERTY = 21, 145 146 HV_SYSTEM_PROPERTY_CRASHDUMPAREA = 47, ··· 154 153 u64 base_pfn : 64 - HV_PFN_RANGE_PGBITS; 155 154 u64 add_pfns : HV_PFN_RANGE_PGBITS; 156 155 } __packed; 156 + }; 157 + 158 + enum hv_sleep_state { 159 + HV_SLEEP_STATE_S1 = 1, 160 + HV_SLEEP_STATE_S2 = 2, 161 + HV_SLEEP_STATE_S3 = 3, 162 + HV_SLEEP_STATE_S4 = 4, 163 + HV_SLEEP_STATE_S5 = 5, 164 + /* 165 + * After hypervisor has received this, any follow up sleep 166 + * state registration requests will be rejected. 167 + */ 168 + HV_SLEEP_STATE_LOCK = 6 157 169 }; 158 170 159 171 enum hv_dynamic_processor_feature_property { ··· 196 182 union hv_pfn_range hv_cda_info; /* CrashdumpAreaAddress */ 197 183 u64 hv_tramp_pa; /* CrashdumpTrampolineAddress */ 198 184 }; 185 + } __packed; 186 + 187 + struct hv_sleep_state_info { 188 + u32 sleep_state; /* enum hv_sleep_state */ 189 + u8 pm1a_slp_typ; 190 + u8 pm1b_slp_typ; 191 + } __packed; 192 + 193 + struct hv_input_set_system_property { 194 + u32 property_id; /* enum hv_system_property */ 195 + u32 reserved; 196 + union { 197 + /* More fields to be filled in when needed */ 198 + struct hv_sleep_state_info set_sleep_state_info; 199 + 200 + /* 201 + * Add a reserved field to ensure the union is 8-byte aligned as 202 + * existing members may not be. This is a temporary measure 203 + * until all remaining members are added. 204 + */ 205 + u64 reserved0[8]; 206 + }; 207 + } __packed; 208 + 209 + struct hv_input_enter_sleep_state { /* HV_INPUT_ENTER_SLEEP_STATE */ 210 + u32 sleep_state; /* enum hv_sleep_state */ 199 211 } __packed; 200 212 201 213 struct hv_input_map_stats_page {