* [PATCH xen v3] xen: arm: fully implement multicall interface.
@ 2014-04-17 12:57 Ian Campbell
2014-04-17 12:57 ` [PATCH linux v3] arm: xen: implement multicall hypercall support Ian Campbell
2014-04-17 14:00 ` [PATCH xen v3] xen: arm: fully implement multicall interface Julien Grall
0 siblings, 2 replies; 14+ messages in thread
From: Ian Campbell @ 2014-04-17 12:57 UTC (permalink / raw)
To: xen-devel; +Cc: keir, julien.grall, tim, Ian Campbell, stefano.stabellini
I'm not sure what I was smoking at the time of 5d74ad1a082e "xen: arm:
implement do_multicall_call for both 32 and 64-bit" but it is obviously
insufficient since it doesn't actually wire up the hypercall.
Before doing so we need to make the usual adjustments for ARM and turn the
unsigned longs into xen_ulong_t. There is no difference in the resulting
structure for x86.
There are knock on changes to the trace interface, but again they are nops on
x86.
For 32-bit ARM guests we require that the arguments which they pass to a
hypercall via a multicall do not use the upper bits of xen_ulong_t and kill
them if they violate this. This should ensure that no ABI surprises can be
silently lurking when running on a 32-bit hypervisor waiting to pounce when the
same kernel is run on a 64-bit hypervisor. Killing the guest is harsh but it
will be far easier to relax the restriction if it turns out to cause problems
than to tighten it up if we were lax to begin with.
In the interests of clarity and always using explicitly sized types change the
unsigned int in the hypercall arguments to a uint32_t. There is no actual
change here on any platform.
We should consider backporting this to 4.4.1 in case a guest decides they want
to use a multicall in common code e.g. I suggested such a thing while
reviewing a netback change recently.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: keir@xen.org
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
v3: - use domain_crash not domain_crash_synchronous
- likely/unlikely dependency already in staging.
v2: - update compat version of __trace_multicall_call too
- update xen.h on requirements when sizeof(xen_ulong_t) > sizeof(a register)
- kill 32-bit guests which do not follow those requirements. After the
conversation on v1 I decided that starting out harsh and relaxing if it
becomes a problem was easier than discovering a mistake later.
---
xen/arch/arm/traps.c | 28 ++++++++++++++++++++++++++--
xen/common/compat/multicall.c | 2 +-
xen/common/multicall.c | 4 ++--
xen/common/trace.c | 2 +-
xen/include/public/xen.h | 10 ++++++----
xen/include/xen/trace.h | 2 +-
6 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index a7edc4e..8ed2509 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -17,6 +17,7 @@
*/
#include <xen/config.h>
+#include <xen/stdbool.h>
#include <xen/init.h>
#include <xen/string.h>
#include <xen/version.h>
@@ -1012,6 +1013,7 @@ static arm_hypercall_t arm_hypercall_table[] = {
HYPERCALL(sysctl, 2),
HYPERCALL(hvm_op, 2),
HYPERCALL(grant_table_op, 3),
+ HYPERCALL(multicall, 2),
HYPERCALL_ARM(vcpu_op, 3),
};
@@ -1159,6 +1161,24 @@ static void do_trap_hypercall(struct cpu_user_regs *regs, register_t *nr,
#endif
}
+static bool_t check_multicall_32bit_clean(struct multicall_entry *multi)
+{
+ int i;
+
+ for ( i = 0; i < arm_hypercall_table[multi->op].nr_args; i++ )
+ {
+ if ( unlikely(multi->args[i] & 0xffffffff00000000ULL) )
+ {
+ printk("%pv: multicall argument %d is not 32-bit clean %"PRIx64"\n",
+ current, i, multi->args[i]);
+ domain_crash(current->domain);
+ return false;
+ }
+ }
+
+ return true;
+}
+
void do_multicall_call(struct multicall_entry *multi)
{
arm_hypercall_fn_t call = NULL;
@@ -1176,9 +1196,13 @@ void do_multicall_call(struct multicall_entry *multi)
return;
}
+ if ( is_32bit_domain(current->domain) &&
+ !check_multicall_32bit_clean(multi) )
+ return;
+
multi->result = call(multi->args[0], multi->args[1],
- multi->args[2], multi->args[3],
- multi->args[4]);
+ multi->args[2], multi->args[3],
+ multi->args[4]);
}
/*
diff --git a/xen/common/compat/multicall.c b/xen/common/compat/multicall.c
index 95c047a..2af8aef 100644
--- a/xen/common/compat/multicall.c
+++ b/xen/common/compat/multicall.c
@@ -29,7 +29,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_compat_t);
static void __trace_multicall_call(multicall_entry_t *call)
{
- unsigned long args[6];
+ xen_ulong_t args[6];
int i;
for ( i = 0; i < ARRAY_SIZE(args); i++ )
diff --git a/xen/common/multicall.c b/xen/common/multicall.c
index e66c798..fa9d910 100644
--- a/xen/common/multicall.c
+++ b/xen/common/multicall.c
@@ -35,10 +35,10 @@ static void trace_multicall_call(multicall_entry_t *call)
ret_t
do_multicall(
- XEN_GUEST_HANDLE_PARAM(multicall_entry_t) call_list, unsigned int nr_calls)
+ XEN_GUEST_HANDLE_PARAM(multicall_entry_t) call_list, uint32_t nr_calls)
{
struct mc_state *mcs = ¤t->mc_state;
- unsigned int i;
+ uint32_t i;
int rc = 0;
if ( unlikely(__test_and_set_bit(_MCSF_in_multicall, &mcs->flags)) )
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 1814165..f651cf3 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -817,7 +817,7 @@ unlock:
}
void __trace_hypercall(uint32_t event, unsigned long op,
- const unsigned long *args)
+ const xen_ulong_t *args)
{
struct __packed {
uint32_t op;
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 8c5697e..a6a2092 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -541,13 +541,15 @@ DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
/*
* ` enum neg_errnoval
* ` HYPERVISOR_multicall(multicall_entry_t call_list[],
- * ` unsigned int nr_calls);
+ * ` uint32_t nr_calls);
*
- * NB. The fields are natural register size for this architecture.
+ * NB. The fields are logically the natural register size for this
+ * architecture. In cases where xen_ulong_t is larger than this then
+ * any unused bits in the upper portion must be zero.
*/
struct multicall_entry {
- unsigned long op, result;
- unsigned long args[6];
+ xen_ulong_t op, result;
+ xen_ulong_t args[6];
};
typedef struct multicall_entry multicall_entry_t;
DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
diff --git a/xen/include/xen/trace.h b/xen/include/xen/trace.h
index 3b8a7b3..12966ea 100644
--- a/xen/include/xen/trace.h
+++ b/xen/include/xen/trace.h
@@ -45,7 +45,7 @@ static inline void trace_var(u32 event, int cycles, int extra,
}
void __trace_hypercall(uint32_t event, unsigned long op,
- const unsigned long *args);
+ const xen_ulong_t *args);
/* Convenience macros for calling the trace function. */
#define TRACE_0D(_e) \
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-04-17 12:57 [PATCH xen v3] xen: arm: fully implement multicall interface Ian Campbell
@ 2014-04-17 12:57 ` Ian Campbell
2014-04-24 12:03 ` Ian Campbell
2014-04-17 14:00 ` [PATCH xen v3] xen: arm: fully implement multicall interface Julien Grall
1 sibling, 1 reply; 14+ messages in thread
From: Ian Campbell @ 2014-04-17 12:57 UTC (permalink / raw)
To: xen-devel
Cc: Ian Campbell, julien.grall, tim, David Vrabel, Boris Ostrovsky,
stefano.stabellini
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>
Cc: David Vrabel <david.vrabel@citrix.com>
---
v3: - Add for arm64 too
v2: - Typo in commit message.
- Update x86 prototype for HYPERCALL_multicall for consistency (nr_calls
is a uint32_t).
Tested on ARM and arm64 with a stupid patch:
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index b96723e..8b1dc7a 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -339,6 +339,63 @@ static int __init xen_pm_init(void)
}
late_initcall(xen_pm_init);
+static int __init multicall_test(void)
+{
+ struct multicall_entry templ[3];
+ struct multicall_entry call[3];
+ const char *str0 = "This is the first debug string\n";
+ const char *str1 = "This is the second debug string\n";
+ const char *str2 = "This is the third debug string\n";
+ int ret;
+
+ templ[0] = (struct multicall_entry) {
+ .op = __HYPERVISOR_console_io,
+ .args[0] = CONSOLEIO_write,
+ .args[1] = strlen(str0),
+ .args[2] = (uintptr_t)str0
+ };
+ templ[1] = (struct multicall_entry) {
+ .op = __HYPERVISOR_console_io,
+ .args[0] = CONSOLEIO_write,
+ .args[1] = strlen(str1),
+ .args[2] = (uintptr_t)str1
+ };
+ templ[2] = (struct multicall_entry) {
+ .op = __HYPERVISOR_console_io,
+ .args[0] = CONSOLEIO_write,
+ .args[1] = strlen(str2),
+ .args[2] = (uintptr_t)str2
+ };
+
+ memcpy(call, templ, sizeof(templ));
+
+ ret = HYPERVISOR_multicall(call, ARRAY_SIZE(call));
+ printk("1st MULTICALL returned %d\n", ret);
+ if (ret == 0) {
+ printk("call[0].result = %"PRI_xen_long"\n", call[0].result);
+ printk("call[1].result = %"PRI_xen_long"\n", call[1].result);
+ printk("call[2].result = %"PRI_xen_long"\n", call[2].result);
+ }
+
+ memcpy(call, templ, sizeof(templ));
+ call[1].args[0] |= 0xf000000000000000ULL;
+
+ /*
+ * On arm: should die after printing first string, shouldn't print third
+ * On arm64: should print all three.
+ */
+ ret = HYPERVISOR_multicall(call, ARRAY_SIZE(call));
+ printk("2nd MULTICALL returned %d\n", ret);
+ if (ret == 0) {
+ printk("call[0].result = %"PRI_xen_long"\n", call[0].result);
+ printk("call[1].result = %"PRI_xen_long"\n", call[1].result);
+ printk("call[2].result = %"PRI_xen_long"\n", call[2].result);
+ }
+
+ return 0;
+}
+late_initcall(multicall_test);
+
/* In the hypervisor.S file. */
EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
---
arch/arm/include/asm/xen/hypercall.h | 6 +-----
arch/arm/include/asm/xen/interface.h | 2 ++
arch/arm/xen/hypercall.S | 1 +
arch/arm64/xen/hypercall.S | 1 +
arch/x86/include/asm/xen/hypercall.h | 2 +-
arch/x86/include/asm/xen/interface.h | 3 +++
include/xen/interface/xen.h | 6 +++---
7 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/arch/arm/include/asm/xen/hypercall.h b/arch/arm/include/asm/xen/hypercall.h
index 7704e28..7658150 100644
--- a/arch/arm/include/asm/xen/hypercall.h
+++ b/arch/arm/include/asm/xen/hypercall.h
@@ -48,6 +48,7 @@ int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
int HYPERVISOR_physdev_op(int cmd, void *arg);
int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
int HYPERVISOR_tmem_op(void *arg);
+int HYPERVISOR_multicall(struct multicall_entry *calls, uint32_t nr);
static inline void
MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
@@ -63,9 +64,4 @@ MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
BUG();
}
-static inline int
-HYPERVISOR_multicall(void *call_list, int nr_calls)
-{
- BUG();
-}
#endif /* _ASM_ARM_XEN_HYPERCALL_H */
diff --git a/arch/arm/include/asm/xen/interface.h b/arch/arm/include/asm/xen/interface.h
index 1151188..5006600 100644
--- a/arch/arm/include/asm/xen/interface.h
+++ b/arch/arm/include/asm/xen/interface.h
@@ -40,6 +40,8 @@ typedef uint64_t xen_pfn_t;
#define PRI_xen_pfn "llx"
typedef uint64_t xen_ulong_t;
#define PRI_xen_ulong "llx"
+typedef int64_t xen_long_t;
+#define PRI_xen_long "llx"
/* Guest handles for primitive C types. */
__DEFINE_GUEST_HANDLE(uchar, unsigned char);
__DEFINE_GUEST_HANDLE(uint, unsigned int);
diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S
index d1cf7b7..44e3a5f 100644
--- a/arch/arm/xen/hypercall.S
+++ b/arch/arm/xen/hypercall.S
@@ -89,6 +89,7 @@ HYPERCALL2(memory_op);
HYPERCALL2(physdev_op);
HYPERCALL3(vcpu_op);
HYPERCALL1(tmem_op);
+HYPERCALL2(multicall);
ENTRY(privcmd_call)
stmdb sp!, {r4}
diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
index 531342e..8bbe940 100644
--- a/arch/arm64/xen/hypercall.S
+++ b/arch/arm64/xen/hypercall.S
@@ -80,6 +80,7 @@ HYPERCALL2(memory_op);
HYPERCALL2(physdev_op);
HYPERCALL3(vcpu_op);
HYPERCALL1(tmem_op);
+HYPERCALL2(multicall);
ENTRY(privcmd_call)
mov x16, x0
diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index e709884..ca08a27 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -343,7 +343,7 @@ HYPERVISOR_memory_op(unsigned int cmd, void *arg)
}
static inline int
-HYPERVISOR_multicall(void *call_list, int nr_calls)
+HYPERVISOR_multicall(void *call_list, uint32_t nr_calls)
{
return _hypercall2(int, multicall, call_list, nr_calls);
}
diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h
index fd9cb76..3400dba 100644
--- a/arch/x86/include/asm/xen/interface.h
+++ b/arch/x86/include/asm/xen/interface.h
@@ -54,6 +54,9 @@ typedef unsigned long xen_pfn_t;
#define PRI_xen_pfn "lx"
typedef unsigned long xen_ulong_t;
#define PRI_xen_ulong "lx"
+typedef long xen_long_t;
+#define PRI_xen_long "lx"
+
/* Guest handles for primitive C types. */
__DEFINE_GUEST_HANDLE(uchar, unsigned char);
__DEFINE_GUEST_HANDLE(uint, unsigned int);
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 0cd5ca3..de08213 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -275,9 +275,9 @@ DEFINE_GUEST_HANDLE_STRUCT(mmu_update);
* NB. The fields are natural register size for this architecture.
*/
struct multicall_entry {
- unsigned long op;
- long result;
- unsigned long args[6];
+ xen_ulong_t op;
+ xen_long_t result;
+ xen_ulong_t args[6];
};
DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH xen v3] xen: arm: fully implement multicall interface.
2014-04-17 12:57 [PATCH xen v3] xen: arm: fully implement multicall interface Ian Campbell
2014-04-17 12:57 ` [PATCH linux v3] arm: xen: implement multicall hypercall support Ian Campbell
@ 2014-04-17 14:00 ` Julien Grall
2014-04-17 14:13 ` Ian Campbell
1 sibling, 1 reply; 14+ messages in thread
From: Julien Grall @ 2014-04-17 14:00 UTC (permalink / raw)
To: Ian Campbell; +Cc: keir, stefano.stabellini, tim, xen-devel
On 04/17/2014 01:57 PM, Ian Campbell wrote:
> void do_multicall_call(struct multicall_entry *multi)
> {
> arm_hypercall_fn_t call = NULL;
> @@ -1176,9 +1196,13 @@ void do_multicall_call(struct multicall_entry *multi)
> return;
> }
>
> + if ( is_32bit_domain(current->domain) &&
> + !check_multicall_32bit_clean(multi) )
> + return;
> +
With this solution, you continue to go through the other multicall.
Shouldn't we return an error here and exit the loop in do_multicall?
--
Julien Grall
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH xen v3] xen: arm: fully implement multicall interface.
2014-04-17 14:00 ` [PATCH xen v3] xen: arm: fully implement multicall interface Julien Grall
@ 2014-04-17 14:13 ` Ian Campbell
2014-04-17 14:24 ` Julien Grall
0 siblings, 1 reply; 14+ messages in thread
From: Ian Campbell @ 2014-04-17 14:13 UTC (permalink / raw)
To: Julien Grall; +Cc: keir, stefano.stabellini, tim, xen-devel
On Thu, 2014-04-17 at 15:00 +0100, Julien Grall wrote:
> On 04/17/2014 01:57 PM, Ian Campbell wrote:
> > void do_multicall_call(struct multicall_entry *multi)
> > {
> > arm_hypercall_fn_t call = NULL;
> > @@ -1176,9 +1196,13 @@ void do_multicall_call(struct multicall_entry *multi)
> > return;
> > }
> >
> > + if ( is_32bit_domain(current->domain) &&
> > + !check_multicall_32bit_clean(multi) )
> > + return;
> > +
>
> With this solution, you continue to go through the other multicall.
> Shouldn't we return an error here and exit the loop in do_multicall?
See the previous discussion with Jan on v2, calling domain_crash will
cause do_multicall to be preempted.
Ian.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH xen v3] xen: arm: fully implement multicall interface.
2014-04-17 14:13 ` Ian Campbell
@ 2014-04-17 14:24 ` Julien Grall
0 siblings, 0 replies; 14+ messages in thread
From: Julien Grall @ 2014-04-17 14:24 UTC (permalink / raw)
To: Ian Campbell; +Cc: keir, stefano.stabellini, tim, xen-devel
On 04/17/2014 03:13 PM, Ian Campbell wrote:
> On Thu, 2014-04-17 at 15:00 +0100, Julien Grall wrote:
>> On 04/17/2014 01:57 PM, Ian Campbell wrote:
>>> void do_multicall_call(struct multicall_entry *multi)
>>> {
>>> arm_hypercall_fn_t call = NULL;
>>> @@ -1176,9 +1196,13 @@ void do_multicall_call(struct multicall_entry *multi)
>>> return;
>>> }
>>>
>>> + if ( is_32bit_domain(current->domain) &&
>>> + !check_multicall_32bit_clean(multi) )
>>> + return;
>>> +
>>
>> With this solution, you continue to go through the other multicall.
>> Shouldn't we return an error here and exit the loop in do_multicall?
>
> See the previous discussion with Jan on v2, calling domain_crash will
> cause do_multicall to be preempted.
I missed this part sorry.
Acked-by: Julien Grall <julien.grall@linaro.org>
--
Julien Grall
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-04-17 12:57 ` [PATCH linux v3] arm: xen: implement multicall hypercall support Ian Campbell
@ 2014-04-24 12:03 ` Ian Campbell
2014-04-24 12:29 ` David Vrabel
2014-04-25 17:17 ` Stefano Stabellini
0 siblings, 2 replies; 14+ messages in thread
From: Ian Campbell @ 2014-04-24 12:03 UTC (permalink / raw)
To: xen-devel
Cc: julien.grall, tim, David Vrabel, Boris Ostrovsky,
stefano.stabellini
On Thu, 2014-04-17 at 13:57 +0100, Ian Campbell wrote:
Ping? (FYI the Xen side has just been committed)
> 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>
> Cc: David Vrabel <david.vrabel@citrix.com>
> ---
> v3: - Add for arm64 too
> v2: - Typo in commit message.
> - Update x86 prototype for HYPERCALL_multicall for consistency (nr_calls
> is a uint32_t).
>
> Tested on ARM and arm64 with a stupid patch:
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index b96723e..8b1dc7a 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -339,6 +339,63 @@ static int __init xen_pm_init(void)
> }
> late_initcall(xen_pm_init);
>
> +static int __init multicall_test(void)
> +{
> + struct multicall_entry templ[3];
> + struct multicall_entry call[3];
> + const char *str0 = "This is the first debug string\n";
> + const char *str1 = "This is the second debug string\n";
> + const char *str2 = "This is the third debug string\n";
> + int ret;
> +
> + templ[0] = (struct multicall_entry) {
> + .op = __HYPERVISOR_console_io,
> + .args[0] = CONSOLEIO_write,
> + .args[1] = strlen(str0),
> + .args[2] = (uintptr_t)str0
> + };
> + templ[1] = (struct multicall_entry) {
> + .op = __HYPERVISOR_console_io,
> + .args[0] = CONSOLEIO_write,
> + .args[1] = strlen(str1),
> + .args[2] = (uintptr_t)str1
> + };
> + templ[2] = (struct multicall_entry) {
> + .op = __HYPERVISOR_console_io,
> + .args[0] = CONSOLEIO_write,
> + .args[1] = strlen(str2),
> + .args[2] = (uintptr_t)str2
> + };
> +
> + memcpy(call, templ, sizeof(templ));
> +
> + ret = HYPERVISOR_multicall(call, ARRAY_SIZE(call));
> + printk("1st MULTICALL returned %d\n", ret);
> + if (ret == 0) {
> + printk("call[0].result = %"PRI_xen_long"\n", call[0].result);
> + printk("call[1].result = %"PRI_xen_long"\n", call[1].result);
> + printk("call[2].result = %"PRI_xen_long"\n", call[2].result);
> + }
> +
> + memcpy(call, templ, sizeof(templ));
> + call[1].args[0] |= 0xf000000000000000ULL;
> +
> + /*
> + * On arm: should die after printing first string, shouldn't print third
> + * On arm64: should print all three.
> + */
> + ret = HYPERVISOR_multicall(call, ARRAY_SIZE(call));
> + printk("2nd MULTICALL returned %d\n", ret);
> + if (ret == 0) {
> + printk("call[0].result = %"PRI_xen_long"\n", call[0].result);
> + printk("call[1].result = %"PRI_xen_long"\n", call[1].result);
> + printk("call[2].result = %"PRI_xen_long"\n", call[2].result);
> + }
> +
> + return 0;
> +}
> +late_initcall(multicall_test);
> +
> /* In the hypervisor.S file. */
> EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> ---
> arch/arm/include/asm/xen/hypercall.h | 6 +-----
> arch/arm/include/asm/xen/interface.h | 2 ++
> arch/arm/xen/hypercall.S | 1 +
> arch/arm64/xen/hypercall.S | 1 +
> arch/x86/include/asm/xen/hypercall.h | 2 +-
> arch/x86/include/asm/xen/interface.h | 3 +++
> include/xen/interface/xen.h | 6 +++---
> 7 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/include/asm/xen/hypercall.h b/arch/arm/include/asm/xen/hypercall.h
> index 7704e28..7658150 100644
> --- a/arch/arm/include/asm/xen/hypercall.h
> +++ b/arch/arm/include/asm/xen/hypercall.h
> @@ -48,6 +48,7 @@ int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
> int HYPERVISOR_physdev_op(int cmd, void *arg);
> int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
> int HYPERVISOR_tmem_op(void *arg);
> +int HYPERVISOR_multicall(struct multicall_entry *calls, uint32_t nr);
>
> static inline void
> MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
> @@ -63,9 +64,4 @@ MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
> BUG();
> }
>
> -static inline int
> -HYPERVISOR_multicall(void *call_list, int nr_calls)
> -{
> - BUG();
> -}
> #endif /* _ASM_ARM_XEN_HYPERCALL_H */
> diff --git a/arch/arm/include/asm/xen/interface.h b/arch/arm/include/asm/xen/interface.h
> index 1151188..5006600 100644
> --- a/arch/arm/include/asm/xen/interface.h
> +++ b/arch/arm/include/asm/xen/interface.h
> @@ -40,6 +40,8 @@ typedef uint64_t xen_pfn_t;
> #define PRI_xen_pfn "llx"
> typedef uint64_t xen_ulong_t;
> #define PRI_xen_ulong "llx"
> +typedef int64_t xen_long_t;
> +#define PRI_xen_long "llx"
> /* Guest handles for primitive C types. */
> __DEFINE_GUEST_HANDLE(uchar, unsigned char);
> __DEFINE_GUEST_HANDLE(uint, unsigned int);
> diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S
> index d1cf7b7..44e3a5f 100644
> --- a/arch/arm/xen/hypercall.S
> +++ b/arch/arm/xen/hypercall.S
> @@ -89,6 +89,7 @@ HYPERCALL2(memory_op);
> HYPERCALL2(physdev_op);
> HYPERCALL3(vcpu_op);
> HYPERCALL1(tmem_op);
> +HYPERCALL2(multicall);
>
> ENTRY(privcmd_call)
> stmdb sp!, {r4}
> diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
> index 531342e..8bbe940 100644
> --- a/arch/arm64/xen/hypercall.S
> +++ b/arch/arm64/xen/hypercall.S
> @@ -80,6 +80,7 @@ HYPERCALL2(memory_op);
> HYPERCALL2(physdev_op);
> HYPERCALL3(vcpu_op);
> HYPERCALL1(tmem_op);
> +HYPERCALL2(multicall);
>
> ENTRY(privcmd_call)
> mov x16, x0
> diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
> index e709884..ca08a27 100644
> --- a/arch/x86/include/asm/xen/hypercall.h
> +++ b/arch/x86/include/asm/xen/hypercall.h
> @@ -343,7 +343,7 @@ HYPERVISOR_memory_op(unsigned int cmd, void *arg)
> }
>
> static inline int
> -HYPERVISOR_multicall(void *call_list, int nr_calls)
> +HYPERVISOR_multicall(void *call_list, uint32_t nr_calls)
> {
> return _hypercall2(int, multicall, call_list, nr_calls);
> }
> diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h
> index fd9cb76..3400dba 100644
> --- a/arch/x86/include/asm/xen/interface.h
> +++ b/arch/x86/include/asm/xen/interface.h
> @@ -54,6 +54,9 @@ typedef unsigned long xen_pfn_t;
> #define PRI_xen_pfn "lx"
> typedef unsigned long xen_ulong_t;
> #define PRI_xen_ulong "lx"
> +typedef long xen_long_t;
> +#define PRI_xen_long "lx"
> +
> /* Guest handles for primitive C types. */
> __DEFINE_GUEST_HANDLE(uchar, unsigned char);
> __DEFINE_GUEST_HANDLE(uint, unsigned int);
> diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
> index 0cd5ca3..de08213 100644
> --- a/include/xen/interface/xen.h
> +++ b/include/xen/interface/xen.h
> @@ -275,9 +275,9 @@ DEFINE_GUEST_HANDLE_STRUCT(mmu_update);
> * NB. The fields are natural register size for this architecture.
> */
> struct multicall_entry {
> - unsigned long op;
> - long result;
> - unsigned long args[6];
> + xen_ulong_t op;
> + xen_long_t result;
> + xen_ulong_t args[6];
> };
> DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-04-24 12:03 ` Ian Campbell
@ 2014-04-24 12:29 ` David Vrabel
2014-04-24 14:02 ` Ian Campbell
2014-04-25 17:17 ` Stefano Stabellini
1 sibling, 1 reply; 14+ messages in thread
From: David Vrabel @ 2014-04-24 12:29 UTC (permalink / raw)
To: Ian Campbell
Cc: stefano.stabellini, julien.grall, tim, xen-devel, David Vrabel,
Boris Ostrovsky
On 24/04/14 13:03, Ian Campbell wrote:
> On Thu, 2014-04-17 at 13:57 +0100, Ian Campbell wrote:
>
> Ping? (FYI the Xen side has just been committed)
I would have expected Stefano to ack or apply this but I've applied it
to devel/for-linus-3.16.
Thanks.
David
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-04-24 12:29 ` David Vrabel
@ 2014-04-24 14:02 ` Ian Campbell
0 siblings, 0 replies; 14+ messages in thread
From: Ian Campbell @ 2014-04-24 14:02 UTC (permalink / raw)
To: David Vrabel
Cc: Boris Ostrovsky, julien.grall, tim, stefano.stabellini, xen-devel
On Thu, 2014-04-24 at 13:29 +0100, David Vrabel wrote:
> On 24/04/14 13:03, Ian Campbell wrote:
> > On Thu, 2014-04-17 at 13:57 +0100, Ian Campbell wrote:
> >
> > Ping? (FYI the Xen side has just been committed)
>
> I would have expected Stefano to ack or apply this but I've applied it
> to devel/for-linus-3.16.
Super, thanks!
Ian.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-04-24 12:03 ` Ian Campbell
2014-04-24 12:29 ` David Vrabel
@ 2014-04-25 17:17 ` Stefano Stabellini
2014-04-28 9:27 ` Ian Campbell
1 sibling, 1 reply; 14+ messages in thread
From: Stefano Stabellini @ 2014-04-25 17:17 UTC (permalink / raw)
To: Ian Campbell
Cc: julien.grall, stefano.stabellini, tim, xen-devel, David Vrabel,
Boris Ostrovsky
On Thu, 24 Apr 2014, Ian Campbell wrote:
> On Thu, 2014-04-17 at 13:57 +0100, Ian Campbell wrote:
>
> Ping? (FYI the Xen side has just been committed)
Sorry for the delay
> > 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>
> > Cc: David Vrabel <david.vrabel@citrix.com>
> > ---
> > v3: - Add for arm64 too
> > v2: - Typo in commit message.
> > - Update x86 prototype for HYPERCALL_multicall for consistency (nr_calls
> > is a uint32_t).
> >
> > Tested on ARM and arm64 with a stupid patch:
> > diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> > index b96723e..8b1dc7a 100644
> > --- a/arch/arm/xen/enlighten.c
> > +++ b/arch/arm/xen/enlighten.c
> > @@ -339,6 +339,63 @@ static int __init xen_pm_init(void)
> > }
> > late_initcall(xen_pm_init);
> >
> > +static int __init multicall_test(void)
> > +{
> > + struct multicall_entry templ[3];
> > + struct multicall_entry call[3];
> > + const char *str0 = "This is the first debug string\n";
> > + const char *str1 = "This is the second debug string\n";
> > + const char *str2 = "This is the third debug string\n";
> > + int ret;
> > +
> > + templ[0] = (struct multicall_entry) {
> > + .op = __HYPERVISOR_console_io,
> > + .args[0] = CONSOLEIO_write,
> > + .args[1] = strlen(str0),
> > + .args[2] = (uintptr_t)str0
> > + };
> > + templ[1] = (struct multicall_entry) {
> > + .op = __HYPERVISOR_console_io,
> > + .args[0] = CONSOLEIO_write,
> > + .args[1] = strlen(str1),
> > + .args[2] = (uintptr_t)str1
> > + };
> > + templ[2] = (struct multicall_entry) {
> > + .op = __HYPERVISOR_console_io,
> > + .args[0] = CONSOLEIO_write,
> > + .args[1] = strlen(str2),
> > + .args[2] = (uintptr_t)str2
> > + };
> > +
> > + memcpy(call, templ, sizeof(templ));
> > +
> > + ret = HYPERVISOR_multicall(call, ARRAY_SIZE(call));
> > + printk("1st MULTICALL returned %d\n", ret);
> > + if (ret == 0) {
> > + printk("call[0].result = %"PRI_xen_long"\n", call[0].result);
> > + printk("call[1].result = %"PRI_xen_long"\n", call[1].result);
> > + printk("call[2].result = %"PRI_xen_long"\n", call[2].result);
> > + }
> > +
> > + memcpy(call, templ, sizeof(templ));
> > + call[1].args[0] |= 0xf000000000000000ULL;
> > +
> > + /*
> > + * On arm: should die after printing first string, shouldn't print third
> > + * On arm64: should print all three.
> > + */
> > + ret = HYPERVISOR_multicall(call, ARRAY_SIZE(call));
> > + printk("2nd MULTICALL returned %d\n", ret);
> > + if (ret == 0) {
> > + printk("call[0].result = %"PRI_xen_long"\n", call[0].result);
> > + printk("call[1].result = %"PRI_xen_long"\n", call[1].result);
> > + printk("call[2].result = %"PRI_xen_long"\n", call[2].result);
> > + }
> > +
> > + return 0;
> > +}
> > +late_initcall(multicall_test);
> > +
> > /* In the hypervisor.S file. */
> > EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op);
> > EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op);
> > ---
> > arch/arm/include/asm/xen/hypercall.h | 6 +-----
> > arch/arm/include/asm/xen/interface.h | 2 ++
> > arch/arm/xen/hypercall.S | 1 +
> > arch/arm64/xen/hypercall.S | 1 +
> > arch/x86/include/asm/xen/hypercall.h | 2 +-
> > arch/x86/include/asm/xen/interface.h | 3 +++
> > include/xen/interface/xen.h | 6 +++---
> > 7 files changed, 12 insertions(+), 9 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/xen/hypercall.h b/arch/arm/include/asm/xen/hypercall.h
> > index 7704e28..7658150 100644
> > --- a/arch/arm/include/asm/xen/hypercall.h
> > +++ b/arch/arm/include/asm/xen/hypercall.h
> > @@ -48,6 +48,7 @@ int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
> > int HYPERVISOR_physdev_op(int cmd, void *arg);
> > int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
> > int HYPERVISOR_tmem_op(void *arg);
> > +int HYPERVISOR_multicall(struct multicall_entry *calls, uint32_t nr);
> >
> > static inline void
> > MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
> > @@ -63,9 +64,4 @@ MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
> > BUG();
> > }
> >
> > -static inline int
> > -HYPERVISOR_multicall(void *call_list, int nr_calls)
> > -{
> > - BUG();
> > -}
> > #endif /* _ASM_ARM_XEN_HYPERCALL_H */
> > diff --git a/arch/arm/include/asm/xen/interface.h b/arch/arm/include/asm/xen/interface.h
> > index 1151188..5006600 100644
> > --- a/arch/arm/include/asm/xen/interface.h
> > +++ b/arch/arm/include/asm/xen/interface.h
> > @@ -40,6 +40,8 @@ typedef uint64_t xen_pfn_t;
> > #define PRI_xen_pfn "llx"
> > typedef uint64_t xen_ulong_t;
> > #define PRI_xen_ulong "llx"
> > +typedef int64_t xen_long_t;
> > +#define PRI_xen_long "llx"
> > /* Guest handles for primitive C types. */
> > __DEFINE_GUEST_HANDLE(uchar, unsigned char);
> > __DEFINE_GUEST_HANDLE(uint, unsigned int);
> > diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S
> > index d1cf7b7..44e3a5f 100644
> > --- a/arch/arm/xen/hypercall.S
> > +++ b/arch/arm/xen/hypercall.S
> > @@ -89,6 +89,7 @@ HYPERCALL2(memory_op);
> > HYPERCALL2(physdev_op);
> > HYPERCALL3(vcpu_op);
> > HYPERCALL1(tmem_op);
> > +HYPERCALL2(multicall);
> >
> > ENTRY(privcmd_call)
> > stmdb sp!, {r4}
> > diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
> > index 531342e..8bbe940 100644
> > --- a/arch/arm64/xen/hypercall.S
> > +++ b/arch/arm64/xen/hypercall.S
> > @@ -80,6 +80,7 @@ HYPERCALL2(memory_op);
> > HYPERCALL2(physdev_op);
> > HYPERCALL3(vcpu_op);
> > HYPERCALL1(tmem_op);
> > +HYPERCALL2(multicall);
> >
> > ENTRY(privcmd_call)
> > mov x16, x0
You need to add an EXPORT_SYMBOL_GPL for it in arch/arm/xen/enlighten.c.
The rest is OK.
David, if you don't mind, I would rather have one updated patch in the
tree rather than two. Could you back out the current version from
devel/for-linus-3.16?
> > diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
> > index e709884..ca08a27 100644
> > --- a/arch/x86/include/asm/xen/hypercall.h
> > +++ b/arch/x86/include/asm/xen/hypercall.h
> > @@ -343,7 +343,7 @@ HYPERVISOR_memory_op(unsigned int cmd, void *arg)
> > }
> >
> > static inline int
> > -HYPERVISOR_multicall(void *call_list, int nr_calls)
> > +HYPERVISOR_multicall(void *call_list, uint32_t nr_calls)
> > {
> > return _hypercall2(int, multicall, call_list, nr_calls);
> > }
> > diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h
> > index fd9cb76..3400dba 100644
> > --- a/arch/x86/include/asm/xen/interface.h
> > +++ b/arch/x86/include/asm/xen/interface.h
> > @@ -54,6 +54,9 @@ typedef unsigned long xen_pfn_t;
> > #define PRI_xen_pfn "lx"
> > typedef unsigned long xen_ulong_t;
> > #define PRI_xen_ulong "lx"
> > +typedef long xen_long_t;
> > +#define PRI_xen_long "lx"
> > +
> > /* Guest handles for primitive C types. */
> > __DEFINE_GUEST_HANDLE(uchar, unsigned char);
> > __DEFINE_GUEST_HANDLE(uint, unsigned int);
> > diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
> > index 0cd5ca3..de08213 100644
> > --- a/include/xen/interface/xen.h
> > +++ b/include/xen/interface/xen.h
> > @@ -275,9 +275,9 @@ DEFINE_GUEST_HANDLE_STRUCT(mmu_update);
> > * NB. The fields are natural register size for this architecture.
> > */
> > struct multicall_entry {
> > - unsigned long op;
> > - long result;
> > - unsigned long args[6];
> > + xen_ulong_t op;
> > + xen_long_t result;
> > + xen_ulong_t args[6];
> > };
> > DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
> >
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-04-25 17:17 ` Stefano Stabellini
@ 2014-04-28 9:27 ` Ian Campbell
2014-05-09 14:56 ` Stefano Stabellini
0 siblings, 1 reply; 14+ messages in thread
From: Ian Campbell @ 2014-04-28 9:27 UTC (permalink / raw)
To: Stefano Stabellini
Cc: julien.grall, tim, xen-devel, David Vrabel, Boris Ostrovsky
On Fri, 2014-04-25 at 18:17 +0100, Stefano Stabellini wrote:
> > > diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
> > > index 531342e..8bbe940 100644
> > > --- a/arch/arm64/xen/hypercall.S
> > > +++ b/arch/arm64/xen/hypercall.S
> > > @@ -80,6 +80,7 @@ HYPERCALL2(memory_op);
> > > HYPERCALL2(physdev_op);
> > > HYPERCALL3(vcpu_op);
> > > HYPERCALL1(tmem_op);
> > > +HYPERCALL2(multicall);
> > >
> > > ENTRY(privcmd_call)
> > > mov x16, x0
>
> You need to add an EXPORT_SYMBOL_GPL for it in arch/arm/xen/enlighten.c.
HYPERVISOR_multicall is not currently exported for x86 either. I think
we should go with this existing patch and sort out the exports
consistently across arch/* in a followup.
Ian.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-04-28 9:27 ` Ian Campbell
@ 2014-05-09 14:56 ` Stefano Stabellini
2014-05-09 15:07 ` Ian Campbell
0 siblings, 1 reply; 14+ messages in thread
From: Stefano Stabellini @ 2014-05-09 14:56 UTC (permalink / raw)
To: Ian Campbell
Cc: julien.grall, tim, xen-devel, David Vrabel, Boris Ostrovsky,
Stefano Stabellini
On Mon, 28 Apr 2014, Ian Campbell wrote:
> On Fri, 2014-04-25 at 18:17 +0100, Stefano Stabellini wrote:
> > > > diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
> > > > index 531342e..8bbe940 100644
> > > > --- a/arch/arm64/xen/hypercall.S
> > > > +++ b/arch/arm64/xen/hypercall.S
> > > > @@ -80,6 +80,7 @@ HYPERCALL2(memory_op);
> > > > HYPERCALL2(physdev_op);
> > > > HYPERCALL3(vcpu_op);
> > > > HYPERCALL1(tmem_op);
> > > > +HYPERCALL2(multicall);
> > > >
> > > > ENTRY(privcmd_call)
> > > > mov x16, x0
> >
> > You need to add an EXPORT_SYMBOL_GPL for it in arch/arm/xen/enlighten.c.
>
> HYPERVISOR_multicall is not currently exported for x86 either. I think
> we should go with this existing patch and sort out the exports
> consistently across arch/* in a followup.
HYPERVISOR_multicall doesn't need to be exported on x86 because it is
defined as a static inline function.
HYPERVISOR_multicall would need to be exported on ARM because has an
entry point in assembly.
Otherwise you can avoid exporting the symbol if you are completely sure
that the hypercall cannot and should not be made by a module but in that
case you should at the very least add a comment.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-05-09 14:56 ` Stefano Stabellini
@ 2014-05-09 15:07 ` Ian Campbell
2014-05-09 16:13 ` Stefano Stabellini
0 siblings, 1 reply; 14+ messages in thread
From: Ian Campbell @ 2014-05-09 15:07 UTC (permalink / raw)
To: Stefano Stabellini
Cc: julien.grall, tim, xen-devel, David Vrabel, Boris Ostrovsky
On Fri, 2014-05-09 at 15:56 +0100, Stefano Stabellini wrote:
> On Mon, 28 Apr 2014, Ian Campbell wrote:
> > On Fri, 2014-04-25 at 18:17 +0100, Stefano Stabellini wrote:
> > > > > diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
> > > > > index 531342e..8bbe940 100644
> > > > > --- a/arch/arm64/xen/hypercall.S
> > > > > +++ b/arch/arm64/xen/hypercall.S
> > > > > @@ -80,6 +80,7 @@ HYPERCALL2(memory_op);
> > > > > HYPERCALL2(physdev_op);
> > > > > HYPERCALL3(vcpu_op);
> > > > > HYPERCALL1(tmem_op);
> > > > > +HYPERCALL2(multicall);
> > > > >
> > > > > ENTRY(privcmd_call)
> > > > > mov x16, x0
> > >
> > > You need to add an EXPORT_SYMBOL_GPL for it in arch/arm/xen/enlighten.c.
> >
> > HYPERVISOR_multicall is not currently exported for x86 either. I think
> > we should go with this existing patch and sort out the exports
> > consistently across arch/* in a followup.
>
> HYPERVISOR_multicall doesn't need to be exported on x86 because it is
> defined as a static inline function.
Oh, of course.
Here is the fix. Feel free to fold this into the existing commit if you
prefer.
8<-------------------------
>From 40542140ca071039b2c448e53d7536a3b3134028 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Fri, 9 May 2014 16:06:21 +0100
Subject: [PATCH] arm: xen: export HYPERVISOR_multicall to modules.
"arm: xen: implement multicall hypercall support." forgot to do this.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
arch/arm/xen/enlighten.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index b96723e..488ecdb 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -350,4 +350,5 @@ EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
EXPORT_SYMBOL_GPL(HYPERVISOR_vcpu_op);
EXPORT_SYMBOL_GPL(HYPERVISOR_tmem_op);
+EXPORT_SYMBOL_GPL(HYPERVISOR_multicall);
EXPORT_SYMBOL_GPL(privcmd_call);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-05-09 15:07 ` Ian Campbell
@ 2014-05-09 16:13 ` Stefano Stabellini
2014-05-09 16:16 ` Ian Campbell
0 siblings, 1 reply; 14+ messages in thread
From: Stefano Stabellini @ 2014-05-09 16:13 UTC (permalink / raw)
To: Ian Campbell
Cc: julien.grall, tim, xen-devel, David Vrabel, Boris Ostrovsky,
Stefano Stabellini
On Fri, 9 May 2014, Ian Campbell wrote:
> On Fri, 2014-05-09 at 15:56 +0100, Stefano Stabellini wrote:
> > On Mon, 28 Apr 2014, Ian Campbell wrote:
> > > On Fri, 2014-04-25 at 18:17 +0100, Stefano Stabellini wrote:
> > > > > > diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
> > > > > > index 531342e..8bbe940 100644
> > > > > > --- a/arch/arm64/xen/hypercall.S
> > > > > > +++ b/arch/arm64/xen/hypercall.S
> > > > > > @@ -80,6 +80,7 @@ HYPERCALL2(memory_op);
> > > > > > HYPERCALL2(physdev_op);
> > > > > > HYPERCALL3(vcpu_op);
> > > > > > HYPERCALL1(tmem_op);
> > > > > > +HYPERCALL2(multicall);
> > > > > >
> > > > > > ENTRY(privcmd_call)
> > > > > > mov x16, x0
> > > >
> > > > You need to add an EXPORT_SYMBOL_GPL for it in arch/arm/xen/enlighten.c.
> > >
> > > HYPERVISOR_multicall is not currently exported for x86 either. I think
> > > we should go with this existing patch and sort out the exports
> > > consistently across arch/* in a followup.
> >
> > HYPERVISOR_multicall doesn't need to be exported on x86 because it is
> > defined as a static inline function.
>
> Oh, of course.
>
> Here is the fix. Feel free to fold this into the existing commit if you
> prefer.
>
> 8<-------------------------
>
> >From 40542140ca071039b2c448e53d7536a3b3134028 Mon Sep 17 00:00:00 2001
> From: Ian Campbell <ian.campbell@citrix.com>
> Date: Fri, 9 May 2014 16:06:21 +0100
> Subject: [PATCH] arm: xen: export HYPERVISOR_multicall to modules.
>
> "arm: xen: implement multicall hypercall support." forgot to do this.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
added to devel/for-linus-3.16
> arch/arm/xen/enlighten.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index b96723e..488ecdb 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -350,4 +350,5 @@ EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
> EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
> EXPORT_SYMBOL_GPL(HYPERVISOR_vcpu_op);
> EXPORT_SYMBOL_GPL(HYPERVISOR_tmem_op);
> +EXPORT_SYMBOL_GPL(HYPERVISOR_multicall);
> EXPORT_SYMBOL_GPL(privcmd_call);
> --
> 1.7.10.4
>
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH linux v3] arm: xen: implement multicall hypercall support.
2014-05-09 16:13 ` Stefano Stabellini
@ 2014-05-09 16:16 ` Ian Campbell
0 siblings, 0 replies; 14+ messages in thread
From: Ian Campbell @ 2014-05-09 16:16 UTC (permalink / raw)
To: Stefano Stabellini
Cc: julien.grall, tim, xen-devel, David Vrabel, Boris Ostrovsky
On Fri, 2014-05-09 at 17:13 +0100, Stefano Stabellini wrote:
> On Fri, 9 May 2014, Ian Campbell wrote:
> > On Fri, 2014-05-09 at 15:56 +0100, Stefano Stabellini wrote:
> > > On Mon, 28 Apr 2014, Ian Campbell wrote:
> > > > On Fri, 2014-04-25 at 18:17 +0100, Stefano Stabellini wrote:
> > > > > > > diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
> > > > > > > index 531342e..8bbe940 100644
> > > > > > > --- a/arch/arm64/xen/hypercall.S
> > > > > > > +++ b/arch/arm64/xen/hypercall.S
> > > > > > > @@ -80,6 +80,7 @@ HYPERCALL2(memory_op);
> > > > > > > HYPERCALL2(physdev_op);
> > > > > > > HYPERCALL3(vcpu_op);
> > > > > > > HYPERCALL1(tmem_op);
> > > > > > > +HYPERCALL2(multicall);
> > > > > > >
> > > > > > > ENTRY(privcmd_call)
> > > > > > > mov x16, x0
> > > > >
> > > > > You need to add an EXPORT_SYMBOL_GPL for it in arch/arm/xen/enlighten.c.
> > > >
> > > > HYPERVISOR_multicall is not currently exported for x86 either. I think
> > > > we should go with this existing patch and sort out the exports
> > > > consistently across arch/* in a followup.
> > >
> > > HYPERVISOR_multicall doesn't need to be exported on x86 because it is
> > > defined as a static inline function.
> >
> > Oh, of course.
> >
> > Here is the fix. Feel free to fold this into the existing commit if you
> > prefer.
> >
> > 8<-------------------------
> >
> > >From 40542140ca071039b2c448e53d7536a3b3134028 Mon Sep 17 00:00:00 2001
> > From: Ian Campbell <ian.campbell@citrix.com>
> > Date: Fri, 9 May 2014 16:06:21 +0100
> > Subject: [PATCH] arm: xen: export HYPERVISOR_multicall to modules.
> >
> > "arm: xen: implement multicall hypercall support." forgot to do this.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>
> added to devel/for-linus-3.16
thanks.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-05-09 16:16 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-17 12:57 [PATCH xen v3] xen: arm: fully implement multicall interface Ian Campbell
2014-04-17 12:57 ` [PATCH linux v3] arm: xen: implement multicall hypercall support Ian Campbell
2014-04-24 12:03 ` Ian Campbell
2014-04-24 12:29 ` David Vrabel
2014-04-24 14:02 ` Ian Campbell
2014-04-25 17:17 ` Stefano Stabellini
2014-04-28 9:27 ` Ian Campbell
2014-05-09 14:56 ` Stefano Stabellini
2014-05-09 15:07 ` Ian Campbell
2014-05-09 16:13 ` Stefano Stabellini
2014-05-09 16:16 ` Ian Campbell
2014-04-17 14:00 ` [PATCH xen v3] xen: arm: fully implement multicall interface Julien Grall
2014-04-17 14:13 ` Ian Campbell
2014-04-17 14:24 ` Julien Grall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).