mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/riscv: introduce vcpu_kick() implementation
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. Since vcpu_kick() calls perfc_incr(vcpu_kick), add perfcounter for vcpu_kick to handle the case when CONFIG_PERF_COUNTERS=y. Although CONFIG_PERF_COUNTERS is not enabled by default, it can be enabled, for example, by randconfig what will lead to CI build issues. Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
2473ddf9b4
commit
d81a91b0e4
4 files changed
+17
-6
No files matched your search
@@ -1,9 +1,11 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
|
#include <xen/cpumask.h>
|
||||||
#include <xen/init.h>
|
#include <xen/init.h>
|
||||||
#include <xen/mm.h>
|
#include <xen/mm.h>
|
||||||
#include <xen/sections.h>
|
#include <xen/sections.h>
|
||||||
#include <xen/sched.h>
|
#include <xen/sched.h>
|
||||||
|
#include <xen/smp.h>
|
||||||
#include <xen/vmap.h>
|
#include <xen/vmap.h>
|
||||||
|
|
||||||
#include <asm/bitops.h>
|
#include <asm/bitops.h>
|
||||||
@@ -264,6 +266,18 @@ void vcpu_flush_interrupts(struct vcpu *curr)
|
|||||||
#endif
|
#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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void __init __maybe_unused build_assertions(void)
|
static void __init __maybe_unused build_assertions(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ generic-y += hypercall.h
|
|||||||
generic-y += iocap.h
|
generic-y += iocap.h
|
||||||
generic-y += irq-dt.h
|
generic-y += irq-dt.h
|
||||||
generic-y += percpu.h
|
generic-y += percpu.h
|
||||||
generic-y += perfc_defn.h
|
|
||||||
generic-y += random.h
|
generic-y += random.h
|
||||||
generic-y += softirq.h
|
generic-y += softirq.h
|
||||||
generic-y += vm_event.h
|
generic-y += vm_event.h
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
/* This file is intended to be included multiple times. */
|
||||||
|
|
||||||
|
PERFCOUNTER(vcpu_kick, "vcpu: notify other vcpu")
|
||||||
@@ -203,11 +203,6 @@ void vcpu_block_unless_event_pending(struct vcpu *v)
|
|||||||
BUG_ON("unimplemented");
|
BUG_ON("unimplemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
void vcpu_kick(struct vcpu *v)
|
|
||||||
{
|
|
||||||
BUG_ON("unimplemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long
|
unsigned long
|
||||||
hypercall_create_continuation(unsigned int op, const char *format, ...)
|
hypercall_create_continuation(unsigned int op, const char *format, ...)
|
||||||
{
|
{
|
||||||
|
|||||||