Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751376AbdFYRHx (ORCPT ); Sun, 25 Jun 2017 13:07:53 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:33980 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbdFYRHw (ORCPT ); Sun, 25 Jun 2017 13:07:52 -0400 x-originating-ip: 107.180.71.197 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, marcelo.cerri@canonical.com, sthemmin@microsoft.com Cc: "K. Y. Srinivasan" Subject: [PATCH 05/10] hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT Date: Sun, 25 Jun 2017 10:06:44 -0700 Message-Id: <1498410409-30997-5-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1498410380-30955-1-git-send-email-kys@exchange.microsoft.com> References: <1498410380-30955-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfJ/TFi0fV3K0NGQ4C5WJNM/GrcVZqlW3xuljX+IzrtnGSjzFq2aDW3L2RQ1XoOZkzhuSFHFgE5iq2qUlva0YqcAyliCTw7kyUB3HIxWiT7bJanC9LTje S/yMbK9Ppzo/qbZu0nszEEG1WJCmdM16NAMVsGoVsfdS8CtbDSLtNPnq/T+/bVkTAVOX3mfgT4+KihaIs6mlZRKK4/oVo8VsKW4NS9ZkouzbaZqAGazPQywx H4bNH1BCDgQBW1+X3lHiFsHSsg/2SyqF7InKf1U/Ek6mLv/phryBxYCOCl4RGMjHRpMulINUfbFMBPCLBFwrjFNIVBmfKGJAt5d+lZfLBlFxnnvhdxVIE7uF NN3toyN33rqDta8U/cbV/G6a2c1s8OKXEnCXjjkPG6Um8WxkACgqrZ9TZK8Q7irTazyV3lf3JiwbTo+I0i0U/7ipKKfys4JXPkwGtbUl+19jQDKJHqRQGvj8 kj45QnxjFMjWQz6uRct34ai7j+zm2XrvUYkwObuts7PO5ezgvU3dIBEg8QGUpDT3KEktG91nzsV4EYAq Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2923 Lines: 90 From: Vitaly Kuznetsov We need to pass only 8 bytes of input for HvSignalEvent which makes it a perfect fit for fast hypercall. hv_input_signal_event_buffer is not needed any more and hv_input_signal_event is converted to union for convenience. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Andy Shevchenko Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c | 13 ++----------- drivers/hv/connection.c | 2 +- include/linux/hyperv.h | 15 +-------------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 0fabd41..f501ce1 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -806,21 +806,12 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr) /* * Setup state for signalling the host. */ - newchannel->sig_event = (struct hv_input_signal_event *) - (ALIGN((unsigned long) - &newchannel->sig_buf, - HV_HYPERCALL_PARAM_ALIGN)); - - newchannel->sig_event->connectionid.asu32 = 0; - newchannel->sig_event->connectionid.u.id = VMBUS_EVENT_CONNECTION_ID; - newchannel->sig_event->flag_number = 0; - newchannel->sig_event->rsvdz = 0; + newchannel->sig_event = VMBUS_EVENT_CONNECTION_ID; if (vmbus_proto_version != VERSION_WS2008) { newchannel->is_dedicated_interrupt = (offer->is_dedicated_interrupt != 0); - newchannel->sig_event->connectionid.u.id = - offer->connection_id; + newchannel->sig_event = offer->connection_id; } memcpy(&newchannel->offermsg, offer, diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index 45e806e..37ecf51 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -408,6 +408,6 @@ void vmbus_set_event(struct vmbus_channel *channel) if (!channel->is_dedicated_interrupt) vmbus_send_interrupt(child_relid); - hv_do_hypercall(HVCALL_SIGNAL_EVENT, channel->sig_event, NULL); + hv_do_fast_hypercall8(HVCALL_SIGNAL_EVENT, channel->sig_event); } EXPORT_SYMBOL_GPL(vmbus_set_event); diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index d1ae02d..2c9a2c8 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -677,18 +677,6 @@ struct vmbus_close_msg { } u; }; -/* Definition of the hv_signal_event hypercall input structure. */ -struct hv_input_signal_event { - union hv_connection_id connectionid; - u16 flag_number; - u16 rsvdz; -}; - -struct hv_input_signal_event_buffer { - u64 align8; - struct hv_input_signal_event event; -}; - enum hv_numa_policy { HV_BALANCED = 0, HV_LOCALIZED, @@ -771,8 +759,7 @@ struct vmbus_channel { } callback_mode; bool is_dedicated_interrupt; - struct hv_input_signal_event_buffer sig_buf; - struct hv_input_signal_event *sig_event; + u64 sig_event; /* * Starting with win8, this field will be used to specify -- 1.7.1