]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
argo: introduce the argo_op hypercall boilerplate
authorChristopher Clark <christopher.w.clark@gmail.com>
Wed, 6 Feb 2019 08:55:00 +0000 (09:55 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 7 Feb 2019 13:19:39 +0000 (14:19 +0100)
Presence is gated upon CONFIG_ARGO.

Registers the hypercall previously reserved for this.
Takes 5 arguments, does nothing and returns -ENOSYS.

Implementation will provide a compat ABI so COMPAT_CALL is the selected
macro for the hypercall tables.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/arm/traps.c
xen/arch/x86/guest/hypercall_page.S
xen/arch/x86/hvm/hypercall.c
xen/arch/x86/hypercall.c
xen/arch/x86/pv/hypercall.c
xen/common/Makefile
xen/common/argo.c [new file with mode: 0644]
xen/include/public/xen.h
xen/include/xen/hypercall.h

index 64a78d83a5d25918f4c198820711da5ac12479b8..8741aa1d59ce77890ea5924dc5f1e45ea1fdb28b 100644 (file)
@@ -1401,6 +1401,9 @@ static arm_hypercall_t arm_hypercall_table[] = {
     HYPERCALL(platform_op, 1),
     HYPERCALL_ARM(vcpu_op, 3),
     HYPERCALL(vm_assist, 2),
+#ifdef CONFIG_ARGO
+    HYPERCALL(argo_op, 5),
+#endif
 };
 
 #ifndef NDEBUG
index fdd2e72272472a3ee7888b5401a597dcb371dffc..26afabf909702bb7436d86ee64c076c433e22527 100644 (file)
@@ -59,7 +59,7 @@ DECLARE_HYPERCALL(sysctl)
 DECLARE_HYPERCALL(domctl)
 DECLARE_HYPERCALL(kexec_op)
 DECLARE_HYPERCALL(tmem_op)
-DECLARE_HYPERCALL(xc_reserved_op)
+DECLARE_HYPERCALL(argo_op)
 DECLARE_HYPERCALL(xenpmu_op)
 
 DECLARE_HYPERCALL(arch_0)
index 19d126377a0d58494f22b3b8e23972e0472226ce..5bb1750595e02548735ff636eea0690a647717f3 100644 (file)
@@ -133,6 +133,9 @@ static const hypercall_table_t hvm_hypercall_table[] = {
     HYPERCALL(domctl),
 #ifdef CONFIG_TMEM
     HYPERCALL(tmem_op),
+#endif
+#ifdef CONFIG_ARGO
+    COMPAT_CALL(argo_op),
 #endif
     COMPAT_CALL(platform_op),
 #ifdef CONFIG_PV
index 032de8f8f8f259cf9b42b076ad9f4689dab7f7ac..93e78600da5461bf3c1c4fe49806d78f9c6f5fc0 100644 (file)
@@ -64,6 +64,9 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =
     ARGS(domctl, 1),
     ARGS(kexec_op, 2),
     ARGS(tmem_op, 1),
+#ifdef CONFIG_ARGO
+    ARGS(argo_op, 5),
+#endif
     ARGS(xenpmu_op, 2),
 #ifdef CONFIG_HVM
     ARGS(hvm_op, 2),
index 5d1191173547db1d63a6daa580b3beddcae3616f..f452dd5c0416020fec6d598887971609d7e64b1b 100644 (file)
@@ -76,6 +76,9 @@ const hypercall_table_t pv_hypercall_table[] = {
 #endif
 #ifdef CONFIG_TMEM
     HYPERCALL(tmem_op),
+#endif
+#ifdef CONFIG_ARGO
+    COMPAT_CALL(argo_op),
 #endif
     HYPERCALL(xenpmu_op),
 #ifdef CONFIG_HVM
index 56fc201b6b4e007a5a9e4db7aa3343ba46619149..59ac7ded6e601a9e9806930eb3ad9defa36e5ae5 100644 (file)
@@ -1,3 +1,4 @@
+obj-$(CONFIG_ARGO) += argo.o
 obj-y += bitmap.o
 obj-y += bsearch.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
diff --git a/xen/common/argo.c b/xen/common/argo.c
new file mode 100644 (file)
index 0000000..dd2390d
--- /dev/null
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * Argo : Hypervisor-Mediated data eXchange
+ *
+ * Derived from v4v, the version 2 of v2v.
+ *
+ * Copyright (c) 2010, Citrix Systems
+ * Copyright (c) 2018-2019 BAE Systems
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <xen/errno.h>
+#include <xen/guest_access.h>
+
+long
+do_argo_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg1,
+           XEN_GUEST_HANDLE_PARAM(void) arg2, unsigned long raw_arg3,
+           unsigned long raw_arg4)
+{
+    return -ENOSYS;
+}
+
+#ifdef CONFIG_COMPAT
+long
+compat_argo_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg1,
+               XEN_GUEST_HANDLE_PARAM(void) arg2, unsigned long arg3,
+               unsigned long arg4)
+{
+    return -ENOSYS;
+}
+#endif
index 1a56871d5d11becc265a3ea7b04425e297b78d8c..b3f649176420ecdff26ca48006abf2fa72a71644 100644 (file)
@@ -118,7 +118,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #define __HYPERVISOR_domctl               36
 #define __HYPERVISOR_kexec_op             37
 #define __HYPERVISOR_tmem_op              38
-#define __HYPERVISOR_xc_reserved_op       39 /* reserved for XenClient */
+#define __HYPERVISOR_argo_op              39
 #define __HYPERVISOR_xenpmu_op            40
 #define __HYPERVISOR_dm_op                41
 
index cc99aea57d59d5123d0046559781e26c79c4dc6d..6154c48cb8a95e5bb317dc06b784d19a76ec3710 100644 (file)
@@ -136,6 +136,15 @@ do_tmem_op(
     XEN_GUEST_HANDLE_PARAM(tmem_op_t) uops);
 #endif
 
+#ifdef CONFIG_ARGO
+extern long do_argo_op(
+    unsigned int cmd,
+    XEN_GUEST_HANDLE_PARAM(void) arg1,
+    XEN_GUEST_HANDLE_PARAM(void) arg2,
+    unsigned long arg3,
+    unsigned long arg4);
+#endif
+
 extern long
 do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg);
 
@@ -197,6 +206,15 @@ extern int compat_multicall(
     XEN_GUEST_HANDLE_PARAM(multicall_entry_compat_t) call_list,
     uint32_t nr_calls);
 
+#ifdef CONFIG_ARGO
+extern long compat_argo_op(
+    unsigned int cmd,
+    XEN_GUEST_HANDLE_PARAM(void) arg1,
+    XEN_GUEST_HANDLE_PARAM(void) arg2,
+    unsigned long arg3,
+    unsigned long arg4);
+#endif
+
 #include <compat/hvm/dm_op.h>
 
 extern int