Add a RISC-V implementation of vcpu_kick(), which unblocks the target vCPU and sends an event check IPI if the vCPU was running on another processor. This mirrors the behavior of Arm and enables proper vCPU wakeup handling on RISC-V.
Remove the stub implementation from stubs.c, as it is now provided by arch/riscv/domain.c. Signed-off-by: Oleksii Kurochko <[email protected]> Acked-by: Jan Beulich <[email protected]> --- Changes in v2: - Add Acked-by: Jan Beulich <[email protected]>. --- xen/arch/riscv/domain.c | 14 ++++++++++++++ xen/arch/riscv/stubs.c | 5 ----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c index e38c0db62cac..13ac384c4b76 100644 --- a/xen/arch/riscv/domain.c +++ b/xen/arch/riscv/domain.c @@ -1,8 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include <xen/cpumask.h> #include <xen/init.h> #include <xen/mm.h> #include <xen/sched.h> +#include <xen/smp.h> #include <xen/vmap.h> #include <asm/bitops.h> @@ -240,3 +242,15 @@ void vcpu_sync_interrupts(struct vcpu *v) # error "Update vsieh" #endif } + +void vcpu_kick(struct vcpu *v) +{ + bool running = v->is_running; + + vcpu_unblock(v); + if ( running && v != current ) + { + perfc_incr(vcpu_kick); + smp_send_event_check_mask(cpumask_of(v->processor)); + } +} diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c index c5784a436574..1f0add97b361 100644 --- a/xen/arch/riscv/stubs.c +++ b/xen/arch/riscv/stubs.c @@ -208,11 +208,6 @@ void vcpu_block_unless_event_pending(struct vcpu *v) BUG_ON("unimplemented"); } -void vcpu_kick(struct vcpu *v) -{ - BUG_ON("unimplemented"); -} - unsigned long hypercall_create_continuation(unsigned int op, const char *format, ...) { -- 2.52.0
