iPXE
|
Hyper-V interface. More...
Go to the source code of this file.
Data Structures | |
struct | hv_post_message |
A posted message. More... | |
struct | hv_message |
A received message. More... | |
struct | hv_signal_event |
A signalled event. More... | |
struct | hv_event |
A received event. More... | |
struct | hv_monitor_trigger |
A monitor trigger group. More... | |
struct | hv_monitor_parameter |
A monitor parameter set. More... | |
struct | hv_monitor |
A monitor page. More... | |
struct | hv_synic |
A synthetic interrupt controller. More... | |
union | hv_message_buffer |
A message buffer. More... | |
struct | hv_hypervisor |
A Hyper-V hypervisor. More... | |
Macros | |
#define | HV_INTERFACE_ID 0x31237648 /* "Hv#1" */ |
Hyper-V interface identification. More... | |
#define | HV_GUEST_OS_ID_IPXE ( ( 1ULL << 63 ) | ( 0x18aeULL << 48 ) ) |
Guest OS identity for iPXE. More... | |
#define | HV_GUEST_OS_ID_UEFI ( 1ULL << 40 ) |
Guest OS identity for Gen 2 UEFI firmware. More... | |
#define | HV_HYPERCALL_ENABLE 0x00000001UL |
Enable hypercall page. More... | |
#define | HV_SCONTROL_ENABLE 0x00000001UL |
Enable SynIC. More... | |
#define | HV_SIEFP_ENABLE 0x00000001UL |
Enable SynIC event flags. More... | |
#define | HV_SIMP_ENABLE 0x00000001UL |
Enable SynIC messages. More... | |
#define | HV_SINT_AUTO_EOI 0x00020000UL |
Perform implicit EOI upon synthetic interrupt delivery. More... | |
#define | HV_SINT_MASKED 0x00010000UL |
Mask synthetic interrupt. More... | |
#define | HV_SINT_VECTOR(x) ( (x) << 0 ) |
Synthetic interrupt vector. More... | |
#define | HV_SINT_VECTOR_MASK HV_SINT_VECTOR ( 0xff ) |
Synthetic interrupt vector mask. More... | |
#define | HV_SINT_MAX 15 |
Maximum synthetic interrupt number. More... | |
#define | HV_POST_MESSAGE 0x005c |
Post message. More... | |
#define | HV_SIGNAL_EVENT 0x005d |
Signal event. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
struct hv_post_message | __attribute__ ((packed)) |
static unsigned int | hv_pfn_count (physaddr_t data, size_t len) |
Calculate the number of pages covering an address range. More... | |
__attribute__ ((sentinel)) int hv_alloc_pages(struct hv_hypervisor *hv | |
void | hv_enable_sint (struct hv_hypervisor *hv, unsigned int sintx) |
Enable synthetic interrupt. More... | |
void | hv_disable_sint (struct hv_hypervisor *hv, unsigned int sintx) |
Disable synthetic interrupt. More... | |
int | hv_post_message (struct hv_hypervisor *hv, unsigned int id, unsigned int type, const void *data, size_t len) |
Post message. More... | |
int | hv_wait_for_message (struct hv_hypervisor *hv, unsigned int sintx) |
Wait for received message. More... | |
int | hv_signal_event (struct hv_hypervisor *hv, unsigned int id, unsigned int flag) |
Signal event. More... | |
Variables | |
uint32_t | id |
Connection ID. More... | |
uint32_t | reserved |
Padding. More... | |
uint32_t | type |
Type. More... | |
uint32_t | len |
Length of message. More... | |
uint8_t | data [240] |
Message. More... | |
uint8_t | flags |
Flags. More... | |
uint64_t | origin |
Origin. More... | |
uint16_t | flag |
Flag number. More... | |
uint32_t | pending |
Pending events. More... | |
uint32_t | armed |
Armed events. More... | |
uint8_t | reserved_a [4] |
Reserved. More... | |
struct hv_monitor_trigger | trigger [4] |
Trigger groups. More... | |
uint8_t | reserved_b [536] |
Reserved. More... | |
uint16 | latency [4][32] |
Latencies. More... | |
uint8_t | reserved_c [256] |
Reserved. More... | |
struct hv_monitor_parameter | param [4][32] |
Parameters. More... | |
uint8_t | reserved_d [1984] |
Reserved. More... | |
struct hv_synic | __attribute__ |
Hyper-V interface.
Definition in file hyperv.h.
#define HV_INTERFACE_ID 0x31237648 /* "Hv#1" */ |
#define HV_GUEST_OS_ID_IPXE ( ( 1ULL << 63 ) | ( 0x18aeULL << 48 ) ) |
Guest OS identity for iPXE.
This field comprises:
Bit 63 : set to 1 to indicate an open source OS Bits 62:56 : OS Type Bits 55:48 : OS ID Bits 47:16 : Version Bits 15:0 : Build number
There appears to be no central registry for the "OS Type". The specification states that "Linux is 0x100", and the FreeBSD source states that "FreeBSD is 0x200". Both of these statements are actually referring to the combined "OS Type" and "OS ID" field.
We choose to use 0x98ae: this is generated by setting bit 63 (to indicate an open source OS) and setting the OS Type+ID equal to the PnP vendor ID used in romprefix.S. No version information or build number is included.
#define HV_GUEST_OS_ID_UEFI ( 1ULL << 40 ) |
#define HV_HYPERCALL_ENABLE 0x00000001UL |
#define HV_SIEFP_ENABLE 0x00000001UL |
#define HV_SINT_AUTO_EOI 0x00020000UL |
#define HV_SINT_MASKED 0x00010000UL |
#define HV_SINT_VECTOR | ( | x | ) | ( (x) << 0 ) |
#define HV_SINT_VECTOR_MASK HV_SINT_VECTOR ( 0xff ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
struct hv_post_message __attribute__ | ( | (packed) | ) |
|
inlinestatic |
Calculate the number of pages covering an address range.
data | Start of data |
len | Length of data (must be non-zero) |
pfn_count | Number of pages covered |
Definition at line 223 of file hyperv.h.
References data, len, and PAGE_SIZE.
Referenced by vmbus_establish_gpadl(), and vmbus_send_data().
__attribute__ | ( | (sentinel) | ) |
void hv_enable_sint | ( | struct hv_hypervisor * | hv, |
unsigned int | sintx | ||
) |
Enable synthetic interrupt.
hv | Hyper-V hypervisor |
sintx | Synthetic interrupt number |
Definition at line 397 of file hyperv.c.
References DBGC2, HV_SINT_AUTO_EOI, HV_SINT_MASKED, HV_SINT_VECTOR, HV_SINT_VECTOR_MASK, HV_X64_MSR_SINT, and IRQ_INT.
Referenced by vmbus_probe(), and vmbus_reset().
void hv_disable_sint | ( | struct hv_hypervisor * | hv, |
unsigned int | sintx | ||
) |
Disable synthetic interrupt.
hv | Hyper-V hypervisor |
sintx | Synthetic interrupt number |
Definition at line 423 of file hyperv.c.
References DBGC2, HV_SINT_AUTO_EOI, HV_SINT_MASKED, and HV_X64_MSR_SINT.
Referenced by hv_quiesce(), vmbus_probe(), and vmbus_remove().
int hv_post_message | ( | struct hv_hypervisor * | hv, |
unsigned int | id, | ||
unsigned int | type, | ||
const void * | data, | ||
size_t | len | ||
) |
Post message.
hv | Hyper-V hypervisor |
id | Connection ID |
type | Message type |
data | Message |
len | Length of message |
rc | Return status code |
Definition at line 449 of file hyperv.c.
References assert(), cpu_to_le32, data, DBGC, DBGC2, DBGC2_HDA, EHV, HV_POST_MESSAGE, len, memcpy(), memset(), hv_hypervisor::message, msg(), NULL, hv_message_buffer::posted, rc, status, strerror(), and type.
int hv_wait_for_message | ( | struct hv_hypervisor * | hv, |
unsigned int | sintx | ||
) |
Wait for received message.
hv | Hyper-V hypervisor |
sintx | Synthetic interrupt number |
rc | Return status code |
Definition at line 486 of file hyperv.c.
References assert(), data, DBGC, DBGC2, DBGC2_HDA, ETIMEDOUT, HV_MESSAGE_MAX_WAIT_MS, HV_X64_MSR_EOM, le32_to_cpu, len, mdelay(), memcpy(), memset(), hv_synic::message, hv_hypervisor::message, msg(), offsetof, hv_message_buffer::received, src, hv_hypervisor::synic, and typeof().
Referenced by vmbus_wait_for_any_message().
int hv_signal_event | ( | struct hv_hypervisor * | hv, |
unsigned int | id, | ||
unsigned int | flag | ||
) |
Signal event.
hv | Hyper-V hypervisor |
id | Connection ID |
flag | Flag number |
rc | Return status code |
Definition at line 535 of file hyperv.c.
References cpu_to_le16, cpu_to_le32, DBGC, EHV, flag, HV_SIGNAL_EVENT, memset(), hv_hypervisor::message, NULL, rc, hv_message_buffer::signalled, status, and strerror().
uint8_t len |
uint8_t data[240] |
uint64_t origin |
Origin.
Definition at line 20 of file hyperv.h.
Referenced by efi_snp_hii_fetch(), fetch_setting(), fetch_setting_alloc(), fetch_setting_copy(), fetchf_setting(), fetchf_setting_copy(), fetchn_setting(), ibft_fill_nic(), ibft_set_string_setting(), ipv6_create_routes(), and show_exec().
uint32_t pending |
Pending events.
Definition at line 12 of file hyperv.h.
Referenced by ath5k_hw_stop_tx_dma(), b44_process_rx_packets(), b44_rx_refill(), is_pending(), pending_get(), pending_put(), pending_rx_index(), pending_tx_index(), and sis190_process_tx().
struct hv_monitor_trigger trigger[4] |
struct hv_monitor_parameter param[4][32] |
Parameters.
Definition at line 24 of file hyperv.h.
Referenced by a3c90x_internal_IssueCommand(), add_parameter(), ansiesc_process(), ar5008_hw_ani_control_new(), ar5008_hw_ani_control_old(), ar9003_hw_ani_control(), ath9k_hw_4k_get_eeprom(), ath9k_hw_ani_control(), ath9k_hw_ar9287_get_eeprom(), ath9k_hw_ar9300_get_eeprom(), ath9k_hw_def_get_eeprom(), fc_els_prli_tx(), fc_ulp_login(), fcp_prli_tx(), fcpdev_scsi_command(), fcpeerstat(), free_parameters(), http_form_params(), http_format_headers(), linda_set_serdes_param(), param_exec(), uri_params_list_okx(), uri_params_okx(), and xen_hvm_get_param().
struct hv_synic __attribute__ |