xen/arm: implement smp_call_function
PATCH v2 1/1 xen/arm: implement smp_call_function
From: Julien Grall <[email protected]>
Move smp_call_function and on_selected_cpus to common code.
Signed-off-by Julien Grall <[email protected]>
Acked-by Ian Campbell <[email protected]>
Acked-by Keir Fraser <[email protected]>
---
Changes in V2:
- Add copyright header in xen/common/smp.c
xen/arch/arm/gic.c | 3 ++ xen/arch/arm/smp.c | 11 ++-- xen/arch/x86/smp.c | 88 ++------------------------------ xen/common/Makefile | 1 + xen/common/smp.c | 112 +++++++++++++++++++++++++++++++++++++++++ xen/include/asm-arm/gic.h | 1 + xen/include/asm-x86/hardirq.h | 1 + xen/include/xen/smp.h | 7 +++ 8 files changed, 134 insertions(+), 90 deletions(-) create mode 100644 xen/common/smp.c
xen/arch/arm/gic.c +3 -0
@@ -672,6 +672,9 @@ static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)case GIC_SGI_DUMP_STATE :dump_execstate (regs);break ; +case GIC_SGI_CALL_FUNCTION : +smp_call_function_interrupt (); +break ;default :panic ("Unhandled SGI %d on CPU%d\n" , sgi,smp_processor_id ());break ;
xen/arch/arm/smp.c +4 -7
@@ -11,17 +11,14 @@ void flush_tlb_mask(const cpumask_t *mask)flush_xen_data_tlb (); } -void smp_call_function ( -void (*func) (void *info), -void *info, -int wait) +void smp_send_event_check_mask (const cpumask_t *mask) { -printk ("%s not implmented\n" , __func__); +send_SGI_mask (mask,GIC_SGI_EVENT_CHECK ); } -void smp_send_event_check_mask (const cpumask_t *mask) +void smp_send_call_function_mask (const cpumask_t *mask) { -send_SGI_mask (mask,GIC_SGI_EVENT_CHECK ); +send_SGI_mask (mask,GIC_SGI_CALL_FUNCTION ); }/*
xen/arch/x86/smp.c +5 -83
108 lines not on this page · raw message
xen/common/Makefile +1 -0
@@ -26,6 +26,7 @@ obj-y += schedule.o obj-y += shutdown.o obj-y += softirq.o obj-y += sort.o +obj-y += smp.o obj-y += spinlock.o obj-y += stop_machine.o obj-y += string.o
xen/common/smp.c new file +112 -0
112 lines not on this page · raw message
xen/include/asm-arm/gic.h +1 -0
@@ -175,6 +175,7 @@ extern void gic_restore_state(struct vcpu *v);enum gic_sgi {GIC_SGI_EVENT_CHECK =0 ,GIC_SGI_DUMP_STATE =1 , +GIC_SGI_CALL_FUNCTION =2 , };extern void send_SGI_mask (const cpumask_t *cpumask,enum gic_sgi sgi);extern void send_SGI_one (unsigned int cpu,enum gic_sgi sgi);
xen/include/asm-x86/hardirq.h +1 -0
@@ -3,6 +3,7 @@#include <xen/config.h> #include <xen/cache.h> +#include <xen/types.h> typedef struct { unsigned int __softirq_pending;
xen/include/xen/smp.h +7 -0
@@ -58,6 +58,13 @@ static inline void on_each_cpu(on_selected_cpus (&cpu_online_map, func, info, wait); } +/* +* Call a function on the current CPU +*/ +void smp_call_function_interrupt (void ); + +void smp_send_call_function_mask (const cpumask_t *mask); +#define smp_processor_id () raw_smp_processor_id()int alloc_cpu_id (void );
Signature · 1 line
1.7.10.4
Quoted 10 lines · Julien Grall
From: Julien Grall <[email protected]>
Move
smp_call_functionandon_selected_cpusto common code.Signed-off-by Julien Grall <[email protected]>Acked-by Ian Campbell <[email protected]>Acked-by Keir Fraser <[email protected]>---
Changes in V2:
- Add copyright header inxen/common/smp.c
This is actually v3 I think. Regardless, this is the version I have applied.
Ian.