From: Jan Kiszka <[email protected]> Implement arch_send_event directly and switch psci to this. Makes things more straightforward - and provides the chance to properly document arch_send_event.
Signed-off-by: Jan Kiszka <[email protected]> --- hypervisor/arch/arm-common/control.c | 3 ++- hypervisor/arch/arm-common/include/asm/control.h | 6 ------ hypervisor/arch/arm-common/psci.c | 2 +- hypervisor/arch/x86/include/asm/control.h | 2 -- hypervisor/include/jailhouse/control.h | 10 ++++++++++ 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/hypervisor/arch/arm-common/control.c b/hypervisor/arch/arm-common/control.c index 10885f9d..2a42c34f 100644 --- a/hypervisor/arch/arm-common/control.c +++ b/hypervisor/arch/arm-common/control.c @@ -36,8 +36,9 @@ void arm_cpu_park(void) arm_paging_vcpu_init(&parking_pt); } -void arm_cpu_kick(unsigned int cpu_id) +void arch_send_event(struct public_per_cpu *target_data) { + unsigned int cpu_id = target_data->cpu_id; struct sgi sgi; sgi.targets = irqchip_get_cpu_target(cpu_id); diff --git a/hypervisor/arch/arm-common/include/asm/control.h b/hypervisor/arch/arm-common/include/asm/control.h index a1771302..2f54e2b5 100644 --- a/hypervisor/arch/arm-common/include/asm/control.h +++ b/hypervisor/arch/arm-common/include/asm/control.h @@ -31,12 +31,6 @@ unsigned int arm_cpu_by_mpidr(struct cell *cell, unsigned long mpidr); void arm_cpu_reset(unsigned long pc); void arm_cpu_park(void); -void arm_cpu_kick(unsigned int cpu_id); - -static inline void arch_send_event(struct public_per_cpu *target_data) -{ - arm_cpu_kick(target_data->cpu_id); -} #endif /* !__ASSEMBLY__ */ diff --git a/hypervisor/arch/arm-common/psci.c b/hypervisor/arch/arm-common/psci.c index 13d89e15..65155710 100644 --- a/hypervisor/arch/arm-common/psci.c +++ b/hypervisor/arch/arm-common/psci.c @@ -49,7 +49,7 @@ static long psci_emulate_cpu_on(struct trap_context *ctx) spin_unlock(&target_data->control_lock); if (kick_cpu) - arm_cpu_kick(cpu); + arch_send_event(target_data); return result; } diff --git a/hypervisor/arch/x86/include/asm/control.h b/hypervisor/arch/x86/include/asm/control.h index 5ca015d0..2566e115 100644 --- a/hypervisor/arch/x86/include/asm/control.h +++ b/hypervisor/arch/x86/include/asm/control.h @@ -23,5 +23,3 @@ void x86_check_events(void); void __attribute__((noreturn)) x86_exception_handler(struct exception_frame *frame); - -void arch_send_event(struct public_per_cpu *target_data); diff --git a/hypervisor/include/jailhouse/control.h b/hypervisor/include/jailhouse/control.h index e50beed7..5476d590 100644 --- a/hypervisor/include/jailhouse/control.h +++ b/hypervisor/include/jailhouse/control.h @@ -173,6 +173,16 @@ void arch_reset_cpu(unsigned int cpu_id); */ void arch_park_cpu(unsigned int cpu_id); +/** + * Send internal event to remote CPU. + * @param cpu_id ID of the target CPU. + * + * When the state of the target CPU was updated and action is required on the + * remote side, this function can be called. Processing of the state change is + * architecture specific. + */ +void arch_send_event(struct public_per_cpu *target_data); + /** * Performs the architecture-specific steps for mapping a memory region into a * cell's address space. -- 2.16.4 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/f91c57158100fa0b4586a3271dc2c27570d56be7.1583516039.git.jan.kiszka%40siemens.com.
