From: tip-bot for Vitaly Kuznetsov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: kys@microsoft.com, sthemmin@microsoft.com,
Tianyu.Lan@microsoft.com, Michael.H.Kelley@microsoft.com,
mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com,
vkuznets@redhat.com, haiyangz@microsoft.com, tglx@linutronix.de
Subject: [tip:x86/hyperv] x86/hyper-v: Implement hv_do_fast_hypercall16
Date: Tue, 3 Jul 2018 00:03:47 -0700 [thread overview]
Message-ID: <tip-53e52966901a5b14caa2a7c77428a693fe71f734@git.kernel.org> (raw)
In-Reply-To: <20180622170625.30688-2-vkuznets@redhat.com>
Commit-ID: 53e52966901a5b14caa2a7c77428a693fe71f734
Gitweb: https://git.kernel.org/tip/53e52966901a5b14caa2a7c77428a693fe71f734
Author: Vitaly Kuznetsov <vkuznets@redhat.com>
AuthorDate: Fri, 22 Jun 2018 19:06:22 +0200
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 3 Jul 2018 09:00:33 +0200
x86/hyper-v: Implement hv_do_fast_hypercall16
Implement 'Fast' hypercall with two 64-bit input parameter. This is
going to be used for HvCallSendSyntheticClusterIpi hypercall.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: devel@linuxdriverproject.org
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Tianyu Lan <Tianyu.Lan@microsoft.com>
Cc: "Michael Kelley (EOSG)" <Michael.H.Kelley@microsoft.com>
Link: https://lkml.kernel.org/r/20180622170625.30688-2-vkuznets@redhat.com
---
arch/x86/include/asm/mshyperv.h | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 3cd14311edfa..da25642940d3 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -193,6 +193,40 @@ static inline u64 hv_do_fast_hypercall8(u16 code, u64 input1)
return hv_status;
}
+/* Fast hypercall with 16 bytes of input */
+static inline u64 hv_do_fast_hypercall16(u16 code, u64 input1, u64 input2)
+{
+ u64 hv_status, control = (u64)code | HV_HYPERCALL_FAST_BIT;
+
+#ifdef CONFIG_X86_64
+ {
+ __asm__ __volatile__("mov %4, %%r8\n"
+ CALL_NOSPEC
+ : "=a" (hv_status), ASM_CALL_CONSTRAINT,
+ "+c" (control), "+d" (input1)
+ : "r" (input2),
+ THUNK_TARGET(hv_hypercall_pg)
+ : "cc", "r8", "r9", "r10", "r11");
+ }
+#else
+ {
+ u32 input1_hi = upper_32_bits(input1);
+ u32 input1_lo = lower_32_bits(input1);
+ u32 input2_hi = upper_32_bits(input2);
+ u32 input2_lo = lower_32_bits(input2);
+
+ __asm__ __volatile__ (CALL_NOSPEC
+ : "=A"(hv_status),
+ "+c"(input1_lo), ASM_CALL_CONSTRAINT
+ : "A" (control), "b" (input1_hi),
+ "D"(input2_hi), "S"(input2_lo),
+ THUNK_TARGET(hv_hypercall_pg)
+ : "cc");
+ }
+#endif
+ return hv_status;
+}
+
/*
* Rep hypercalls. Callers of this functions are supposed to ensure that
* rep_count and varhead_size comply with Hyper-V hypercall definition.
next prev parent reply other threads:[~2018-07-03 7:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-22 17:06 [PATCH 0/4] x86/hyper-v: optimize PV IPIs Vitaly Kuznetsov
2018-06-22 17:06 ` [PATCH 1/4] x86/hyper-v: implement hv_do_fast_hypercall16 Vitaly Kuznetsov
2018-07-03 7:03 ` tip-bot for Vitaly Kuznetsov [this message]
2018-06-22 17:06 ` [PATCH 2/4] x86/hyper-v: use 'fast' hypercall for HVCALL_SEND_IPI Vitaly Kuznetsov
2018-06-25 23:54 ` Michael Kelley (EOSG)
2018-07-03 7:04 ` [tip:x86/hyperv] x86/hyper-v: Use " tip-bot for Vitaly Kuznetsov
2018-06-22 17:06 ` [PATCH 3/4] x86/hyper-v: use cheaper HVCALL_SEND_IPI hypercall when possible Vitaly Kuznetsov
2018-06-26 0:03 ` Michael Kelley (EOSG)
2018-07-03 7:04 ` [tip:x86/hyperv] x86/hyper-v: Use " tip-bot for Vitaly Kuznetsov
2018-06-22 17:06 ` [PATCH 4/4] x86/hyper-v: trace PV IPI send Vitaly Kuznetsov
2018-07-03 7:05 ` [tip:x86/hyperv] x86/hyper-v: Trace " tip-bot for Vitaly Kuznetsov
2018-06-27 0:49 ` [PATCH 0/4] x86/hyper-v: optimize PV IPIs Wanpeng Li
2018-06-27 9:25 ` Vitaly Kuznetsov
2018-06-27 10:27 ` Wanpeng Li
2018-06-27 10:27 ` Wanpeng Li
2018-06-27 9:32 ` Vitaly Kuznetsov
2018-06-28 16:27 ` Vitaly Kuznetsov
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=tip-53e52966901a5b14caa2a7c77428a693fe71f734@git.kernel.org \
--to=tipbot@zytor.com \
--cc=Michael.H.Kelley@microsoft.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=sthemmin@microsoft.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
/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.