Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm: xen: implement multicall hypercall support.

As part of this make the usual change to xen_ulong_t in place of unsigned long.
This change has no impact on x86.

The Linux definition of struct multicall_entry.result differs from the Xen
definition, I think for good reasons, and used a long rather than an unsigned
long. Therefore introduce a xen_long_t, which is a long on x86 architectures
and a signed 64-bit integer on ARM.

Use uint32_t nr_calls on x86 for consistency with the ARM definition.

Build tested on amd64 and i386 builds. Runtime tested on ARM.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>

authored by

Ian Campbell and committed by
David Vrabel
5e40704e 1aae31c8

+12 -9
+1 -5
arch/arm/include/asm/xen/hypercall.h
··· 48 48 int HYPERVISOR_physdev_op(int cmd, void *arg); 49 49 int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args); 50 50 int HYPERVISOR_tmem_op(void *arg); 51 + int HYPERVISOR_multicall(struct multicall_entry *calls, uint32_t nr); 51 52 52 53 static inline void 53 54 MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va, ··· 64 63 BUG(); 65 64 } 66 65 67 - static inline int 68 - HYPERVISOR_multicall(void *call_list, int nr_calls) 69 - { 70 - BUG(); 71 - } 72 66 #endif /* _ASM_ARM_XEN_HYPERCALL_H */
+2
arch/arm/include/asm/xen/interface.h
··· 40 40 #define PRI_xen_pfn "llx" 41 41 typedef uint64_t xen_ulong_t; 42 42 #define PRI_xen_ulong "llx" 43 + typedef int64_t xen_long_t; 44 + #define PRI_xen_long "llx" 43 45 /* Guest handles for primitive C types. */ 44 46 __DEFINE_GUEST_HANDLE(uchar, unsigned char); 45 47 __DEFINE_GUEST_HANDLE(uint, unsigned int);
+1
arch/arm/xen/hypercall.S
··· 89 89 HYPERCALL2(physdev_op); 90 90 HYPERCALL3(vcpu_op); 91 91 HYPERCALL1(tmem_op); 92 + HYPERCALL2(multicall); 92 93 93 94 ENTRY(privcmd_call) 94 95 stmdb sp!, {r4}
+1
arch/arm64/xen/hypercall.S
··· 80 80 HYPERCALL2(physdev_op); 81 81 HYPERCALL3(vcpu_op); 82 82 HYPERCALL1(tmem_op); 83 + HYPERCALL2(multicall); 83 84 84 85 ENTRY(privcmd_call) 85 86 mov x16, x0
+1 -1
arch/x86/include/asm/xen/hypercall.h
··· 343 343 } 344 344 345 345 static inline int 346 - HYPERVISOR_multicall(void *call_list, int nr_calls) 346 + HYPERVISOR_multicall(void *call_list, uint32_t nr_calls) 347 347 { 348 348 return _hypercall2(int, multicall, call_list, nr_calls); 349 349 }
+3
arch/x86/include/asm/xen/interface.h
··· 54 54 #define PRI_xen_pfn "lx" 55 55 typedef unsigned long xen_ulong_t; 56 56 #define PRI_xen_ulong "lx" 57 + typedef long xen_long_t; 58 + #define PRI_xen_long "lx" 59 + 57 60 /* Guest handles for primitive C types. */ 58 61 __DEFINE_GUEST_HANDLE(uchar, unsigned char); 59 62 __DEFINE_GUEST_HANDLE(uint, unsigned int);
+3 -3
include/xen/interface/xen.h
··· 275 275 * NB. The fields are natural register size for this architecture. 276 276 */ 277 277 struct multicall_entry { 278 - unsigned long op; 279 - long result; 280 - unsigned long args[6]; 278 + xen_ulong_t op; 279 + xen_long_t result; 280 + xen_ulong_t args[6]; 281 281 }; 282 282 DEFINE_GUEST_HANDLE_STRUCT(multicall_entry); 283 283