diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2012-12-01 09:46:45 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-17 14:34:37 -0500 |
commit | b3bf60c7b4665d40b8eae2217b54c4745f49f470 (patch) | |
tree | 8d07f29611a65b6b4b06ab95365aadcd77fdf399 /drivers/hv | |
parent | eafa7072e7cd806dff42b705284ca26189e527a4 (diff) |
Drivers: hv: Manage signaling state on a per-connection basis
The current code has a global handle for supporting signaling of the host
from guest. Make this a per-channel attribute as on some versions of the
host we can signal on per-channel handle.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r-- | drivers/hv/channel_mgmt.c | 20 | ||||
-rw-r--r-- | drivers/hv/hyperv_vmbus.h | 21 |
2 files changed, 20 insertions, 21 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 7bf59177aaf8..f4d990285d99 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c | |||
@@ -282,6 +282,26 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr) | |||
282 | */ | 282 | */ |
283 | newchannel->batched_reading = true; | 283 | newchannel->batched_reading = true; |
284 | 284 | ||
285 | /* | ||
286 | * Setup state for signalling the host. | ||
287 | */ | ||
288 | newchannel->sig_event = (struct hv_input_signal_event *) | ||
289 | (ALIGN((unsigned long) | ||
290 | &newchannel->sig_buf, | ||
291 | HV_HYPERCALL_PARAM_ALIGN)); | ||
292 | |||
293 | newchannel->sig_event->connectionid.asu32 = 0; | ||
294 | newchannel->sig_event->connectionid.u.id = VMBUS_EVENT_CONNECTION_ID; | ||
295 | newchannel->sig_event->flag_number = 0; | ||
296 | newchannel->sig_event->rsvdz = 0; | ||
297 | |||
298 | if (vmbus_proto_version != VERSION_WS2008) { | ||
299 | newchannel->is_dedicated_interrupt = | ||
300 | (offer->is_dedicated_interrupt != 0); | ||
301 | newchannel->sig_event->connectionid.u.id = | ||
302 | offer->connection_id; | ||
303 | } | ||
304 | |||
285 | memcpy(&newchannel->offermsg, offer, | 305 | memcpy(&newchannel->offermsg, offer, |
286 | sizeof(struct vmbus_channel_offer_channel)); | 306 | sizeof(struct vmbus_channel_offer_channel)); |
287 | newchannel->monitor_grp = (u8)offer->monitorid / 32; | 307 | newchannel->monitor_grp = (u8)offer->monitorid / 32; |
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index cd48ac331708..1bc7500fb84c 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h | |||
@@ -101,15 +101,6 @@ enum hv_message_type { | |||
101 | /* Define invalid partition identifier. */ | 101 | /* Define invalid partition identifier. */ |
102 | #define HV_PARTITION_ID_INVALID ((u64)0x0) | 102 | #define HV_PARTITION_ID_INVALID ((u64)0x0) |
103 | 103 | ||
104 | /* Define connection identifier type. */ | ||
105 | union hv_connection_id { | ||
106 | u32 asu32; | ||
107 | struct { | ||
108 | u32 id:24; | ||
109 | u32 reserved:8; | ||
110 | } u; | ||
111 | }; | ||
112 | |||
113 | /* Define port identifier type. */ | 104 | /* Define port identifier type. */ |
114 | union hv_port_id { | 105 | union hv_port_id { |
115 | u32 asu32; | 106 | u32 asu32; |
@@ -338,13 +329,6 @@ struct hv_input_post_message { | |||
338 | u64 payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT]; | 329 | u64 payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT]; |
339 | }; | 330 | }; |
340 | 331 | ||
341 | /* Definition of the hv_signal_event hypercall input structure. */ | ||
342 | struct hv_input_signal_event { | ||
343 | union hv_connection_id connectionid; | ||
344 | u16 flag_number; | ||
345 | u16 rsvdz; | ||
346 | }; | ||
347 | |||
348 | /* | 332 | /* |
349 | * Versioning definitions used for guests reporting themselves to the | 333 | * Versioning definitions used for guests reporting themselves to the |
350 | * hypervisor, and visa versa. | 334 | * hypervisor, and visa versa. |
@@ -498,11 +482,6 @@ static const uuid_le VMBUS_SERVICE_ID = { | |||
498 | 482 | ||
499 | 483 | ||
500 | 484 | ||
501 | struct hv_input_signal_event_buffer { | ||
502 | u64 align8; | ||
503 | struct hv_input_signal_event event; | ||
504 | }; | ||
505 | |||
506 | struct hv_context { | 485 | struct hv_context { |
507 | /* We only support running on top of Hyper-V | 486 | /* We only support running on top of Hyper-V |
508 | * So at this point this really can only contain the Hyper-V ID | 487 | * So at this point this really can only contain the Hyper-V ID |