Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933138AbdDGL2e (ORCPT ); Fri, 7 Apr 2017 07:28:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60804 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755778AbdDGL1P (ORCPT ); Fri, 7 Apr 2017 07:27:15 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 00C4C7A4A2 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vkuznets@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 00C4C7A4A2 From: Vitaly Kuznetsov To: devel@linuxdriverproject.org, x86@kernel.org Cc: linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Steven Rostedt , Jork Loeser Subject: [PATCH 3/7] hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT Date: Fri, 7 Apr 2017 13:26:57 +0200 Message-Id: <20170407112701.17157-4-vkuznets@redhat.com> In-Reply-To: <20170407112701.17157-1-vkuznets@redhat.com> References: <20170407112701.17157-1-vkuznets@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 07 Apr 2017 11:27:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3010 Lines: 93 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 --- drivers/hv/channel_mgmt.c | 15 +++++---------- drivers/hv/connection.c | 3 ++- include/linux/hyperv.h | 19 ++++++++----------- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 735f936..6cfa297 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -804,20 +804,15 @@ 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.connectionid.asu32 = 0; + newchannel->sig_event.connectionid.u.id = VMBUS_EVENT_CONNECTION_ID; + newchannel->sig_event.flag_number = 0; + newchannel->sig_event.rsvdz = 0; if (vmbus_proto_version != VERSION_WS2008) { newchannel->is_dedicated_interrupt = (offer->is_dedicated_interrupt != 0); - newchannel->sig_event->connectionid.u.id = + newchannel->sig_event.connectionid.u.id = offer->connection_id; } diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index cf77c7f..545f2a4 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -405,6 +405,7 @@ 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.as_uint64); } EXPORT_SYMBOL_GPL(vmbus_set_event); diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 677f084..5d6777c 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -678,15 +678,13 @@ union hv_connection_id { }; /* 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; +union hv_input_signal_event { + u64 as_uint64; + struct { + union hv_connection_id connectionid; + u16 flag_number; + u16 rsvdz; + }; }; enum hv_numa_policy { @@ -771,8 +769,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; + union hv_input_signal_event sig_event; /* * Starting with win8, this field will be used to specify -- 2.9.3