Add a new way to query a TLB flush request for a given vCPU using the new callback support.
Suggested-by: Jani Kokkonen <jani.kokko...@huawei.com> Suggested-by: Claudio Fontana <claudio.font...@huawei.com> Signed-off-by: Alvise Rigo <a.r...@virtualopensystems.com> --- cputlb.c | 6 ++++++ include/qom/cpu.h | 1 + 2 files changed, 7 insertions(+) diff --git a/cputlb.c b/cputlb.c index fa38714..9794e6b 100644 --- a/cputlb.c +++ b/cputlb.c @@ -85,6 +85,12 @@ static void tlb_flush_async_work(void *opaque) g_free(params); } +static void cpu_exit_tlb_flush_all_cb(CPUState *cpu, void *opaque) +{ + tlb_flush(cpu, 1); + cpu->pending_tlb_flush = 0; +} + void tlb_flush_all(int flush_global) { CPUState *cpu; diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 0ec020b..c5b93c9 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -326,6 +326,7 @@ struct CPUState { /* One-shot callbacks for stopping requests. */ struct CPUExitCBs exit_cbs; volatile int pending_rdv; + volatile int pending_tlb_flush; /* In order to avoid passing too many arguments to the MMIO helpers, * we store some rarely used information in the CPU context. -- 2.4.5