All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: devel@linuxdriverproject.org, x86@kernel.org
Cc: linux-kernel@vger.kernel.org,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Jork Loeser <Jork.Loeser@microsoft.com>
Subject: [PATCH 3/7] hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT
Date: Fri,  7 Apr 2017 13:26:57 +0200	[thread overview]
Message-ID: <20170407112701.17157-4-vkuznets@redhat.com> (raw)
In-Reply-To: <20170407112701.17157-1-vkuznets@redhat.com>

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 <vkuznets@redhat.com>
---
 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

  parent reply	other threads:[~2017-04-07 11:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 11:26 [PATCH 0/7] Hyper-V: praravirtualized remote TLB flushing and hypercall improvements Vitaly Kuznetsov
2017-04-07 11:26 ` [PATCH 1/7] x86/hyperv: make hv_do_hypercall() inline Vitaly Kuznetsov
2017-04-07 19:38   ` Jork Loeser
2017-04-07 11:26 ` [PATCH 2/7] x86/hyper-v: fast hypercall implementation Vitaly Kuznetsov
2017-04-07 19:42   ` Jork Loeser
2017-04-10  9:07     ` Vitaly Kuznetsov
2017-04-10 14:45       ` Vitaly Kuznetsov
2017-04-10 17:14         ` Jork Loeser
2017-04-08 15:18   ` KY Srinivasan
2017-04-10  8:46     ` Vitaly Kuznetsov
2017-04-07 11:26 ` Vitaly Kuznetsov [this message]
2017-04-07 11:26 ` [PATCH 4/7] x86/hyperv: implement rep hypercalls Vitaly Kuznetsov
2017-04-07 19:48   ` Jork Loeser
2017-04-10  9:00     ` Vitaly Kuznetsov
2017-04-07 11:26 ` [PATCH 5/7] hyper-v: globalize vp_index Vitaly Kuznetsov
2017-04-08 15:41   ` KY Srinivasan
2017-04-07 11:27 ` [PATCH 6/7] x86/hyper-v: use hypercall for remove TLB flush Vitaly Kuznetsov
2017-04-07 20:46   ` Jork Loeser
2017-04-10 17:21     ` Vitaly Kuznetsov
2017-04-08 16:47   ` KY Srinivasan
2017-04-10 14:44     ` Vitaly Kuznetsov
2017-04-10 17:34       ` Jork Loeser
2017-04-10 22:03       ` KY Srinivasan
2017-04-07 11:27 ` [PATCH 7/7] tracing/hyper-v: trace hyperv_mmu_flush_tlb_others() Vitaly Kuznetsov
2017-04-07 14:38   ` Steven Rostedt
2017-04-08 14:57 ` [PATCH 0/7] Hyper-V: praravirtualized remote TLB flushing and hypercall improvements KY Srinivasan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170407112701.17157-4-vkuznets@redhat.com \
    --to=vkuznets@redhat.com \
    --cc=Jork.Loeser@microsoft.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.