iPXE
vmbus.h
Go to the documentation of this file.
1 #ifndef _IPXE_VMBUS_H
2 #define _IPXE_VMBUS_H
3 
4 /** @file
5  *
6  * Hyper-V virtual machine bus
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <byteswap.h>
13 #include <ipxe/uuid.h>
14 #include <ipxe/device.h>
15 #include <ipxe/tables.h>
16 #include <ipxe/uaccess.h>
17 #include <ipxe/iobuf.h>
18 #include <ipxe/hyperv.h>
19 
20 /** VMBus message connection ID */
21 #define VMBUS_MESSAGE_ID 1
22 
23 /** VMBus event connection ID */
24 #define VMBUS_EVENT_ID 2
25 
26 /** VMBus message type */
27 #define VMBUS_MESSAGE_TYPE 1
28 
29 /** VMBus message synthetic interrupt */
30 #define VMBUS_MESSAGE_SINT 2
31 
32 /** VMBus version number */
34  /** Raw version */
36  /** Major/minor version */
37  struct {
38  /** Minor version */
40  /** Major version */
42  };
43 } __attribute__ (( packed ));
44 
45 /** Known VMBus protocol versions */
47  /** Windows Server 2008 */
48  VMBUS_VERSION_WS2008 = ( ( 0 << 16 ) | ( 13 << 0 ) ),
49  /** Windows 7 */
50  VMBUS_VERSION_WIN7 = ( ( 1 << 16 ) | ( 1 << 0 ) ),
51  /** Windows 8 */
52  VMBUS_VERSION_WIN8 = ( ( 2 << 16 ) | ( 4 << 0 ) ),
53  /** Windows 8.1 */
54  VMBUS_VERSION_WIN8_1 = ( ( 3 << 16 ) | ( 0 << 0 ) ),
55 };
56 
57 /** Guest physical address range descriptor */
59  /** Byte count */
61  /** Starting byte offset */
63  /** Page frame numbers
64  *
65  * The length of this array is implied by the byte count and
66  * starting offset.
67  */
69 } __attribute__ (( packed ));
70 
71 /** VMBus message header */
73  /** Message type */
75  /** Reserved */
77 } __attribute__ (( packed ));
78 
79 /** VMBus message types */
95 };
96 
97 /** VMBus "offer channel" message */
99  /** Message header */
101  /** Channel type */
102  union uuid type;
103  /** Channel instance */
104  union uuid instance;
105  /** Reserved */
107  /** Flags */
109  /** Reserved */
111  /** User data */
112  uint8_t data[120];
113  /** Reserved */
115  /** Channel ID */
117  /** Monitor ID */
119  /** Monitor exists */
121  /** Reserved */
123  /** Connection ID */
125 } __attribute__ (( packed ));
126 
127 /** VMBus "open channel" message */
129  /** Message header */
131  /** Channel ID */
133  /** Open ID */
135  /** Ring buffer GPADL ID */
137  /** Reserved */
139  /** Outbound ring buffer size (in pages) */
141  /** User-specific data */
142  uint8_t data[120];
143 } __attribute__ (( packed ));
144 
145 /** VMBus "open channel result" message */
147  /** Message header */
149  /** Channel ID */
151  /** Open ID */
153  /** Status */
155 } __attribute__ (( packed ));
156 
157 /** VMBus "close channel" message */
159  /** Message header */
161  /** Channel ID */
163 } __attribute__ (( packed ));
164 
165 /** VMBus "GPADL header" message */
167  /** Message header */
169  /** Channel ID */
171  /** GPADL ID */
173  /** Length of range descriptors */
175  /** Number of range descriptors */
177  /** Range descriptors */
179 } __attribute__ (( packed ));
180 
181 /** VMBus "GPADL created" message */
183  /** Message header */
185  /** Channel ID */
187  /** GPADL ID */
189  /** Creation status */
191 } __attribute__ (( packed ));
192 
193 /** VMBus "GPADL teardown" message */
195  /** Message header */
197  /** Channel ID */
199  /** GPADL ID */
201 } __attribute__ (( packed ));
202 
203 /** VMBus "GPADL torndown" message */
205  /** Message header */
207  /** GPADL ID */
209 } __attribute__ (( packed ));
210 
211 /** VMBus "initiate contact" message */
213  /** Message header */
215  /** Requested version */
217  /** Target virtual CPU */
219  /** Interrupt page base address */
221  /** Parent to child monitor page base address */
223  /** Child to parent monitor page base address */
225 } __attribute__ (( packed ));
226 
227 /** VMBus "version response" message */
229  /** Message header */
231  /** Version is supported */
233  /** Reserved */
235  /** Version */
237 } __attribute__ (( packed ));
238 
239 /** VMBus message */
241  /** Common message header */
243  /** "Offer channel" message */
245  /** "Open channel" message */
247  /** "Open channel result" message */
249  /** "Close channel" message */
251  /** "GPADL header" message */
253  /** "GPADL created" message */
255  /** "GPADL teardown" message */
257  /** "GPADL torndown" message */
259  /** "Initiate contact" message */
261  /** "Version response" message */
263 };
264 
265 /** VMBus packet header */
267  /** Type */
269  /** Length of packet header (in quadwords) */
271  /** Length of packet (in quadwords) */
273  /** Flags */
275  /** Transaction ID
276  *
277  * This is an opaque token: we therefore treat it as
278  * native-endian and don't worry about byte-swapping.
279  */
281 } __attribute__ (( packed ));
282 
283 /** VMBus packet types */
290 };
291 
292 /** VMBus packet flags */
295 };
296 
297 /** VMBus GPA direct header */
299  /** Packet header */
301  /** Reserved */
303  /** Number of range descriptors */
305  /** Range descriptors */
307 } __attribute__ (( packed ));
308 
309 /** VMBus transfer page range */
311  /** Length */
313  /** Offset */
315 } __attribute__ (( packed ));
316 
317 /** VMBus transfer page header */
319  /** Packet header */
321  /** Page set ID */
323  /** Sender owns page set */
325  /** Reserved */
327  /** Number of range descriptors */
329  /** Range descriptors */
331 } __attribute__ (( packed ));
332 
333 /** Maximum expected size of VMBus packet header */
334 #define VMBUS_PACKET_MAX_HEADER_LEN 64
335 
336 /** VMBus maximum-sized packet header */
338  /** Common header */
340  /** GPA direct header */
342  /** Transfer page header */
344  /** Padding to maximum supported size */
346 } __attribute__ (( packed ));
347 
348 /** VMBus packet footer */
350  /** Reserved */
352  /** Producer index of the first byte of the packet */
354 } __attribute__ (( packed ));
355 
356 /** VMBus ring buffer
357  *
358  * This is the structure of the each of the ring buffers created when
359  * a VMBus channel is opened.
360  */
361 struct vmbus_ring {
362  /** Producer index (modulo ring length) */
364  /** Consumer index (modulo ring length) */
366  /** Interrupt mask */
368  /** Reserved */
370  /** Ring buffer contents */
372 } __attribute__ (( packed ));
373 
374 /** VMBus interrupt page */
376  /** Inbound interrupts */
378  /** Outbound interrupts */
380 } __attribute__ (( packed ));
381 
382 /** A virtual machine bus */
383 struct vmbus {
384  /** Interrupt page */
386  /** Inbound notifications */
388  /** Outbound notifications */
390  /** Received message buffer */
391  const union vmbus_message *message;
392 };
393 
394 struct vmbus_device;
395 
396 /** VMBus channel operations */
398  /**
399  * Handle received control packet
400  *
401  * @v vmdev VMBus device
402  * @v xid Transaction ID
403  * @v data Data
404  * @v len Length of data
405  * @ret rc Return status code
406  */
407  int ( * recv_control ) ( struct vmbus_device *vmdev, uint64_t xid,
408  const void *data, size_t len );
409  /**
410  * Handle received data packet
411  *
412  * @v vmdev VMBus device
413  * @v xid Transaction ID
414  * @v data Data
415  * @v len Length of data
416  * @v list List of I/O buffers
417  * @ret rc Return status code
418  *
419  * This function takes ownership of the I/O buffer. It should
420  * eventually call vmbus_send_completion() to indicate to the
421  * host that the buffer can be reused.
422  */
423  int ( * recv_data ) ( struct vmbus_device *vmdev, uint64_t xid,
424  const void *data, size_t len,
425  struct list_head *list );
426  /**
427  * Handle received completion packet
428  *
429  * @v vmdev VMBus device
430  * @v xid Transaction ID
431  * @v data Data
432  * @v len Length of data
433  * @ret rc Return status code
434  */
435  int ( * recv_completion ) ( struct vmbus_device *vmdev, uint64_t xid,
436  const void *data, size_t len );
437  /**
438  * Handle received cancellation packet
439  *
440  * @v vmdev VMBus device
441  * @v xid Transaction ID
442  * @ret rc Return status code
443  */
444  int ( * recv_cancellation ) ( struct vmbus_device *vmdev,
445  uint64_t xid );
446 };
447 
448 struct vmbus_xfer_pages;
449 
450 /** VMBus transfer page set operations */
452  /**
453  * Copy data from transfer page
454  *
455  * @v pages Transfer page set
456  * @v data Data buffer
457  * @v offset Offset within page set
458  * @v len Length within page set
459  * @ret rc Return status code
460  */
461  int ( * copy ) ( struct vmbus_xfer_pages *pages, void *data,
462  size_t offset, size_t len );
463 };
464 
465 /** VMBus transfer page set */
467  /** List of all transfer page sets */
468  struct list_head list;
469  /** Page set ID (in protocol byte order) */
471  /** Page set operations */
473 };
474 
475 /** A VMBus device */
476 struct vmbus_device {
477  /** Generic iPXE device */
478  struct device dev;
479  /** Hyper-V hypervisor */
480  struct hv_hypervisor *hv;
481 
482  /** Channel instance */
483  union uuid instance;
484  /** Channel ID */
485  unsigned int channel;
486  /** Monitor ID */
487  unsigned int monitor;
488  /** Signal channel
489  *
490  * @v vmdev VMBus device
491  */
492  void ( * signal ) ( struct vmbus_device *vmdev );
493 
494  /** Outbound ring buffer length */
496  /** Inbound ring buffer length */
498  /** Outbound ring buffer */
499  struct vmbus_ring *out;
500  /** Inbound ring buffer */
501  struct vmbus_ring *in;
502  /** Ring buffer GPADL ID */
503  unsigned int gpadl;
504 
505  /** Channel operations */
507  /** Maximum expected data packet length */
508  size_t mtu;
509  /** Packet buffer */
510  void *packet;
511  /** List of transfer page sets */
512  struct list_head pages;
513 
514  /** Driver */
516  /** Driver-private data */
517  void *priv;
518 };
519 
520 /** A VMBus device driver */
521 struct vmbus_driver {
522  /** Name */
523  const char *name;
524  /** Device type */
525  union uuid type;
526  /** Probe device
527  *
528  * @v vmdev VMBus device
529  * @ret rc Return status code
530  */
531  int ( * probe ) ( struct vmbus_device *vmdev );
532  /** Reset device
533  *
534  * @v vmdev VMBus device
535  * @ret rc Return status code
536  */
537  int ( * reset ) ( struct vmbus_device *vmdev );
538  /** Remove device
539  *
540  * @v vmdev VMBus device
541  */
542  void ( * remove ) ( struct vmbus_device *vmdev );
543 };
544 
545 /** VMBus device driver table */
546 #define VMBUS_DRIVERS __table ( struct vmbus_driver, "vmbus_drivers" )
547 
548 /** Declare a VMBus device driver */
549 #define __vmbus_driver __table_entry ( VMBUS_DRIVERS, 01 )
550 
551 /**
552  * Set VMBus device driver-private data
553  *
554  * @v vmdev VMBus device
555  * @v priv Private data
556  */
557 static inline void vmbus_set_drvdata ( struct vmbus_device *vmdev, void *priv ){
558  vmdev->priv = priv;
559 }
560 
561 /**
562  * Get VMBus device driver-private data
563  *
564  * @v vmdev VMBus device
565  * @ret priv Private data
566  */
567 static inline void * vmbus_get_drvdata ( struct vmbus_device *vmdev ) {
568  return vmdev->priv;
569 }
570 
571 /** Construct VMBus type */
572 #define VMBUS_TYPE( a, b, c, d, e0, e1, e2, e3, e4, e5 ) { \
573  .canonical = { \
574  cpu_to_le32 ( a ), cpu_to_le16 ( b ), \
575  cpu_to_le16 ( c ), cpu_to_be16 ( d ), \
576  { e0, e1, e2, e3, e4, e5 } \
577  } }
578 
579 /**
580  * Check if data is present in ring buffer
581  *
582  * @v vmdev VMBus device
583  * @v has_data Data is present
584  */
585 static inline __attribute__ (( always_inline )) int
586 vmbus_has_data ( struct vmbus_device *vmdev ) {
587 
588  return ( vmdev->in->prod != vmdev->in->cons );
589 }
590 
591 /**
592  * Register transfer page set
593  *
594  * @v vmdev VMBus device
595  * @v pages Transfer page set
596  * @ret rc Return status code
597  */
598 static inline __attribute__ (( always_inline )) int
600  struct vmbus_xfer_pages *pages ) {
601 
602  list_add ( &pages->list, &vmdev->pages );
603  return 0;
604 }
605 
606 /**
607  * Unregister transfer page set
608  *
609  * @v vmdev VMBus device
610  * @v pages Transfer page set
611  */
612 static inline __attribute__ (( always_inline )) void
614  struct vmbus_xfer_pages *pages ) {
615 
616  list_check_contains_entry ( pages, &vmdev->pages, list );
617  list_del ( &pages->list );
618 }
619 
620 extern unsigned int vmbus_obsolete_gpadl;
621 
622 /**
623  * Check if GPADL is obsolete
624  *
625  * @v gpadl GPADL ID
626  * @v is_obsolete GPADL ID is obsolete
627  *
628  * Check if GPADL is obsolete (i.e. was created before the most recent
629  * Hyper-V reset).
630  */
631 static inline __attribute__ (( always_inline )) int
632 vmbus_gpadl_is_obsolete ( unsigned int gpadl ) {
633 
634  return ( gpadl <= vmbus_obsolete_gpadl );
635 }
636 
637 extern int vmbus_establish_gpadl ( struct vmbus_device *vmdev, userptr_t data,
638  size_t len );
639 extern int vmbus_gpadl_teardown ( struct vmbus_device *vmdev,
640  unsigned int gpadl );
641 extern int vmbus_open ( struct vmbus_device *vmdev,
643  size_t out_len, size_t in_len, size_t mtu );
644 extern void vmbus_close ( struct vmbus_device *vmdev );
645 extern int vmbus_send_control ( struct vmbus_device *vmdev, uint64_t xid,
646  const void *data, size_t len );
647 extern int vmbus_send_data ( struct vmbus_device *vmdev, uint64_t xid,
648  const void *data, size_t len,
649  struct io_buffer *iobuf );
650 extern int vmbus_send_completion ( struct vmbus_device *vmdev, uint64_t xid,
651  const void *data, size_t len );
652 extern int vmbus_send_cancellation ( struct vmbus_device *vmdev, uint64_t xid );
653 extern int vmbus_poll ( struct vmbus_device *vmdev );
654 extern void vmbus_dump_channel ( struct vmbus_device *vmdev );
655 
656 extern int vmbus_probe ( struct hv_hypervisor *hv, struct device *parent );
657 extern int vmbus_reset ( struct hv_hypervisor *hv, struct device *parent );
658 extern void vmbus_remove ( struct hv_hypervisor *hv, struct device *parent );
659 
660 #endif /* _IPXE_VMBUS_H */
uint32_t channel
Channel ID.
Definition: vmbus.h:150
#define __attribute__(x)
Definition: compiler.h:10
VMBus transfer page header.
Definition: vmbus.h:318
struct vmbus_message_header header
Message header.
Definition: vmbus.h:184
const char * name
Name.
Definition: vmbus.h:523
uint32_t channel
Channel ID.
Definition: vmbus.h:162
unsigned short uint16_t
Definition: stdint.h:11
struct vmbus_ring * out
Outbound ring buffer.
Definition: vmbus.h:499
uint8_t out[PAGE_SIZE/2]
Outbound interrupts.
Definition: vmbus.h:379
uint32_t raw
Raw version.
Definition: vmbus.h:35
struct vmbus_xfer_page_header xfer
Transfer page header.
Definition: vmbus.h:343
VMBus message header.
Definition: vmbus.h:72
struct device dev
Generic iPXE device.
Definition: vmbus.h:478
uint8_t padding[VMBUS_PACKET_MAX_HEADER_LEN]
Padding to maximum supported size.
Definition: vmbus.h:345
static int vmbus_has_data(struct vmbus_device *vmdev)
Check if data is present in ring buffer.
Definition: vmbus.h:586
uint16_t type
Type.
Definition: vmbus.h:268
struct vmbus_offer_channel offer
"Offer channel" message
Definition: vmbus.h:244
uint8_t reserved_b[2]
Reserved.
Definition: vmbus.h:110
void vmbus_close(struct vmbus_device *vmdev)
Close VMBus channel.
Definition: vmbus.c:524
int vmbus_poll(struct vmbus_device *vmdev)
Poll ring buffer.
Definition: vmbus.c:972
VMBus message.
Definition: vmbus.h:240
int(* recv_control)(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len)
Handle received control packet.
Definition: vmbus.h:407
struct vmbus_message_header header
Message header.
Definition: vmbus.h:230
#define list_add(new, head)
Add a new entry to the head of a list.
Definition: list.h:69
int(* recv_data)(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len, struct list_head *list)
Handle received data packet.
Definition: vmbus.h:423
uint32_t offset
Starting byte offset.
Definition: vmbus.h:62
A universally unique ID.
Definition: uuid.h:15
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct list_head list
List of all transfer page sets.
Definition: vmbus.h:468
uint8_t monitor
Monitor ID.
Definition: vmbus.h:118
struct vmbus_channel_operations * op
Channel operations.
Definition: vmbus.h:506
int(* recv_completion)(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len)
Handle received completion packet.
Definition: vmbus.h:435
A monitor page.
Definition: hyperv.h:165
I/O buffers.
uint32_t channel
Channel ID.
Definition: vmbus.h:116
uint32_t connection
Connection ID.
Definition: vmbus.h:124
int vmbus_send_data(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len, struct io_buffer *iobuf)
Send data packet via ring buffer.
Definition: vmbus.c:794
uint64_t monitor_in
Parent to child monitor page base address.
Definition: vmbus.h:222
uint8_t in[PAGE_SIZE/2]
Inbound interrupts.
Definition: vmbus.h:377
#define VMBUS_PACKET_MAX_HEADER_LEN
Maximum expected size of VMBus packet header.
Definition: vmbus.h:334
uint64_t monitor_out
Child to parent monitor page base address.
Definition: vmbus.h:224
uint32_t len
Byte count.
Definition: vmbus.h:60
vmbus_message_type
VMBus message types.
Definition: vmbus.h:80
A VMBus device.
Definition: vmbus.h:476
uint32_t status
Status.
Definition: vmbus.h:154
unsigned long long uint64_t
Definition: stdint.h:13
VMBus maximum-sized packet header.
Definition: vmbus.h:337
struct vmbus_message_header header
Message header.
Definition: vmbus.h:196
void * priv
Driver-private data.
Definition: vmbus.h:517
Universally unique IDs.
uint8_t owner
Sender owns page set.
Definition: vmbus.h:324
uint32_t out_len
Outbound ring buffer length.
Definition: vmbus.h:495
uint8_t reserved[4084]
Reserved.
Definition: vmbus.h:369
uint32_t gpadl
GPADL ID.
Definition: vmbus.h:208
struct vmbus_xfer_pages_operations * op
Page set operations.
Definition: vmbus.h:472
#define PAGE_SIZE
Page size.
Definition: io.h:27
struct vmbus_gpa_direct_header gpa
GPA direct header.
Definition: vmbus.h:341
uint8_t data[120]
User-specific data.
Definition: vmbus.h:142
uint64_t intr
Interrupt page base address.
Definition: vmbus.h:220
uint8_t reserved[3]
Reserved.
Definition: vmbus.h:234
union vmbus_version version
Requested version.
Definition: vmbus.h:216
uint32_t status
Creation status.
Definition: vmbus.h:190
Access to external ("user") memory.
VMBus "open channel" message.
Definition: vmbus.h:128
VMBus "GPADL created" message.
Definition: vmbus.h:182
vmbus_packet_type
VMBus packet types.
Definition: vmbus.h:284
struct vmbus_gpadl_torndown torndown
"GPADL torndown" message
Definition: vmbus.h:258
struct vmbus_packet_header header
Packet header.
Definition: vmbus.h:320
int vmbus_send_control(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len)
Send control packet via ring buffer.
Definition: vmbus.c:765
A doubly-linked list entry (or list head)
Definition: list.h:18
static int vmbus_register_pages(struct vmbus_device *vmdev, struct vmbus_xfer_pages *pages)
Register transfer page set.
Definition: vmbus.h:599
VMBus "version response" message.
Definition: vmbus.h:228
struct vmbus_packet_header header
Common header.
Definition: vmbus.h:339
struct vmbus_gpa_range range[0]
Range descriptors.
Definition: vmbus.h:306
uint16_t pageset
Page set ID.
Definition: vmbus.h:322
const union vmbus_message * message
Received message buffer.
Definition: vmbus.h:391
Hyper-V interface.
Guest physical address range descriptor.
Definition: vmbus.h:58
uint32_t vcpu
Target virtual CPU.
Definition: vmbus.h:218
#define list_del(list)
Delete an entry from a list.
Definition: list.h:119
VMBus "initiate contact" message.
Definition: vmbus.h:212
uint32_t gpadl
GPADL ID.
Definition: vmbus.h:188
A hardware device.
Definition: device.h:73
uint32_t channel
Channel ID.
Definition: vmbus.h:186
uint32_t range_count
Number of range descriptors.
Definition: vmbus.h:328
uint32_t prod
Producer index (modulo ring length)
Definition: vmbus.h:363
uint8_t reserved
Reserved.
Definition: vmbus.h:326
uint16_t pageset
Page set ID (in protocol byte order)
Definition: vmbus.h:470
uint32_t channel
Channel ID.
Definition: vmbus.h:170
static int vmbus_gpadl_is_obsolete(unsigned int gpadl)
Check if GPADL is obsolete.
Definition: vmbus.h:632
uint32_t cons
Consumer index (modulo ring length)
Definition: vmbus.h:365
int vmbus_gpadl_teardown(struct vmbus_device *vmdev, unsigned int gpadl)
Tear down GPA descriptor list.
Definition: vmbus.c:347
struct vmbus_packet_header header
Packet header.
Definition: vmbus.h:300
uint32_t intr_mask
Interrupt mask.
Definition: vmbus.h:367
struct vmbus_message_header header
Message header.
Definition: vmbus.h:130
struct vmbus_gpa_range range[0]
Range descriptors.
Definition: vmbus.h:178
VMBus packet header.
Definition: vmbus.h:266
uint32_t in_len
Inbound ring buffer length.
Definition: vmbus.h:497
uint32_t reserved
Reserved.
Definition: vmbus.h:138
struct vmbus_message_header header
Message header.
Definition: vmbus.h:168
void * packet
Packet buffer.
Definition: vmbus.h:510
int vmbus_probe(struct hv_hypervisor *hv, struct device *parent)
Probe Hyper-V virtual machine bus.
Definition: vmbus.c:1365
int vmbus_send_cancellation(struct vmbus_device *vmdev, uint64_t xid)
Send cancellation packet via ring buffer.
Definition: vmbus.c:857
static userptr_t size_t offset
Offset of the first segment within the content.
Definition: deflate.h:259
struct vmbus_close_channel close
"Close channel" message
Definition: vmbus.h:250
A virtual machine bus.
Definition: vmbus.h:383
union uuid type
Channel type.
Definition: vmbus.h:102
uint16_t range_len
Length of range descriptors.
Definition: vmbus.h:174
unsigned int vmbus_obsolete_gpadl
Obsolete GPADL ID threshold.
Definition: vmbus.c:61
VMBus "GPADL torndown" message.
Definition: vmbus.h:204
uint64_t xid
Transaction ID.
Definition: vmbus.h:280
Windows 7.
Definition: vmbus.h:50
struct vmbus_gpadl_created created
"GPADL created" message
Definition: vmbus.h:254
VMBus GPA direct header.
Definition: vmbus.h:298
uint8_t data[0]
Ring buffer contents.
Definition: vmbus.h:371
Windows 8.1.
Definition: vmbus.h:54
uint16_t minor
Minor version.
Definition: vmbus.h:39
static void * vmbus_get_drvdata(struct vmbus_device *vmdev)
Get VMBus device driver-private data.
Definition: vmbus.h:567
union uuid type
Device type.
Definition: vmbus.h:525
struct vmbus_driver * driver
Driver.
Definition: vmbus.h:515
uint32_t channel
Channel ID.
Definition: vmbus.h:198
struct vmbus_gpadl_header gpadlhdr
"GPADL header" message
Definition: vmbus.h:252
A VMBus device driver.
Definition: vmbus.h:521
uint32_t offset
Offset.
Definition: vmbus.h:314
unsigned char uint8_t
Definition: stdint.h:10
struct hv_monitor * monitor_in
Inbound notifications.
Definition: vmbus.h:387
uint32_t gpadl
GPADL ID.
Definition: netvsc.h:14
static void vmbus_unregister_pages(struct vmbus_device *vmdev, struct vmbus_xfer_pages *pages)
Unregister transfer page set.
Definition: vmbus.h:613
struct vmbus_ring * in
Inbound ring buffer.
Definition: vmbus.h:501
uint8_t supported
Version is supported.
Definition: vmbus.h:232
unsigned int uint32_t
Definition: stdint.h:12
Windows 8.
Definition: vmbus.h:52
int vmbus_establish_gpadl(struct vmbus_device *vmdev, userptr_t data, size_t len)
Establish GPA descriptor list.
Definition: vmbus.c:276
uint32_t reserved
Reserved.
Definition: vmbus.h:76
int(* copy)(struct vmbus_xfer_pages *pages, void *data, size_t offset, size_t len)
Copy data from transfer page.
Definition: vmbus.h:461
vmbus_raw_version
Known VMBus protocol versions.
Definition: vmbus.h:46
uint8_t monitored
Monitor exists.
Definition: vmbus.h:120
uint32_t gpadl
GPADL ID.
Definition: vmbus.h:172
void vmbus_dump_channel(struct vmbus_device *vmdev)
Dump channel status (for debugging)
Definition: vmbus.c:1089
uint16_t range_count
Number of range descriptors.
Definition: vmbus.h:176
vmbus_packet_flags
VMBus packet flags.
Definition: vmbus.h:293
uint32_t gpadl
GPADL ID.
Definition: vmbus.h:200
struct vmbus_version_response version
"Version response" message
Definition: vmbus.h:262
uint32_t id
Open ID.
Definition: vmbus.h:152
VMBus transfer page set operations.
Definition: vmbus.h:451
uint16_t qlen
Length of packet (in quadwords)
Definition: vmbus.h:272
VMBus interrupt page.
Definition: vmbus.h:375
struct vmbus_open_channel open
"Open channel" message
Definition: vmbus.h:246
static uint16_t struct vmbus_xfer_pages_operations * op
Definition: netvsc.h:327
A Hyper-V hypervisor.
Definition: hyperv.h:203
VMBus transfer page set.
Definition: vmbus.h:466
VMBus "open channel result" message.
Definition: vmbus.h:146
unsigned int channel
Channel ID.
Definition: vmbus.h:485
union vmbus_version version
Version.
Definition: vmbus.h:236
unsigned int monitor
Monitor ID.
Definition: vmbus.h:487
uint32_t len
Length.
Definition: ena.h:14
VMBus "close channel" message.
Definition: vmbus.h:158
uint32_t len
Length.
Definition: vmbus.h:312
int vmbus_open(struct vmbus_device *vmdev, struct vmbus_channel_operations *op, size_t out_len, size_t in_len, size_t mtu)
Open VMBus channel.
Definition: vmbus.c:403
uint64_t pfn[0]
Page frame numbers.
Definition: vmbus.h:68
struct hv_hypervisor * hv
Hyper-V hypervisor.
Definition: vmbus.h:480
struct vmbus_initiate_contact initiate
"Initiate contact" message
Definition: vmbus.h:260
static struct tlan_private * priv
Definition: tlan.c:224
VMBus channel operations.
Definition: vmbus.h:397
struct vmbus_message_header header
Message header.
Definition: vmbus.h:214
uint32_t mtu
Maximum MTU.
Definition: ena.h:28
struct vmbus_message_header header
Message header.
Definition: vmbus.h:148
unsigned int gpadl
Ring buffer GPADL ID.
Definition: vmbus.h:503
VMBus "offer channel" message.
Definition: vmbus.h:98
uint8_t reserved_a[16]
Reserved.
Definition: vmbus.h:106
uint8_t data[120]
User data.
Definition: vmbus.h:112
struct vmbus_open_channel_result opened
"Open channel result" message
Definition: vmbus.h:248
struct vmbus_interrupt * intr
Interrupt page.
Definition: vmbus.h:385
struct vmbus_gpadl_teardown teardown
"GPADL teardown" message
Definition: vmbus.h:256
uint32_t range_count
Number of range descriptors.
Definition: vmbus.h:304
struct vmbus_message_header header
Message header.
Definition: vmbus.h:206
uint8_t data[48]
Additional event data.
Definition: ena.h:22
int vmbus_send_completion(struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len)
Send completion packet via ring buffer.
Definition: vmbus.c:834
Windows Server 2008.
Definition: vmbus.h:48
union uuid instance
Channel instance.
Definition: vmbus.h:104
Linker tables.
union uuid instance
Channel instance.
Definition: vmbus.h:483
int(* probe)(struct vmbus_device *vmdev)
Probe device.
Definition: vmbus.h:531
void(* remove)(struct vmbus_device *vmdev)
Remove device.
Definition: vmbus.h:542
VMBus ring buffer.
Definition: vmbus.h:361
uint16_t major
Major version.
Definition: vmbus.h:41
uint16_t flags
Flags.
Definition: vmbus.h:108
Device model.
struct hv_monitor * monitor_out
Outbound notifications.
Definition: vmbus.h:389
uint32_t type
Message type.
Definition: vmbus.h:74
uint16_t hdr_qlen
Length of packet header (in quadwords)
Definition: vmbus.h:270
uint16_t flags
Flags.
Definition: vmbus.h:274
VMBus "GPADL teardown" message.
Definition: vmbus.h:194
void(* signal)(struct vmbus_device *vmdev)
Signal channel.
Definition: vmbus.h:492
uint32_t out_pages
Outbound ring buffer size (in pages)
Definition: vmbus.h:140
static void vmbus_set_drvdata(struct vmbus_device *vmdev, void *priv)
Set VMBus device driver-private data.
Definition: vmbus.h:557
uint32_t id
Open ID.
Definition: vmbus.h:134
uint8_t reserved[2]
Reserved.
Definition: vmbus.h:122
struct vmbus_message_header header
Message header.
Definition: vmbus.h:160
#define list_check_contains_entry(entry, head, member)
Check list contains a specified entry.
Definition: list.h:549
struct list_head pages
List of transfer page sets.
Definition: vmbus.h:512
struct vmbus_message_header header
Common message header.
Definition: vmbus.h:242
size_t mtu
Maximum expected data packet length.
Definition: vmbus.h:508
VMBus "GPADL header" message.
Definition: vmbus.h:166
uint8_t reserved_c[4]
Reserved.
Definition: vmbus.h:114
void vmbus_remove(struct hv_hypervisor *hv, struct device *parent)
Remove Hyper-V virtual machine bus.
Definition: vmbus.c:1458
int vmbus_reset(struct hv_hypervisor *hv, struct device *parent)
Reset Hyper-V virtual machine bus.
Definition: vmbus.c:1426
VMBus transfer page range.
Definition: vmbus.h:310
uint32_t reserved
Reserved.
Definition: vmbus.h:302
struct vmbus_message_header header
Message header.
Definition: vmbus.h:100
int(* recv_cancellation)(struct vmbus_device *vmdev, uint64_t xid)
Handle received cancellation packet.
Definition: vmbus.h:444
VMBus version number.
Definition: vmbus.h:33
unsigned long userptr_t
A pointer to a user buffer.
Definition: uaccess.h:33
uint32_t channel
Channel ID.
Definition: vmbus.h:132
A persistent I/O buffer.
Definition: iobuf.h:33
int(* reset)(struct vmbus_device *vmdev)
Reset device.
Definition: vmbus.h:537
uint32_t gpadl
Ring buffer GPADL ID.
Definition: vmbus.h:136
struct vmbus_xfer_page_range range[0]
Range descriptors.
Definition: vmbus.h:330