From: Christopher Clark Date: Wed, 6 Feb 2019 08:55:00 +0000 (+0100) Subject: argo: introduce the argo_op hypercall boilerplate X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~2587 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1ddc0d43c20cb1c1125d4d6cefc78624b2a9ccb7;p=xen.git argo: introduce the argo_op hypercall boilerplate 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 Acked-by: Jan Beulich Release-acked-by: Juergen Gross --- diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 64a78d83a5..8741aa1d59 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -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 diff --git a/xen/arch/x86/guest/hypercall_page.S b/xen/arch/x86/guest/hypercall_page.S index fdd2e72272..26afabf909 100644 --- a/xen/arch/x86/guest/hypercall_page.S +++ b/xen/arch/x86/guest/hypercall_page.S @@ -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) diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c index 19d126377a..5bb1750595 100644 --- a/xen/arch/x86/hvm/hypercall.c +++ b/xen/arch/x86/hvm/hypercall.c @@ -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 diff --git a/xen/arch/x86/hypercall.c b/xen/arch/x86/hypercall.c index 032de8f8f8..93e78600da 100644 --- a/xen/arch/x86/hypercall.c +++ b/xen/arch/x86/hypercall.c @@ -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), diff --git a/xen/arch/x86/pv/hypercall.c b/xen/arch/x86/pv/hypercall.c index 5d11911735..f452dd5c04 100644 --- a/xen/arch/x86/pv/hypercall.c +++ b/xen/arch/x86/pv/hypercall.c @@ -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 diff --git a/xen/common/Makefile b/xen/common/Makefile index 56fc201b6b..59ac7ded6e 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -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 index 0000000000..dd2390d3f3 --- /dev/null +++ b/xen/common/argo.c @@ -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 +#include + +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 diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 1a56871d5d..b3f6491764 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -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 diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h index cc99aea57d..6154c48cb8 100644 --- a/xen/include/xen/hypercall.h +++ b/xen/include/xen/hypercall.h @@ -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 extern int