[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/11] target/loongarch: Add post init function for kvm mode
From: |
Bibo Mao |
Subject: |
[PULL 04/11] target/loongarch: Add post init function for kvm mode |
Date: |
Tue, 25 Feb 2025 20:00:34 +0800 |
Some features such as LBT and PMU are implemented in kvm mode,
With paravirt features in future, post init function is added
for kvm mode, so that property for these features will be created
in kvm post init function.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
---
target/loongarch/cpu.c | 2 +-
target/loongarch/cpu.h | 8 ++++++++
target/loongarch/kvm/kvm.c | 4 ++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index f203fcc7d7..012fcfbfda 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -765,7 +765,7 @@ void loongarch_cpu_post_init(Object *obj)
loongarch_set_pmu);
object_property_set_description(obj, "pmu",
"Set off to performance monitor unit.");
-
+ kvm_loongarch_cpu_post_init(cpu);
} else {
cpu->lbt = ON_OFF_AUTO_OFF;
cpu->pmu = ON_OFF_AUTO_OFF;
diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
index f2a23b7a43..74dffcb552 100644
--- a/target/loongarch/cpu.h
+++ b/target/loongarch/cpu.h
@@ -491,4 +491,12 @@ static inline void cpu_get_tb_cpu_state(CPULoongArchState
*env, vaddr *pc,
void loongarch_cpu_post_init(Object *obj);
+#ifdef CONFIG_KVM
+void kvm_loongarch_cpu_post_init(LoongArchCPU *cpu);
+#else
+static inline void kvm_loongarch_cpu_post_init(LoongArchCPU *cpu)
+{
+}
+#endif
+
#endif /* LOONGARCH_CPU_H */
diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c
index 27df02fa3a..2d2fb1e261 100644
--- a/target/loongarch/kvm/kvm.c
+++ b/target/loongarch/kvm/kvm.c
@@ -1016,6 +1016,10 @@ int kvm_arch_init_vcpu(CPUState *cs)
return ret;
}
+void kvm_loongarch_cpu_post_init(LoongArchCPU *cpu)
+{
+}
+
int kvm_arch_destroy_vcpu(CPUState *cs)
{
return 0;
--
2.43.5
- [PULL 00/11] loongarch-to-apply queue, Bibo Mao, 2025/02/25
- [PULL 05/11] target/loongarch: Move kvm specified vCPU property to kvm directory, Bibo Mao, 2025/02/25
- [PULL 03/11] target/loongarch: Correct maximum physical address in KVM mode, Bibo Mao, 2025/02/25
- [PULL 06/11] target/loongarch: Add vCPU property for paravirt ipi feature, Bibo Mao, 2025/02/25
- [PULL 08/11] target/loongarch: Enable paravirt ipi feature, Bibo Mao, 2025/02/25
- [PULL 01/11] target/loongarch: fix vcpu reset command word issue, Bibo Mao, 2025/02/25
- [PULL 07/11] target/loongarch: Add paravirt ipi feature detection, Bibo Mao, 2025/02/25
- [PULL 04/11] target/loongarch: Add post init function for kvm mode,
Bibo Mao <=
- [PULL 09/11] target/loongarch: Add vCPU property for kvm steal time feature, Bibo Mao, 2025/02/25
- [PULL 11/11] target/loongarch: Enable virtual extioi feature, Bibo Mao, 2025/02/25
- [PULL 02/11] target/loongarch/gdbstub: Fix gdbstub incorrectly handling some registers, Bibo Mao, 2025/02/25
- [PULL 10/11] target/loongarch: Add kvm steal time feature detection, Bibo Mao, 2025/02/25