blob: 70ea5d1fc16c375876022ef62dfe22dafb4f0c77 [file] [log] [blame]
Hank Janssen3e7ee492009-07-13 16:02:34 -07001/*
2 *
3 * Copyright (c) 2009, Microsoft Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
20 * Hank Janssen <hjanssen@microsoft.com>
21 *
22 */
Hank Janssen0a466182011-03-29 13:58:47 -070023#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
24
Greg Kroah-Hartmana0086dc2009-08-17 17:22:08 -070025#include <linux/kernel.h>
K. Y. Srinivasan0c3b7b22011-02-11 09:59:43 -080026#include <linux/sched.h>
27#include <linux/wait.h>
K. Y. Srinivasan5289d3d2011-08-25 09:49:01 -070028#include <linux/delay.h>
Greg Kroah-Hartmana0086dc2009-08-17 17:22:08 -070029#include <linux/mm.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090030#include <linux/slab.h>
Greg Kroah-Hartmana0086dc2009-08-17 17:22:08 -070031#include <linux/vmalloc.h>
Greg Kroah-Hartman46a97192011-10-04 12:29:52 -070032#include <linux/hyperv.h>
K. Y. Srinivasan37f72782012-12-01 06:46:41 -080033#include <linux/export.h>
Greg Kroah-Hartman407dd162011-10-11 08:36:44 -060034#include <asm/hyperv.h>
K. Y. Srinivasan0f2a6612011-05-12 19:34:28 -070035#include "hyperv_vmbus.h"
Hank Janssen3e7ee492009-07-13 16:02:34 -070036
Hank Janssen3e7ee492009-07-13 16:02:34 -070037
Haiyang Zhangda9fcb72011-01-26 12:12:14 -080038struct vmbus_connection vmbus_connection = {
39 .conn_state = DISCONNECTED,
40 .next_gpadl_handle = ATOMIC_INIT(0xE1E10),
Hank Janssen3e7ee492009-07-13 16:02:34 -070041};
42
Hank Janssen3e189512010-03-04 22:11:00 +000043/*
K. Y. Srinivasan610071c2012-12-01 06:46:38 -080044 * VMBUS version is 32 bit entity broken up into
45 * two 16 bit quantities: major_number. minor_number.
46 *
47 * 0 . 13 (Windows Server 2008)
48 * 1 . 1 (Windows 7)
49 * 2 . 4 (Windows 8)
50 */
51
52#define VERSION_WS2008 ((0 << 16) | (13))
53#define VERSION_WIN7 ((1 << 16) | (1))
54#define VERSION_WIN8 ((2 << 16) | (4))
55
56#define VERSION_INVAL -1
57
K. Y. Srinivasan37f72782012-12-01 06:46:41 -080058/*
59 * Negotiated protocol version with the host.
60 */
61__u32 vmbus_proto_version;
62EXPORT_SYMBOL_GPL(vmbus_proto_version);
63
K. Y. Srinivasan610071c2012-12-01 06:46:38 -080064static __u32 vmbus_get_next_version(__u32 current_version)
65{
66 switch (current_version) {
67 case (VERSION_WIN7):
68 return VERSION_WS2008;
69
70 case (VERSION_WIN8):
71 return VERSION_WIN7;
72
73 case (VERSION_WS2008):
74 default:
75 return VERSION_INVAL;
76 }
77}
78
79static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
80 __u32 version)
81{
82 int ret = 0;
83 struct vmbus_channel_initiate_contact *msg;
84 unsigned long flags;
85 int t;
86
87 init_completion(&msginfo->waitevent);
88
89 msg = (struct vmbus_channel_initiate_contact *)msginfo->msg;
90
91 msg->header.msgtype = CHANNELMSG_INITIATE_CONTACT;
92 msg->vmbus_version_requested = version;
93 msg->interrupt_page = virt_to_phys(vmbus_connection.int_page);
94 msg->monitor_page1 = virt_to_phys(vmbus_connection.monitor_pages);
95 msg->monitor_page2 = virt_to_phys(
96 (void *)((unsigned long)vmbus_connection.monitor_pages +
97 PAGE_SIZE));
98
99 /*
100 * Add to list before we send the request since we may
101 * receive the response before returning from this routine
102 */
103 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
104 list_add_tail(&msginfo->msglistentry,
105 &vmbus_connection.chn_msg_list);
106
107 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
108
109 ret = vmbus_post_msg(msg,
110 sizeof(struct vmbus_channel_initiate_contact));
111 if (ret != 0) {
112 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
113 list_del(&msginfo->msglistentry);
114 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock,
115 flags);
116 return ret;
117 }
118
119 /* Wait for the connection response */
120 t = wait_for_completion_timeout(&msginfo->waitevent, 5*HZ);
121 if (t == 0) {
122 spin_lock_irqsave(&vmbus_connection.channelmsg_lock,
123 flags);
124 list_del(&msginfo->msglistentry);
125 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock,
126 flags);
127 return -ETIMEDOUT;
128 }
129
130 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
131 list_del(&msginfo->msglistentry);
132 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
133
134 /* Check if successful */
135 if (msginfo->response.version_response.version_supported) {
136 vmbus_connection.conn_state = CONNECTED;
137 } else {
138 pr_err("Unable to connect, "
139 "Version %d not supported by Hyper-V\n",
140 version);
141 return -ECONNREFUSED;
142 }
143
144 return ret;
145}
146
147/*
Haiyang Zhangc6977672011-01-26 12:12:08 -0800148 * vmbus_connect - Sends a connect request on the partition service connection
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700149 */
Haiyang Zhangc6977672011-01-26 12:12:08 -0800150int vmbus_connect(void)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700151{
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700152 int ret = 0;
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800153 struct vmbus_channel_msginfo *msginfo = NULL;
K. Y. Srinivasan610071c2012-12-01 06:46:38 -0800154 __u32 version;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700155
Bill Pemberton454f18a2009-07-27 16:47:24 -0400156 /* Initialize the vmbus connection */
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800157 vmbus_connection.conn_state = CONNECTING;
158 vmbus_connection.work_queue = create_workqueue("hv_vmbus_con");
159 if (!vmbus_connection.work_queue) {
K. Y. Srinivasan3a7546d2011-06-06 15:50:10 -0700160 ret = -ENOMEM;
K. Y. Srinivasanb0043862011-05-10 07:55:44 -0700161 goto cleanup;
Bill Pembertonde65a382009-07-29 17:00:09 -0400162 }
Hank Janssen3e7ee492009-07-13 16:02:34 -0700163
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800164 INIT_LIST_HEAD(&vmbus_connection.chn_msg_list);
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800165 spin_lock_init(&vmbus_connection.channelmsg_lock);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700166
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800167 INIT_LIST_HEAD(&vmbus_connection.chn_list);
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800168 spin_lock_init(&vmbus_connection.channel_lock);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700169
Bill Pemberton454f18a2009-07-27 16:47:24 -0400170 /*
171 * Setup the vmbus event connection for channel interrupt
172 * abstraction stuff
173 */
K. Y. Srinivasandf3493e2011-02-11 09:59:00 -0800174 vmbus_connection.int_page =
175 (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, 0);
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800176 if (vmbus_connection.int_page == NULL) {
K. Y. Srinivasan3a7546d2011-06-06 15:50:10 -0700177 ret = -ENOMEM;
K. Y. Srinivasanb0043862011-05-10 07:55:44 -0700178 goto cleanup;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700179 }
180
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800181 vmbus_connection.recv_int_page = vmbus_connection.int_page;
182 vmbus_connection.send_int_page =
183 (void *)((unsigned long)vmbus_connection.int_page +
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700184 (PAGE_SIZE >> 1));
Hank Janssen3e7ee492009-07-13 16:02:34 -0700185
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700186 /*
187 * Setup the monitor notification facility. The 1st page for
188 * parent->child and the 2nd page for child->parent
Bill Pemberton454f18a2009-07-27 16:47:24 -0400189 */
K. Y. Srinivasandf3493e2011-02-11 09:59:00 -0800190 vmbus_connection.monitor_pages =
191 (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 1);
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800192 if (vmbus_connection.monitor_pages == NULL) {
K. Y. Srinivasan3a7546d2011-06-06 15:50:10 -0700193 ret = -ENOMEM;
K. Y. Srinivasanb0043862011-05-10 07:55:44 -0700194 goto cleanup;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700195 }
196
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800197 msginfo = kzalloc(sizeof(*msginfo) +
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700198 sizeof(struct vmbus_channel_initiate_contact),
199 GFP_KERNEL);
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800200 if (msginfo == NULL) {
Bill Pemberton8cad0af2010-05-05 15:27:32 -0400201 ret = -ENOMEM;
K. Y. Srinivasanb0043862011-05-10 07:55:44 -0700202 goto cleanup;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700203 }
204
Bill Pemberton454f18a2009-07-27 16:47:24 -0400205 /*
K. Y. Srinivasan610071c2012-12-01 06:46:38 -0800206 * Negotiate a compatible VMBUS version number with the
207 * host. We start with the highest number we can support
208 * and work our way down until we negotiate a compatible
209 * version.
Bill Pemberton454f18a2009-07-27 16:47:24 -0400210 */
Bill Pemberton53af5452009-09-11 21:46:44 -0400211
K. Y. Srinivasan610071c2012-12-01 06:46:38 -0800212 version = VERSION_WS2008;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700213
K. Y. Srinivasan610071c2012-12-01 06:46:38 -0800214 do {
215 ret = vmbus_negotiate_version(msginfo, version);
216 if (ret == 0)
217 break;
218
219 version = vmbus_get_next_version(version);
220 } while (version != VERSION_INVAL);
221
222 if (version == VERSION_INVAL)
K. Y. Srinivasanb0043862011-05-10 07:55:44 -0700223 goto cleanup;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700224
K. Y. Srinivasan37f72782012-12-01 06:46:41 -0800225 vmbus_proto_version = version;
226 pr_info("Negotiated host information %d\n", version);
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800227 kfree(msginfo);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700228 return 0;
229
K. Y. Srinivasanb0043862011-05-10 07:55:44 -0700230cleanup:
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800231 vmbus_connection.conn_state = DISCONNECTED;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700232
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800233 if (vmbus_connection.work_queue)
234 destroy_workqueue(vmbus_connection.work_queue);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700235
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800236 if (vmbus_connection.int_page) {
K. Y. Srinivasandf3493e2011-02-11 09:59:00 -0800237 free_pages((unsigned long)vmbus_connection.int_page, 0);
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800238 vmbus_connection.int_page = NULL;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700239 }
240
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800241 if (vmbus_connection.monitor_pages) {
K. Y. Srinivasandf3493e2011-02-11 09:59:00 -0800242 free_pages((unsigned long)vmbus_connection.monitor_pages, 1);
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800243 vmbus_connection.monitor_pages = NULL;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700244 }
245
Ilia Mirkindd9b15d2011-03-13 00:29:00 -0500246 kfree(msginfo);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700247
Hank Janssen3e7ee492009-07-13 16:02:34 -0700248 return ret;
249}
250
Hank Janssen3e7ee492009-07-13 16:02:34 -0700251
Hank Janssen3e189512010-03-04 22:11:00 +0000252/*
Haiyang Zhangc6977672011-01-26 12:12:08 -0800253 * relid2channel - Get the channel object given its
254 * child relative id (ie channel id)
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700255 */
Haiyang Zhangc6977672011-01-26 12:12:08 -0800256struct vmbus_channel *relid2channel(u32 relid)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700257{
Greg Kroah-Hartmanaded7162009-08-18 15:21:19 -0700258 struct vmbus_channel *channel;
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800259 struct vmbus_channel *found_channel = NULL;
Greg Kroah-Hartman0f5e44c2009-07-15 14:57:16 -0700260 unsigned long flags;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700261
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800262 spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800263 list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800264 if (channel->offermsg.child_relid == relid) {
265 found_channel = channel;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700266 break;
267 }
268 }
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800269 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700270
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800271 return found_channel;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700272}
273
Hank Janssen3e189512010-03-04 22:11:00 +0000274/*
Haiyang Zhangc6977672011-01-26 12:12:08 -0800275 * process_chn_event - Process a channel event notification
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700276 */
Olaf Hering35436482011-04-16 18:50:40 +0200277static void process_chn_event(u32 relid)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700278{
Greg Kroah-Hartmanaded7162009-08-18 15:21:19 -0700279 struct vmbus_channel *channel;
K. Y. Srinivasandad76bf2011-08-27 11:31:33 -0700280 unsigned long flags;
K. Y. Srinivasanf878f3d2012-12-01 06:46:35 -0800281 void *arg;
282 bool read_state;
283 u32 bytes_to_read;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700284
Bill Pemberton454f18a2009-07-27 16:47:24 -0400285 /*
286 * Find the channel based on this relid and invokes the
287 * channel callback to process the event
288 */
Haiyang Zhangc6977672011-01-26 12:12:08 -0800289 channel = relid2channel(relid);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700290
K. Y. Srinivasan24326032011-08-31 14:35:57 -0700291 if (!channel) {
292 pr_err("channel not found for relid - %u\n", relid);
293 return;
294 }
295
296 /*
297 * A channel once created is persistent even when there
298 * is no driver handling the device. An unloading driver
299 * sets the onchannel_callback to NULL under the
300 * protection of the channel inbound_lock. Thus, checking
301 * and invoking the driver specific callback takes care of
302 * orderly unloading of the driver.
303 */
304
K. Y. Srinivasandad76bf2011-08-27 11:31:33 -0700305 spin_lock_irqsave(&channel->inbound_lock, flags);
K. Y. Srinivasanf878f3d2012-12-01 06:46:35 -0800306 if (channel->onchannel_callback != NULL) {
307 arg = channel->channel_callback_context;
308 read_state = channel->batched_reading;
309 /*
310 * This callback reads the messages sent by the host.
311 * We can optimize host to guest signaling by ensuring:
312 * 1. While reading the channel, we disable interrupts from
313 * host.
314 * 2. Ensure that we process all posted messages from the host
315 * before returning from this callback.
316 * 3. Once we return, enable signaling from the host. Once this
317 * state is set we check to see if additional packets are
318 * available to read. In this case we repeat the process.
319 */
320
321 do {
322 hv_begin_read(&channel->inbound);
323 channel->onchannel_callback(arg);
324 bytes_to_read = hv_end_read(&channel->inbound);
325 } while (read_state && (bytes_to_read != 0));
326 } else {
K. Y. Srinivasan24326032011-08-31 14:35:57 -0700327 pr_err("no channel callback for relid - %u\n", relid);
K. Y. Srinivasanf878f3d2012-12-01 06:46:35 -0800328 }
K. Y. Srinivasand9add43b2011-08-27 11:31:43 -0700329
K. Y. Srinivasandad76bf2011-08-27 11:31:33 -0700330 spin_unlock_irqrestore(&channel->inbound_lock, flags);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700331}
332
Hank Janssen3e189512010-03-04 22:11:00 +0000333/*
Haiyang Zhangc6977672011-01-26 12:12:08 -0800334 * vmbus_on_event - Handler for events
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700335 */
K. Y. Srinivasan6de3d6a2011-03-10 14:05:16 -0800336void vmbus_on_event(unsigned long data)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700337{
Olaf Hering35436482011-04-16 18:50:40 +0200338 u32 dword;
339 u32 maxdword = MAX_NUM_CHANNELS_SUPPORTED >> 5;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700340 int bit;
Olaf Hering35436482011-04-16 18:50:40 +0200341 u32 relid;
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800342 u32 *recv_int_page = vmbus_connection.recv_int_page;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700343
Bill Pemberton454f18a2009-07-27 16:47:24 -0400344 /* Check events */
Olaf Hering242b45a2011-04-16 18:50:39 +0200345 if (!recv_int_page)
346 return;
347 for (dword = 0; dword < maxdword; dword++) {
348 if (!recv_int_page[dword])
349 continue;
350 for (bit = 0; bit < 32; bit++) {
K. Y. Srinivasand9add43b2011-08-27 11:31:43 -0700351 if (sync_test_and_clear_bit(bit,
352 (unsigned long *)&recv_int_page[dword])) {
Olaf Hering242b45a2011-04-16 18:50:39 +0200353 relid = (dword << 5) + bit;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700354
K. Y. Srinivasand9add43b2011-08-27 11:31:43 -0700355 if (relid == 0)
K. Y. Srinivasan6d81d332011-05-10 07:55:45 -0700356 /*
357 * Special case - vmbus
358 * channel protocol msg
359 */
Olaf Hering242b45a2011-04-16 18:50:39 +0200360 continue;
K. Y. Srinivasand9add43b2011-08-27 11:31:43 -0700361
Olaf Hering35436482011-04-16 18:50:40 +0200362 process_chn_event(relid);
Hank Janssen3e7ee492009-07-13 16:02:34 -0700363 }
Olaf Hering242b45a2011-04-16 18:50:39 +0200364 }
Hank Janssen3e7ee492009-07-13 16:02:34 -0700365 }
Hank Janssen3e7ee492009-07-13 16:02:34 -0700366}
367
Hank Janssen3e189512010-03-04 22:11:00 +0000368/*
Haiyang Zhangc6977672011-01-26 12:12:08 -0800369 * vmbus_post_msg - Send a msg on the vmbus's message connection
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700370 */
Haiyang Zhangc6977672011-01-26 12:12:08 -0800371int vmbus_post_msg(void *buffer, size_t buflen)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700372{
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800373 union hv_connection_id conn_id;
K. Y. Srinivasan5289d3d2011-08-25 09:49:01 -0700374 int ret = 0;
375 int retries = 0;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700376
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800377 conn_id.asu32 = 0;
378 conn_id.u.id = VMBUS_MESSAGE_CONNECTION_ID;
K. Y. Srinivasan5289d3d2011-08-25 09:49:01 -0700379
380 /*
381 * hv_post_message() can have transient failures because of
382 * insufficient resources. Retry the operation a couple of
383 * times before giving up.
384 */
385 while (retries < 3) {
386 ret = hv_post_message(conn_id, 1, buffer, buflen);
387 if (ret != HV_STATUS_INSUFFICIENT_BUFFERS)
388 return ret;
389 retries++;
390 msleep(100);
391 }
392 return ret;
Hank Janssen3e7ee492009-07-13 16:02:34 -0700393}
394
Hank Janssen3e189512010-03-04 22:11:00 +0000395/*
Haiyang Zhangc6977672011-01-26 12:12:08 -0800396 * vmbus_set_event - Send an event notification to the parent
Greg Kroah-Hartmanfd8b85e2009-08-31 11:40:14 -0700397 */
Haiyang Zhangc6977672011-01-26 12:12:08 -0800398int vmbus_set_event(u32 child_relid)
Hank Janssen3e7ee492009-07-13 16:02:34 -0700399{
Bill Pemberton454f18a2009-07-27 16:47:24 -0400400 /* Each u32 represents 32 channels */
Olaf Hering22356582011-03-21 14:41:37 +0100401 sync_set_bit(child_relid & 31,
Haiyang Zhangda9fcb72011-01-26 12:12:14 -0800402 (unsigned long *)vmbus_connection.send_int_page +
Haiyang Zhang15b2f642011-01-26 12:12:07 -0800403 (child_relid >> 5));
Bill Pemberton7c369f42009-07-29 17:00:11 -0400404
Haiyang Zhangd44890c2010-11-08 14:04:42 -0800405 return hv_signal_event();
Hank Janssen3e7ee492009-07-13 16:02:34 -0700406}