[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-53e52966901a5b14caa2a7c77428a693fe71f734@git.kernel.org>
Date: Tue, 3 Jul 2018 00:03:47 -0700
From: tip-bot for Vitaly Kuznetsov <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: kys@...rosoft.com, sthemmin@...rosoft.com,
Tianyu.Lan@...rosoft.com, Michael.H.Kelley@...rosoft.com,
mingo@...nel.org, linux-kernel@...r.kernel.org, hpa@...or.com,
vkuznets@...hat.com, haiyangz@...rosoft.com, tglx@...utronix.de
Subject: [tip:x86/hyperv] x86/hyper-v: Implement hv_do_fast_hypercall16
Commit-ID: 53e52966901a5b14caa2a7c77428a693fe71f734
Gitweb: https://git.kernel.org/tip/53e52966901a5b14caa2a7c77428a693fe71f734
Author: Vitaly Kuznetsov <vkuznets@...hat.com>
AuthorDate: Fri, 22 Jun 2018 19:06:22 +0200
Committer: Thomas Gleixner <tglx@...utronix.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@...hat.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: devel@...uxdriverproject.org
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
Cc: Haiyang Zhang <haiyangz@...rosoft.com>
Cc: Stephen Hemminger <sthemmin@...rosoft.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Tianyu Lan <Tianyu.Lan@...rosoft.com>
Cc: "Michael Kelley (EOSG)" <Michael.H.Kelley@...rosoft.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.
Powered by blists - more mailing lists