1 // SPDX-License-Identifier: GPL-2.0-only
3 * virtio transport for vsock
5 * Copyright (C) 2013-2015 Red Hat, Inc.
6 * Author: Asias He <asias@redhat.com>
7 * Stefan Hajnoczi <stefanha@redhat.com>
9 * Some of the code is take from Gerd Hoffmann <kraxel@redhat.com>'s
10 * early virtio-vsock proof-of-concept bits.
12 #include <linux/spinlock.h>
13 #include <linux/module.h>
14 #include <linux/list.h>
15 #include <linux/atomic.h>
16 #include <linux/virtio.h>
17 #include <linux/virtio_ids.h>
18 #include <linux/virtio_config.h>
19 #include <linux/virtio_vsock.h>
21 #include <linux/mutex.h>
22 #include <net/af_vsock.h>
24 static struct workqueue_struct
*virtio_vsock_workqueue
;
25 static struct virtio_vsock __rcu
*the_virtio_vsock
;
26 static DEFINE_MUTEX(the_virtio_vsock_mutex
); /* protects the_virtio_vsock */
29 struct virtio_device
*vdev
;
30 struct virtqueue
*vqs
[VSOCK_VQ_MAX
];
32 /* Virtqueue processing is deferred to a workqueue */
33 struct work_struct tx_work
;
34 struct work_struct rx_work
;
35 struct work_struct event_work
;
37 /* The following fields are protected by tx_lock. vqs[VSOCK_VQ_TX]
38 * must be accessed with tx_lock held.
43 struct work_struct send_pkt_work
;
44 spinlock_t send_pkt_list_lock
;
45 struct list_head send_pkt_list
;
47 struct work_struct loopback_work
;
48 spinlock_t loopback_list_lock
; /* protects loopback_list */
49 struct list_head loopback_list
;
51 atomic_t queued_replies
;
53 /* The following fields are protected by rx_lock. vqs[VSOCK_VQ_RX]
54 * must be accessed with rx_lock held.
61 /* The following fields are protected by event_lock.
62 * vqs[VSOCK_VQ_EVENT] must be accessed with event_lock held.
64 struct mutex event_lock
;
66 struct virtio_vsock_event event_list
[8];
71 static u32
virtio_transport_get_local_cid(void)
73 struct virtio_vsock
*vsock
;
77 vsock
= rcu_dereference(the_virtio_vsock
);
83 ret
= vsock
->guest_cid
;
89 static void virtio_transport_loopback_work(struct work_struct
*work
)
91 struct virtio_vsock
*vsock
=
92 container_of(work
, struct virtio_vsock
, loopback_work
);
95 spin_lock_bh(&vsock
->loopback_list_lock
);
96 list_splice_init(&vsock
->loopback_list
, &pkts
);
97 spin_unlock_bh(&vsock
->loopback_list_lock
);
99 mutex_lock(&vsock
->rx_lock
);
104 while (!list_empty(&pkts
)) {
105 struct virtio_vsock_pkt
*pkt
;
107 pkt
= list_first_entry(&pkts
, struct virtio_vsock_pkt
, list
);
108 list_del_init(&pkt
->list
);
110 virtio_transport_recv_pkt(pkt
);
113 mutex_unlock(&vsock
->rx_lock
);
116 static int virtio_transport_send_pkt_loopback(struct virtio_vsock
*vsock
,
117 struct virtio_vsock_pkt
*pkt
)
121 spin_lock_bh(&vsock
->loopback_list_lock
);
122 list_add_tail(&pkt
->list
, &vsock
->loopback_list
);
123 spin_unlock_bh(&vsock
->loopback_list_lock
);
125 queue_work(virtio_vsock_workqueue
, &vsock
->loopback_work
);
131 virtio_transport_send_pkt_work(struct work_struct
*work
)
133 struct virtio_vsock
*vsock
=
134 container_of(work
, struct virtio_vsock
, send_pkt_work
);
135 struct virtqueue
*vq
;
137 bool restart_rx
= false;
139 mutex_lock(&vsock
->tx_lock
);
144 vq
= vsock
->vqs
[VSOCK_VQ_TX
];
147 struct virtio_vsock_pkt
*pkt
;
148 struct scatterlist hdr
, buf
, *sgs
[2];
149 int ret
, in_sg
= 0, out_sg
= 0;
152 spin_lock_bh(&vsock
->send_pkt_list_lock
);
153 if (list_empty(&vsock
->send_pkt_list
)) {
154 spin_unlock_bh(&vsock
->send_pkt_list_lock
);
158 pkt
= list_first_entry(&vsock
->send_pkt_list
,
159 struct virtio_vsock_pkt
, list
);
160 list_del_init(&pkt
->list
);
161 spin_unlock_bh(&vsock
->send_pkt_list_lock
);
163 virtio_transport_deliver_tap_pkt(pkt
);
167 sg_init_one(&hdr
, &pkt
->hdr
, sizeof(pkt
->hdr
));
168 sgs
[out_sg
++] = &hdr
;
170 sg_init_one(&buf
, pkt
->buf
, pkt
->len
);
171 sgs
[out_sg
++] = &buf
;
174 ret
= virtqueue_add_sgs(vq
, sgs
, out_sg
, in_sg
, pkt
, GFP_KERNEL
);
175 /* Usually this means that there is no more space available in
179 spin_lock_bh(&vsock
->send_pkt_list_lock
);
180 list_add(&pkt
->list
, &vsock
->send_pkt_list
);
181 spin_unlock_bh(&vsock
->send_pkt_list_lock
);
186 struct virtqueue
*rx_vq
= vsock
->vqs
[VSOCK_VQ_RX
];
189 val
= atomic_dec_return(&vsock
->queued_replies
);
191 /* Do we now have resources to resume rx processing? */
192 if (val
+ 1 == virtqueue_get_vring_size(rx_vq
))
203 mutex_unlock(&vsock
->tx_lock
);
206 queue_work(virtio_vsock_workqueue
, &vsock
->rx_work
);
210 virtio_transport_send_pkt(struct virtio_vsock_pkt
*pkt
)
212 struct virtio_vsock
*vsock
;
216 vsock
= rcu_dereference(the_virtio_vsock
);
218 virtio_transport_free_pkt(pkt
);
223 if (le64_to_cpu(pkt
->hdr
.dst_cid
) == vsock
->guest_cid
) {
224 len
= virtio_transport_send_pkt_loopback(vsock
, pkt
);
229 atomic_inc(&vsock
->queued_replies
);
231 spin_lock_bh(&vsock
->send_pkt_list_lock
);
232 list_add_tail(&pkt
->list
, &vsock
->send_pkt_list
);
233 spin_unlock_bh(&vsock
->send_pkt_list_lock
);
235 queue_work(virtio_vsock_workqueue
, &vsock
->send_pkt_work
);
243 virtio_transport_cancel_pkt(struct vsock_sock
*vsk
)
245 struct virtio_vsock
*vsock
;
246 struct virtio_vsock_pkt
*pkt
, *n
;
251 vsock
= rcu_dereference(the_virtio_vsock
);
257 spin_lock_bh(&vsock
->send_pkt_list_lock
);
258 list_for_each_entry_safe(pkt
, n
, &vsock
->send_pkt_list
, list
) {
261 list_move(&pkt
->list
, &freeme
);
263 spin_unlock_bh(&vsock
->send_pkt_list_lock
);
265 list_for_each_entry_safe(pkt
, n
, &freeme
, list
) {
268 list_del(&pkt
->list
);
269 virtio_transport_free_pkt(pkt
);
273 struct virtqueue
*rx_vq
= vsock
->vqs
[VSOCK_VQ_RX
];
276 new_cnt
= atomic_sub_return(cnt
, &vsock
->queued_replies
);
277 if (new_cnt
+ cnt
>= virtqueue_get_vring_size(rx_vq
) &&
278 new_cnt
< virtqueue_get_vring_size(rx_vq
))
279 queue_work(virtio_vsock_workqueue
, &vsock
->rx_work
);
289 static void virtio_vsock_rx_fill(struct virtio_vsock
*vsock
)
291 int buf_len
= VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE
;
292 struct virtio_vsock_pkt
*pkt
;
293 struct scatterlist hdr
, buf
, *sgs
[2];
294 struct virtqueue
*vq
;
297 vq
= vsock
->vqs
[VSOCK_VQ_RX
];
300 pkt
= kzalloc(sizeof(*pkt
), GFP_KERNEL
);
304 pkt
->buf
= kmalloc(buf_len
, GFP_KERNEL
);
306 virtio_transport_free_pkt(pkt
);
310 pkt
->buf_len
= buf_len
;
313 sg_init_one(&hdr
, &pkt
->hdr
, sizeof(pkt
->hdr
));
316 sg_init_one(&buf
, pkt
->buf
, buf_len
);
318 ret
= virtqueue_add_sgs(vq
, sgs
, 0, 2, pkt
, GFP_KERNEL
);
320 virtio_transport_free_pkt(pkt
);
324 } while (vq
->num_free
);
325 if (vsock
->rx_buf_nr
> vsock
->rx_buf_max_nr
)
326 vsock
->rx_buf_max_nr
= vsock
->rx_buf_nr
;
330 static void virtio_transport_tx_work(struct work_struct
*work
)
332 struct virtio_vsock
*vsock
=
333 container_of(work
, struct virtio_vsock
, tx_work
);
334 struct virtqueue
*vq
;
337 vq
= vsock
->vqs
[VSOCK_VQ_TX
];
338 mutex_lock(&vsock
->tx_lock
);
344 struct virtio_vsock_pkt
*pkt
;
347 virtqueue_disable_cb(vq
);
348 while ((pkt
= virtqueue_get_buf(vq
, &len
)) != NULL
) {
349 virtio_transport_free_pkt(pkt
);
352 } while (!virtqueue_enable_cb(vq
));
355 mutex_unlock(&vsock
->tx_lock
);
358 queue_work(virtio_vsock_workqueue
, &vsock
->send_pkt_work
);
361 /* Is there space left for replies to rx packets? */
362 static bool virtio_transport_more_replies(struct virtio_vsock
*vsock
)
364 struct virtqueue
*vq
= vsock
->vqs
[VSOCK_VQ_RX
];
367 smp_rmb(); /* paired with atomic_inc() and atomic_dec_return() */
368 val
= atomic_read(&vsock
->queued_replies
);
370 return val
< virtqueue_get_vring_size(vq
);
373 static void virtio_transport_rx_work(struct work_struct
*work
)
375 struct virtio_vsock
*vsock
=
376 container_of(work
, struct virtio_vsock
, rx_work
);
377 struct virtqueue
*vq
;
379 vq
= vsock
->vqs
[VSOCK_VQ_RX
];
381 mutex_lock(&vsock
->rx_lock
);
387 virtqueue_disable_cb(vq
);
389 struct virtio_vsock_pkt
*pkt
;
392 if (!virtio_transport_more_replies(vsock
)) {
393 /* Stop rx until the device processes already
394 * pending replies. Leave rx virtqueue
395 * callbacks disabled.
400 pkt
= virtqueue_get_buf(vq
, &len
);
407 /* Drop short/long packets */
408 if (unlikely(len
< sizeof(pkt
->hdr
) ||
409 len
> sizeof(pkt
->hdr
) + pkt
->len
)) {
410 virtio_transport_free_pkt(pkt
);
414 pkt
->len
= len
- sizeof(pkt
->hdr
);
415 virtio_transport_deliver_tap_pkt(pkt
);
416 virtio_transport_recv_pkt(pkt
);
418 } while (!virtqueue_enable_cb(vq
));
421 if (vsock
->rx_buf_nr
< vsock
->rx_buf_max_nr
/ 2)
422 virtio_vsock_rx_fill(vsock
);
423 mutex_unlock(&vsock
->rx_lock
);
426 /* event_lock must be held */
427 static int virtio_vsock_event_fill_one(struct virtio_vsock
*vsock
,
428 struct virtio_vsock_event
*event
)
430 struct scatterlist sg
;
431 struct virtqueue
*vq
;
433 vq
= vsock
->vqs
[VSOCK_VQ_EVENT
];
435 sg_init_one(&sg
, event
, sizeof(*event
));
437 return virtqueue_add_inbuf(vq
, &sg
, 1, event
, GFP_KERNEL
);
440 /* event_lock must be held */
441 static void virtio_vsock_event_fill(struct virtio_vsock
*vsock
)
445 for (i
= 0; i
< ARRAY_SIZE(vsock
->event_list
); i
++) {
446 struct virtio_vsock_event
*event
= &vsock
->event_list
[i
];
448 virtio_vsock_event_fill_one(vsock
, event
);
451 virtqueue_kick(vsock
->vqs
[VSOCK_VQ_EVENT
]);
454 static void virtio_vsock_reset_sock(struct sock
*sk
)
457 sk
->sk_state
= TCP_CLOSE
;
458 sk
->sk_err
= ECONNRESET
;
459 sk
->sk_error_report(sk
);
463 static void virtio_vsock_update_guest_cid(struct virtio_vsock
*vsock
)
465 struct virtio_device
*vdev
= vsock
->vdev
;
468 vdev
->config
->get(vdev
, offsetof(struct virtio_vsock_config
, guest_cid
),
469 &guest_cid
, sizeof(guest_cid
));
470 vsock
->guest_cid
= le64_to_cpu(guest_cid
);
473 /* event_lock must be held */
474 static void virtio_vsock_event_handle(struct virtio_vsock
*vsock
,
475 struct virtio_vsock_event
*event
)
477 switch (le32_to_cpu(event
->id
)) {
478 case VIRTIO_VSOCK_EVENT_TRANSPORT_RESET
:
479 virtio_vsock_update_guest_cid(vsock
);
480 vsock_for_each_connected_socket(virtio_vsock_reset_sock
);
485 static void virtio_transport_event_work(struct work_struct
*work
)
487 struct virtio_vsock
*vsock
=
488 container_of(work
, struct virtio_vsock
, event_work
);
489 struct virtqueue
*vq
;
491 vq
= vsock
->vqs
[VSOCK_VQ_EVENT
];
493 mutex_lock(&vsock
->event_lock
);
495 if (!vsock
->event_run
)
499 struct virtio_vsock_event
*event
;
502 virtqueue_disable_cb(vq
);
503 while ((event
= virtqueue_get_buf(vq
, &len
)) != NULL
) {
504 if (len
== sizeof(*event
))
505 virtio_vsock_event_handle(vsock
, event
);
507 virtio_vsock_event_fill_one(vsock
, event
);
509 } while (!virtqueue_enable_cb(vq
));
511 virtqueue_kick(vsock
->vqs
[VSOCK_VQ_EVENT
]);
513 mutex_unlock(&vsock
->event_lock
);
516 static void virtio_vsock_event_done(struct virtqueue
*vq
)
518 struct virtio_vsock
*vsock
= vq
->vdev
->priv
;
522 queue_work(virtio_vsock_workqueue
, &vsock
->event_work
);
525 static void virtio_vsock_tx_done(struct virtqueue
*vq
)
527 struct virtio_vsock
*vsock
= vq
->vdev
->priv
;
531 queue_work(virtio_vsock_workqueue
, &vsock
->tx_work
);
534 static void virtio_vsock_rx_done(struct virtqueue
*vq
)
536 struct virtio_vsock
*vsock
= vq
->vdev
->priv
;
540 queue_work(virtio_vsock_workqueue
, &vsock
->rx_work
);
543 static struct virtio_transport virtio_transport
= {
545 .get_local_cid
= virtio_transport_get_local_cid
,
547 .init
= virtio_transport_do_socket_init
,
548 .destruct
= virtio_transport_destruct
,
549 .release
= virtio_transport_release
,
550 .connect
= virtio_transport_connect
,
551 .shutdown
= virtio_transport_shutdown
,
552 .cancel_pkt
= virtio_transport_cancel_pkt
,
554 .dgram_bind
= virtio_transport_dgram_bind
,
555 .dgram_dequeue
= virtio_transport_dgram_dequeue
,
556 .dgram_enqueue
= virtio_transport_dgram_enqueue
,
557 .dgram_allow
= virtio_transport_dgram_allow
,
559 .stream_dequeue
= virtio_transport_stream_dequeue
,
560 .stream_enqueue
= virtio_transport_stream_enqueue
,
561 .stream_has_data
= virtio_transport_stream_has_data
,
562 .stream_has_space
= virtio_transport_stream_has_space
,
563 .stream_rcvhiwat
= virtio_transport_stream_rcvhiwat
,
564 .stream_is_active
= virtio_transport_stream_is_active
,
565 .stream_allow
= virtio_transport_stream_allow
,
567 .notify_poll_in
= virtio_transport_notify_poll_in
,
568 .notify_poll_out
= virtio_transport_notify_poll_out
,
569 .notify_recv_init
= virtio_transport_notify_recv_init
,
570 .notify_recv_pre_block
= virtio_transport_notify_recv_pre_block
,
571 .notify_recv_pre_dequeue
= virtio_transport_notify_recv_pre_dequeue
,
572 .notify_recv_post_dequeue
= virtio_transport_notify_recv_post_dequeue
,
573 .notify_send_init
= virtio_transport_notify_send_init
,
574 .notify_send_pre_block
= virtio_transport_notify_send_pre_block
,
575 .notify_send_pre_enqueue
= virtio_transport_notify_send_pre_enqueue
,
576 .notify_send_post_enqueue
= virtio_transport_notify_send_post_enqueue
,
578 .set_buffer_size
= virtio_transport_set_buffer_size
,
579 .set_min_buffer_size
= virtio_transport_set_min_buffer_size
,
580 .set_max_buffer_size
= virtio_transport_set_max_buffer_size
,
581 .get_buffer_size
= virtio_transport_get_buffer_size
,
582 .get_min_buffer_size
= virtio_transport_get_min_buffer_size
,
583 .get_max_buffer_size
= virtio_transport_get_max_buffer_size
,
586 .send_pkt
= virtio_transport_send_pkt
,
589 static int virtio_vsock_probe(struct virtio_device
*vdev
)
591 vq_callback_t
*callbacks
[] = {
592 virtio_vsock_rx_done
,
593 virtio_vsock_tx_done
,
594 virtio_vsock_event_done
,
596 static const char * const names
[] = {
601 struct virtio_vsock
*vsock
= NULL
;
604 ret
= mutex_lock_interruptible(&the_virtio_vsock_mutex
);
608 /* Only one virtio-vsock device per guest is supported */
609 if (rcu_dereference_protected(the_virtio_vsock
,
610 lockdep_is_held(&the_virtio_vsock_mutex
))) {
615 vsock
= kzalloc(sizeof(*vsock
), GFP_KERNEL
);
623 ret
= virtio_find_vqs(vsock
->vdev
, VSOCK_VQ_MAX
,
624 vsock
->vqs
, callbacks
, names
,
629 virtio_vsock_update_guest_cid(vsock
);
631 vsock
->rx_buf_nr
= 0;
632 vsock
->rx_buf_max_nr
= 0;
633 atomic_set(&vsock
->queued_replies
, 0);
635 mutex_init(&vsock
->tx_lock
);
636 mutex_init(&vsock
->rx_lock
);
637 mutex_init(&vsock
->event_lock
);
638 spin_lock_init(&vsock
->send_pkt_list_lock
);
639 INIT_LIST_HEAD(&vsock
->send_pkt_list
);
640 spin_lock_init(&vsock
->loopback_list_lock
);
641 INIT_LIST_HEAD(&vsock
->loopback_list
);
642 INIT_WORK(&vsock
->rx_work
, virtio_transport_rx_work
);
643 INIT_WORK(&vsock
->tx_work
, virtio_transport_tx_work
);
644 INIT_WORK(&vsock
->event_work
, virtio_transport_event_work
);
645 INIT_WORK(&vsock
->send_pkt_work
, virtio_transport_send_pkt_work
);
646 INIT_WORK(&vsock
->loopback_work
, virtio_transport_loopback_work
);
648 mutex_lock(&vsock
->tx_lock
);
649 vsock
->tx_run
= true;
650 mutex_unlock(&vsock
->tx_lock
);
652 mutex_lock(&vsock
->rx_lock
);
653 virtio_vsock_rx_fill(vsock
);
654 vsock
->rx_run
= true;
655 mutex_unlock(&vsock
->rx_lock
);
657 mutex_lock(&vsock
->event_lock
);
658 virtio_vsock_event_fill(vsock
);
659 vsock
->event_run
= true;
660 mutex_unlock(&vsock
->event_lock
);
663 rcu_assign_pointer(the_virtio_vsock
, vsock
);
665 mutex_unlock(&the_virtio_vsock_mutex
);
670 mutex_unlock(&the_virtio_vsock_mutex
);
674 static void virtio_vsock_remove(struct virtio_device
*vdev
)
676 struct virtio_vsock
*vsock
= vdev
->priv
;
677 struct virtio_vsock_pkt
*pkt
;
679 mutex_lock(&the_virtio_vsock_mutex
);
682 rcu_assign_pointer(the_virtio_vsock
, NULL
);
685 /* Reset all connected sockets when the device disappear */
686 vsock_for_each_connected_socket(virtio_vsock_reset_sock
);
688 /* Stop all work handlers to make sure no one is accessing the device,
689 * so we can safely call vdev->config->reset().
691 mutex_lock(&vsock
->rx_lock
);
692 vsock
->rx_run
= false;
693 mutex_unlock(&vsock
->rx_lock
);
695 mutex_lock(&vsock
->tx_lock
);
696 vsock
->tx_run
= false;
697 mutex_unlock(&vsock
->tx_lock
);
699 mutex_lock(&vsock
->event_lock
);
700 vsock
->event_run
= false;
701 mutex_unlock(&vsock
->event_lock
);
703 /* Flush all device writes and interrupts, device will not use any
706 vdev
->config
->reset(vdev
);
708 mutex_lock(&vsock
->rx_lock
);
709 while ((pkt
= virtqueue_detach_unused_buf(vsock
->vqs
[VSOCK_VQ_RX
])))
710 virtio_transport_free_pkt(pkt
);
711 mutex_unlock(&vsock
->rx_lock
);
713 mutex_lock(&vsock
->tx_lock
);
714 while ((pkt
= virtqueue_detach_unused_buf(vsock
->vqs
[VSOCK_VQ_TX
])))
715 virtio_transport_free_pkt(pkt
);
716 mutex_unlock(&vsock
->tx_lock
);
718 spin_lock_bh(&vsock
->send_pkt_list_lock
);
719 while (!list_empty(&vsock
->send_pkt_list
)) {
720 pkt
= list_first_entry(&vsock
->send_pkt_list
,
721 struct virtio_vsock_pkt
, list
);
722 list_del(&pkt
->list
);
723 virtio_transport_free_pkt(pkt
);
725 spin_unlock_bh(&vsock
->send_pkt_list_lock
);
727 spin_lock_bh(&vsock
->loopback_list_lock
);
728 while (!list_empty(&vsock
->loopback_list
)) {
729 pkt
= list_first_entry(&vsock
->loopback_list
,
730 struct virtio_vsock_pkt
, list
);
731 list_del(&pkt
->list
);
732 virtio_transport_free_pkt(pkt
);
734 spin_unlock_bh(&vsock
->loopback_list_lock
);
736 /* Delete virtqueues and flush outstanding callbacks if any */
737 vdev
->config
->del_vqs(vdev
);
739 /* Other works can be queued before 'config->del_vqs()', so we flush
740 * all works before to free the vsock object to avoid use after free.
742 flush_work(&vsock
->loopback_work
);
743 flush_work(&vsock
->rx_work
);
744 flush_work(&vsock
->tx_work
);
745 flush_work(&vsock
->event_work
);
746 flush_work(&vsock
->send_pkt_work
);
748 mutex_unlock(&the_virtio_vsock_mutex
);
753 static struct virtio_device_id id_table
[] = {
754 { VIRTIO_ID_VSOCK
, VIRTIO_DEV_ANY_ID
},
758 static unsigned int features
[] = {
761 static struct virtio_driver virtio_vsock_driver
= {
762 .feature_table
= features
,
763 .feature_table_size
= ARRAY_SIZE(features
),
764 .driver
.name
= KBUILD_MODNAME
,
765 .driver
.owner
= THIS_MODULE
,
766 .id_table
= id_table
,
767 .probe
= virtio_vsock_probe
,
768 .remove
= virtio_vsock_remove
,
771 static int __init
virtio_vsock_init(void)
775 virtio_vsock_workqueue
= alloc_workqueue("virtio_vsock", 0, 0);
776 if (!virtio_vsock_workqueue
)
779 ret
= vsock_core_init(&virtio_transport
.transport
);
783 ret
= register_virtio_driver(&virtio_vsock_driver
);
792 destroy_workqueue(virtio_vsock_workqueue
);
796 static void __exit
virtio_vsock_exit(void)
798 unregister_virtio_driver(&virtio_vsock_driver
);
800 destroy_workqueue(virtio_vsock_workqueue
);
803 module_init(virtio_vsock_init
);
804 module_exit(virtio_vsock_exit
);
805 MODULE_LICENSE("GPL v2");
806 MODULE_AUTHOR("Asias He");
807 MODULE_DESCRIPTION("virtio transport for vsock");
808 MODULE_DEVICE_TABLE(virtio
, id_table
);