2 * Copyright (c) 2012, Microsoft Corporation.
5 * K. Y. Srinivasan <kys@microsoft.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published
9 * by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14 * NON INFRINGEMENT. See the GNU General Public License for more
19 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21 #include <linux/kernel.h>
22 #include <linux/mman.h>
23 #include <linux/delay.h>
24 #include <linux/init.h>
25 #include <linux/module.h>
26 #include <linux/slab.h>
27 #include <linux/kthread.h>
28 #include <linux/completion.h>
29 #include <linux/memory_hotplug.h>
30 #include <linux/memory.h>
31 #include <linux/notifier.h>
32 #include <linux/percpu_counter.h>
34 #include <linux/hyperv.h>
37 * We begin with definitions supporting the Dynamic Memory protocol
40 * Begin protocol definitions.
46 * Protocol versions. The low word is the minor version, the high word the major
51 * Changed to 0.1 on 2009/03/25
52 * Changes to 0.2 on 2009/05/14
53 * Changes to 0.3 on 2009/12/03
54 * Changed to 1.0 on 2011/04/05
57 #define DYNMEM_MAKE_VERSION(Major, Minor) ((__u32)(((Major) << 16) | (Minor)))
58 #define DYNMEM_MAJOR_VERSION(Version) ((__u32)(Version) >> 16)
59 #define DYNMEM_MINOR_VERSION(Version) ((__u32)(Version) & 0xff)
62 DYNMEM_PROTOCOL_VERSION_1 = DYNMEM_MAKE_VERSION(0, 3),
63 DYNMEM_PROTOCOL_VERSION_2 = DYNMEM_MAKE_VERSION(1, 0),
65 DYNMEM_PROTOCOL_VERSION_WIN7 = DYNMEM_PROTOCOL_VERSION_1,
66 DYNMEM_PROTOCOL_VERSION_WIN8 = DYNMEM_PROTOCOL_VERSION_2,
68 DYNMEM_PROTOCOL_VERSION_CURRENT = DYNMEM_PROTOCOL_VERSION_WIN8
77 enum dm_message_type {
82 DM_VERSION_REQUEST = 1,
83 DM_VERSION_RESPONSE = 2,
84 DM_CAPABILITIES_REPORT = 3,
85 DM_CAPABILITIES_RESPONSE = 4,
87 DM_BALLOON_REQUEST = 6,
88 DM_BALLOON_RESPONSE = 7,
89 DM_UNBALLOON_REQUEST = 8,
90 DM_UNBALLOON_RESPONSE = 9,
91 DM_MEM_HOT_ADD_REQUEST = 10,
92 DM_MEM_HOT_ADD_RESPONSE = 11,
93 DM_VERSION_03_MAX = 11,
103 * Structures defining the dynamic memory management
125 union dm_mem_page_range {
128 * The PFN number of the first page in the range.
129 * 40 bits is the architectural limit of a PFN
134 * The number of pages in the range.
144 * The header for all dynamic memory messages:
146 * type: Type of the message.
147 * size: Size of the message in bytes; including the header.
148 * trans_id: The guest is responsible for manufacturing this ID.
158 * A generic message format for dynamic memory.
159 * Specific message formats are defined later in the file.
163 struct dm_header hdr;
164 __u8 data[]; /* enclosed message */
169 * Specific message types supporting the dynamic memory protocol.
173 * Version negotiation message. Sent from the guest to the host.
174 * The guest is free to try different versions until the host
175 * accepts the version.
177 * dm_version: The protocol version requested.
178 * is_last_attempt: If TRUE, this is the last version guest will request.
179 * reservedz: Reserved field, set to zero.
182 struct dm_version_request {
183 struct dm_header hdr;
184 union dm_version version;
185 __u32 is_last_attempt:1;
190 * Version response message; Host to Guest and indicates
191 * if the host has accepted the version sent by the guest.
193 * is_accepted: If TRUE, host has accepted the version and the guest
194 * should proceed to the next stage of the protocol. FALSE indicates that
195 * guest should re-try with a different version.
197 * reservedz: Reserved field, set to zero.
200 struct dm_version_response {
201 struct dm_header hdr;
207 * Message reporting capabilities. This is sent from the guest to the
211 struct dm_capabilities {
212 struct dm_header hdr;
215 __u64 max_page_number;
219 * Response to the capabilities message. This is sent from the host to the
220 * guest. This message notifies if the host has accepted the guest's
221 * capabilities. If the host has not accepted, the guest must shutdown
224 * is_accepted: Indicates if the host has accepted guest's capabilities.
225 * reservedz: Must be 0.
228 struct dm_capabilities_resp_msg {
229 struct dm_header hdr;
235 * This message is used to report memory pressure from the guest.
236 * This message is not part of any transaction and there is no
237 * response to this message.
239 * num_avail: Available memory in pages.
240 * num_committed: Committed memory in pages.
241 * page_file_size: The accumulated size of all page files
242 * in the system in pages.
243 * zero_free: The nunber of zero and free pages.
244 * page_file_writes: The writes to the page file in pages.
245 * io_diff: An indicator of file cache efficiency or page file activity,
246 * calculated as File Cache Page Fault Count - Page Read Count.
247 * This value is in pages.
249 * Some of these metrics are Windows specific and fortunately
250 * the algorithm on the host side that computes the guest memory
251 * pressure only uses num_committed value.
255 struct dm_header hdr;
258 __u64 page_file_size;
260 __u32 page_file_writes;
266 * Message to ask the guest to allocate memory - balloon up message.
267 * This message is sent from the host to the guest. The guest may not be
268 * able to allocate as much memory as requested.
270 * num_pages: number of pages to allocate.
274 struct dm_header hdr;
281 * Balloon response message; this message is sent from the guest
282 * to the host in response to the balloon message.
284 * reservedz: Reserved; must be set to zero.
285 * more_pages: If FALSE, this is the last message of the transaction.
286 * if TRUE there will atleast one more message from the guest.
288 * range_count: The number of ranges in the range array.
290 * range_array: An array of page ranges returned to the host.
294 struct dm_balloon_response {
295 struct dm_header hdr;
298 __u32 range_count:31;
299 union dm_mem_page_range range_array[];
303 * Un-balloon message; this message is sent from the host
304 * to the guest to give guest more memory.
306 * more_pages: If FALSE, this is the last message of the transaction.
307 * if TRUE there will atleast one more message from the guest.
309 * reservedz: Reserved; must be set to zero.
311 * range_count: The number of ranges in the range array.
313 * range_array: An array of page ranges returned to the host.
317 struct dm_unballoon_request {
318 struct dm_header hdr;
322 union dm_mem_page_range range_array[];
326 * Un-balloon response message; this message is sent from the guest
327 * to the host in response to an unballoon request.
331 struct dm_unballoon_response {
332 struct dm_header hdr;
337 * Hot add request message. Message sent from the host to the guest.
339 * mem_range: Memory range to hot add.
341 * On Linux we currently don't support this since we cannot hot add
342 * arbitrary granularity of memory.
346 struct dm_header hdr;
347 union dm_mem_page_range range;
351 * Hot add response message.
352 * This message is sent by the guest to report the status of a hot add request.
353 * If page_count is less than the requested page count, then the host should
354 * assume all further hot add requests will fail, since this indicates that
355 * the guest has hit an upper physical memory barrier.
357 * Hot adds may also fail due to low resources; in this case, the guest must
358 * not complete this message until the hot add can succeed, and the host must
359 * not send a new hot add request until the response is sent.
360 * If VSC fails to hot add memory DYNMEM_NUMBER_OF_UNSUCCESSFUL_HOTADD_ATTEMPTS
361 * times it fails the request.
364 * page_count: number of pages that were successfully hot added.
366 * result: result of the operation 1: success, 0: failure.
370 struct dm_hot_add_response {
371 struct dm_header hdr;
377 * Types of information sent from host to the guest.
381 INFO_TYPE_MAX_PAGE_CNT = 0,
387 * Header for the information message.
390 struct dm_info_header {
391 enum dm_info_type type;
396 * This message is sent from the host to the guest to pass
397 * some relevant information (win8 addition).
400 * info_size: size of the information blob.
401 * info: information blob.
405 struct dm_header hdr;
412 * End protocol definitions.
415 struct balloon_state {
417 struct work_struct wrk;
421 static bool do_hot_add;
423 * Delay reporting memory pressure by
424 * the specified number of seconds.
426 static uint pressure_report_delay = 30;
428 module_param(hot_add, bool, (S_IRUGO | S_IWUSR));
429 MODULE_PARM_DESC(hot_add, "If set attempt memory hot_add");
431 module_param(pressure_report_delay, uint, (S_IRUGO | S_IWUSR));
432 MODULE_PARM_DESC(pressure_report_delay, "Delay in secs in reporting pressure");
433 static atomic_t trans_id = ATOMIC_INIT(0);
435 static int dm_ring_size = (5 * PAGE_SIZE);
438 * Driver specific state.
451 static __u8 recv_buffer[PAGE_SIZE];
452 static __u8 *send_buffer;
453 #define PAGES_IN_2M 512
455 struct hv_dynmem_device {
456 struct hv_device *dev;
457 enum hv_dm_state state;
458 struct completion host_event;
459 struct completion config_event;
462 * Number of pages we have currently ballooned out.
464 unsigned int num_pages_ballooned;
467 * State to manage the ballooning (up) operation.
469 struct balloon_state balloon_wrk;
472 * This thread handles hot-add
473 * requests from the host as well as notifying
474 * the host with regards to memory pressure in
477 struct task_struct *thread;
480 * We start with the highest version we can support
481 * and downgrade based on the host; we save here the
482 * next version to try.
487 static struct hv_dynmem_device dm_device;
489 static void hot_add_req(struct hv_dynmem_device *dm, struct dm_hot_add *msg)
492 struct dm_hot_add_response resp;
496 pr_info("Memory hot add not supported\n");
499 * Currently we do not support hot add.
500 * Just fail the request.
504 memset(&resp, 0, sizeof(struct dm_hot_add_response));
505 resp.hdr.type = DM_MEM_HOT_ADD_RESPONSE;
506 resp.hdr.size = sizeof(struct dm_hot_add_response);
507 resp.hdr.trans_id = atomic_inc_return(&trans_id);
512 dm->state = DM_INITIALIZED;
513 vmbus_sendpacket(dm->dev->channel, &resp,
514 sizeof(struct dm_hot_add_response),
516 VM_PKT_DATA_INBAND, 0);
520 static void process_info(struct hv_dynmem_device *dm, struct dm_info_msg *msg)
522 struct dm_info_header *info_hdr;
524 info_hdr = (struct dm_info_header *)msg->info;
526 switch (info_hdr->type) {
527 case INFO_TYPE_MAX_PAGE_CNT:
528 pr_info("Received INFO_TYPE_MAX_PAGE_CNT\n");
529 pr_info("Data Size is %d\n", info_hdr->data_size);
532 pr_info("Received Unknown type: %d\n", info_hdr->type);
536 unsigned long compute_balloon_floor(void)
538 unsigned long min_pages;
539 #define MB2PAGES(mb) ((mb) << (20 - PAGE_SHIFT))
540 /* Simple continuous piecewiese linear function:
541 * max MiB -> min MiB gradient
552 if (totalram_pages < MB2PAGES(128))
553 min_pages = MB2PAGES(8) + (totalram_pages >> 1);
554 else if (totalram_pages < MB2PAGES(512))
555 min_pages = MB2PAGES(40) + (totalram_pages >> 2);
556 else if (totalram_pages < MB2PAGES(2048))
557 min_pages = MB2PAGES(104) + (totalram_pages >> 3);
559 min_pages = MB2PAGES(296) + (totalram_pages >> 5);
565 * Post our status as it relates memory pressure to the
566 * host. Host expects the guests to post this status
567 * periodically at 1 second intervals.
569 * The metrics specified in this protocol are very Windows
570 * specific and so we cook up numbers here to convey our memory
574 static void post_status(struct hv_dynmem_device *dm)
576 struct dm_status status;
579 if (pressure_report_delay > 0) {
580 --pressure_report_delay;
584 memset(&status, 0, sizeof(struct dm_status));
585 status.hdr.type = DM_STATUS_REPORT;
586 status.hdr.size = sizeof(struct dm_status);
587 status.hdr.trans_id = atomic_inc_return(&trans_id);
590 * The host expects the guest to report free memory.
591 * Further, the host expects the pressure information to
592 * include the ballooned out pages.
593 * For a given amount of memory that we are managing, we
594 * need to compute a floor below which we should not balloon.
595 * Compute this and add it to the pressure report.
597 status.num_avail = val.freeram;
598 status.num_committed = vm_memory_committed() +
599 dm->num_pages_ballooned +
600 compute_balloon_floor();
602 vmbus_sendpacket(dm->dev->channel, &status,
603 sizeof(struct dm_status),
605 VM_PKT_DATA_INBAND, 0);
609 static void free_balloon_pages(struct hv_dynmem_device *dm,
610 union dm_mem_page_range *range_array)
612 int num_pages = range_array->finfo.page_cnt;
613 __u64 start_frame = range_array->finfo.start_page;
617 for (i = 0; i < num_pages; i++) {
618 pg = pfn_to_page(i + start_frame);
620 dm->num_pages_ballooned--;
626 static int alloc_balloon_pages(struct hv_dynmem_device *dm, int num_pages,
627 struct dm_balloon_response *bl_resp, int alloc_unit,
633 if (num_pages < alloc_unit)
636 for (i = 0; (i * alloc_unit) < num_pages; i++) {
637 if (bl_resp->hdr.size + sizeof(union dm_mem_page_range) >
639 return i * alloc_unit;
642 * We execute this code in a thread context. Furthermore,
643 * we don't want the kernel to try too hard.
645 pg = alloc_pages(GFP_HIGHUSER | __GFP_NORETRY |
646 __GFP_NOMEMALLOC | __GFP_NOWARN,
647 get_order(alloc_unit << PAGE_SHIFT));
651 return i * alloc_unit;
655 dm->num_pages_ballooned += alloc_unit;
657 bl_resp->range_count++;
658 bl_resp->range_array[i].finfo.start_page =
660 bl_resp->range_array[i].finfo.page_cnt = alloc_unit;
661 bl_resp->hdr.size += sizeof(union dm_mem_page_range);
670 static void balloon_up(struct work_struct *dummy)
672 int num_pages = dm_device.balloon_wrk.num_pages;
673 int num_ballooned = 0;
674 struct dm_balloon_response *bl_resp;
677 bool alloc_error = false;
683 * Currently, we only support 4k allocations.
688 bl_resp = (struct dm_balloon_response *)send_buffer;
689 memset(send_buffer, 0, PAGE_SIZE);
690 bl_resp->hdr.type = DM_BALLOON_RESPONSE;
691 bl_resp->hdr.trans_id = atomic_inc_return(&trans_id);
692 bl_resp->hdr.size = sizeof(struct dm_balloon_response);
693 bl_resp->more_pages = 1;
696 num_pages -= num_ballooned;
697 num_ballooned = alloc_balloon_pages(&dm_device, num_pages,
701 if ((alloc_error) || (num_ballooned == num_pages)) {
702 bl_resp->more_pages = 0;
704 dm_device.state = DM_INITIALIZED;
708 * We are pushing a lot of data through the channel;
709 * deal with transient failures caused because of the
710 * lack of space in the ring buffer.
714 ret = vmbus_sendpacket(dm_device.dev->channel,
718 VM_PKT_DATA_INBAND, 0);
723 } while (ret == -EAGAIN);
727 * Free up the memory we allocatted.
729 pr_info("Balloon response failed\n");
731 for (i = 0; i < bl_resp->range_count; i++)
732 free_balloon_pages(&dm_device,
733 &bl_resp->range_array[i]);
741 static void balloon_down(struct hv_dynmem_device *dm,
742 struct dm_unballoon_request *req)
744 union dm_mem_page_range *range_array = req->range_array;
745 int range_count = req->range_count;
746 struct dm_unballoon_response resp;
749 for (i = 0; i < range_count; i++)
750 free_balloon_pages(dm, &range_array[i]);
752 if (req->more_pages == 1)
755 memset(&resp, 0, sizeof(struct dm_unballoon_response));
756 resp.hdr.type = DM_UNBALLOON_RESPONSE;
757 resp.hdr.trans_id = atomic_inc_return(&trans_id);
758 resp.hdr.size = sizeof(struct dm_unballoon_response);
760 vmbus_sendpacket(dm_device.dev->channel, &resp,
761 sizeof(struct dm_unballoon_response),
763 VM_PKT_DATA_INBAND, 0);
765 dm->state = DM_INITIALIZED;
768 static void balloon_onchannelcallback(void *context);
770 static int dm_thread_func(void *dm_dev)
772 struct hv_dynmem_device *dm = dm_dev;
774 unsigned long scan_start;
776 while (!kthread_should_stop()) {
777 t = wait_for_completion_timeout(&dm_device.config_event, 1*HZ);
779 * The host expects us to post information on the memory
780 * pressure every second.
786 scan_start = jiffies;
790 hot_add_req(dm, (struct dm_hot_add *)recv_buffer);
796 if (!time_in_range(jiffies, scan_start, scan_start + HZ))
805 static void version_resp(struct hv_dynmem_device *dm,
806 struct dm_version_response *vresp)
808 struct dm_version_request version_req;
811 if (vresp->is_accepted) {
813 * We are done; wakeup the
814 * context waiting for version
817 complete(&dm->host_event);
821 * If there are more versions to try, continue
822 * with negotiations; if not
823 * shutdown the service since we are not able
824 * to negotiate a suitable version number
827 if (dm->next_version == 0)
830 dm->next_version = 0;
831 memset(&version_req, 0, sizeof(struct dm_version_request));
832 version_req.hdr.type = DM_VERSION_REQUEST;
833 version_req.hdr.size = sizeof(struct dm_version_request);
834 version_req.hdr.trans_id = atomic_inc_return(&trans_id);
835 version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN7;
836 version_req.is_last_attempt = 1;
838 ret = vmbus_sendpacket(dm->dev->channel, &version_req,
839 sizeof(struct dm_version_request),
841 VM_PKT_DATA_INBAND, 0);
849 dm->state = DM_INIT_ERROR;
850 complete(&dm->host_event);
853 static void cap_resp(struct hv_dynmem_device *dm,
854 struct dm_capabilities_resp_msg *cap_resp)
856 if (!cap_resp->is_accepted) {
857 pr_info("Capabilities not accepted by host\n");
858 dm->state = DM_INIT_ERROR;
860 complete(&dm->host_event);
863 static void balloon_onchannelcallback(void *context)
865 struct hv_device *dev = context;
868 struct dm_message *dm_msg;
869 struct dm_header *dm_hdr;
870 struct hv_dynmem_device *dm = hv_get_drvdata(dev);
871 struct dm_balloon *bal_msg;
873 memset(recv_buffer, 0, sizeof(recv_buffer));
874 vmbus_recvpacket(dev->channel, recv_buffer,
875 PAGE_SIZE, &recvlen, &requestid);
878 dm_msg = (struct dm_message *)recv_buffer;
879 dm_hdr = &dm_msg->hdr;
881 switch (dm_hdr->type) {
882 case DM_VERSION_RESPONSE:
884 (struct dm_version_response *)dm_msg);
887 case DM_CAPABILITIES_RESPONSE:
889 (struct dm_capabilities_resp_msg *)dm_msg);
892 case DM_BALLOON_REQUEST:
893 if (dm->state == DM_BALLOON_UP)
894 pr_warn("Currently ballooning\n");
895 bal_msg = (struct dm_balloon *)recv_buffer;
896 dm->state = DM_BALLOON_UP;
897 dm_device.balloon_wrk.num_pages = bal_msg->num_pages;
898 schedule_work(&dm_device.balloon_wrk.wrk);
901 case DM_UNBALLOON_REQUEST:
902 dm->state = DM_BALLOON_DOWN;
904 (struct dm_unballoon_request *)recv_buffer);
907 case DM_MEM_HOT_ADD_REQUEST:
908 dm->state = DM_HOT_ADD;
909 complete(&dm->config_event);
912 case DM_INFO_MESSAGE:
913 process_info(dm, (struct dm_info_msg *)dm_msg);
917 pr_err("Unhandled message: type: %d\n", dm_hdr->type);
924 static int balloon_probe(struct hv_device *dev,
925 const struct hv_vmbus_device_id *dev_id)
928 struct dm_version_request version_req;
929 struct dm_capabilities cap_msg;
931 do_hot_add = hot_add;
934 * First allocate a send buffer.
937 send_buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
941 ret = vmbus_open(dev->channel, dm_ring_size, dm_ring_size, NULL, 0,
942 balloon_onchannelcallback, dev);
948 dm_device.state = DM_INITIALIZING;
949 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN7;
950 init_completion(&dm_device.host_event);
951 init_completion(&dm_device.config_event);
952 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up);
955 kthread_run(dm_thread_func, &dm_device, "hv_balloon");
956 if (IS_ERR(dm_device.thread)) {
957 ret = PTR_ERR(dm_device.thread);
961 hv_set_drvdata(dev, &dm_device);
963 * Initiate the hand shake with the host and negotiate
964 * a version that the host can support. We start with the
965 * highest version number and go down if the host cannot
968 memset(&version_req, 0, sizeof(struct dm_version_request));
969 version_req.hdr.type = DM_VERSION_REQUEST;
970 version_req.hdr.size = sizeof(struct dm_version_request);
971 version_req.hdr.trans_id = atomic_inc_return(&trans_id);
972 version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN8;
973 version_req.is_last_attempt = 0;
975 ret = vmbus_sendpacket(dev->channel, &version_req,
976 sizeof(struct dm_version_request),
978 VM_PKT_DATA_INBAND, 0);
982 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
989 * If we could not negotiate a compatible version with the host
990 * fail the probe function.
992 if (dm_device.state == DM_INIT_ERROR) {
997 * Now submit our capabilities to the host.
999 memset(&cap_msg, 0, sizeof(struct dm_capabilities));
1000 cap_msg.hdr.type = DM_CAPABILITIES_REPORT;
1001 cap_msg.hdr.size = sizeof(struct dm_capabilities);
1002 cap_msg.hdr.trans_id = atomic_inc_return(&trans_id);
1004 cap_msg.caps.cap_bits.balloon = 1;
1006 * While we currently don't support hot-add,
1007 * we still advertise this capability since the
1008 * host requires that guests partcipating in the
1009 * dynamic memory protocol support hot add.
1011 cap_msg.caps.cap_bits.hot_add = 1;
1014 * Currently the host does not use these
1015 * values and we set them to what is done in the
1018 cap_msg.min_page_cnt = 0;
1019 cap_msg.max_page_number = -1;
1021 ret = vmbus_sendpacket(dev->channel, &cap_msg,
1022 sizeof(struct dm_capabilities),
1023 (unsigned long)NULL,
1024 VM_PKT_DATA_INBAND, 0);
1028 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
1035 * If the host does not like our capabilities,
1036 * fail the probe function.
1038 if (dm_device.state == DM_INIT_ERROR) {
1043 dm_device.state = DM_INITIALIZED;
1048 kthread_stop(dm_device.thread);
1051 vmbus_close(dev->channel);
1057 static int balloon_remove(struct hv_device *dev)
1059 struct hv_dynmem_device *dm = hv_get_drvdata(dev);
1061 if (dm->num_pages_ballooned != 0)
1062 pr_warn("Ballooned pages: %d\n", dm->num_pages_ballooned);
1064 cancel_work_sync(&dm->balloon_wrk.wrk);
1065 vmbus_close(dev->channel);
1066 kthread_stop(dm->thread);
1072 static const struct hv_vmbus_device_id id_table[] = {
1073 /* Dynamic Memory Class ID */
1074 /* 525074DC-8985-46e2-8057-A307DC18A502 */
1079 MODULE_DEVICE_TABLE(vmbus, id_table);
1081 static struct hv_driver balloon_drv = {
1082 .name = "hv_balloon",
1083 .id_table = id_table,
1084 .probe = balloon_probe,
1085 .remove = balloon_remove,
1088 static int __init init_balloon_drv(void)
1091 return vmbus_driver_register(&balloon_drv);
1094 static void exit_balloon_drv(void)
1097 vmbus_driver_unregister(&balloon_drv);
1100 module_init(init_balloon_drv);
1101 module_exit(exit_balloon_drv);
1103 MODULE_DESCRIPTION("Hyper-V Balloon");
1104 MODULE_VERSION(HV_DRV_VERSION);
1105 MODULE_LICENSE("GPL");