1 Star 0 Fork 38

xisme/qemu-kvm_src-anolis

forked from src-anolis-os/qemu-kvm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
1099-kvm-allow-target-specific-accelerator-properties.patch 4.11 KB
一键复制 编辑 原始数据 按行查看 历史
From 96243c578cb34d94acf2c481cc254d3b616219d1 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Thu, 29 Sep 2022 15:20:12 +0800
Subject: [PATCH 1099/1119] kvm: allow target-specific accelerator properties
commit 3dba0a335cf5c53146b606be6ddfab4df81c464e upstream.
Several hypervisor capabilities in KVM are target-specific. When exposed
to QEMU users as accelerator properties (i.e. -accel kvm,prop=value), they
should not be available for all targets.
Add a hook for targets to add their own properties to -accel kvm, for
now no such property is defined.
Intel-SIG: commit 3dba0a335cf5 ("kvm: allow target-specific accelerator properties").
Backport notify-vm-exit for qemu v6.2.0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220929072014.20705-3-chenyi.qiang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[ jason: remove changes in target/riscv/kvm.c since riscv kvm is not
supported in qemu-6.2.0, meanwhile add loongarch64 support ]
Signed-off-by: Jason Zeng <jason.zeng@intel.com>
---
accel/kvm/kvm-all.c | 2 ++
include/sysemu/kvm.h | 2 ++
target/arm/kvm.c | 4 ++++
target/i386/kvm/kvm.c | 4 ++++
target/loongarch64/kvm.c | 4 ++++
target/mips/kvm.c | 4 ++++
target/ppc/kvm.c | 4 ++++
target/s390x/kvm/kvm.c | 4 ++++
8 files changed, 28 insertions(+)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 10af4170d938..573b2ba38269 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -3759,6 +3759,8 @@ static void kvm_accel_class_init(ObjectClass *oc, void *data)
NULL, NULL);
object_class_property_set_description(oc, "dirty-ring-size",
"Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)");
+
+ kvm_arch_accel_class_init(oc);
}
static const TypeInfo kvm_accel_type = {
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 9f8099f48769..4bcec46a4402 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -334,6 +334,8 @@ bool kvm_device_supported(int vmfd, uint64_t type);
extern const KVMCapabilityInfo kvm_arch_required_capabilities[];
+void kvm_arch_accel_class_init(ObjectClass *oc);
+
void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run);
MemTxAttrs kvm_arch_post_run(CPUState *cpu, struct kvm_run *run);
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 1ae4e510558f..7bec3e5f4ff8 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -1059,3 +1059,7 @@ bool kvm_arch_cpu_check_are_resettable(void)
{
return true;
}
+
+void kvm_arch_accel_class_init(ObjectClass *oc)
+{
+}
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 07c5f7dc932d..6f5c1a804b4c 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -5424,3 +5424,7 @@ void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask)
mask &= ~BIT_ULL(bit);
}
}
+
+void kvm_arch_accel_class_init(ObjectClass *oc)
+{
+}
diff --git a/target/loongarch64/kvm.c b/target/loongarch64/kvm.c
index 0eaabe39436c..8d2f84995e2a 100644
--- a/target/loongarch64/kvm.c
+++ b/target/loongarch64/kvm.c
@@ -1417,3 +1417,7 @@ int kvm_arch_msi_data_to_gsi(uint32_t data)
{
abort();
}
+
+void kvm_arch_accel_class_init(ObjectClass *oc)
+{
+}
diff --git a/target/mips/kvm.c b/target/mips/kvm.c
index 086debd9f013..f80ac72dd185 100644
--- a/target/mips/kvm.c
+++ b/target/mips/kvm.c
@@ -1295,3 +1295,7 @@ bool kvm_arch_cpu_check_are_resettable(void)
{
return true;
}
+
+void kvm_arch_accel_class_init(ObjectClass *oc)
+{
+}
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 154888cce509..6e15b1f2333e 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -2986,3 +2986,7 @@ void kvmppc_svm_allow(Error **errp)
error_setg(errp, "Error enabling x-svm-allowed, try x-svm-allowed=off");
}
}
+
+void kvm_arch_accel_class_init(ObjectClass *oc)
+{
+}
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index 6d1a6324b9e2..dbb911c83251 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -2677,3 +2677,7 @@ int kvm_s390_get_zpci_op(void)
{
return cap_zpci_op;
}
+
+void kvm_arch_accel_class_init(ObjectClass *oc)
+{
+}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xisme/qemu-kvm_src-anolis.git
git@gitee.com:xisme/qemu-kvm_src-anolis.git
xisme
qemu-kvm_src-anolis
qemu-kvm_src-anolis
vtkm_support_csv

搜索帮助

371d5123 14472233 46e8bd33 14472233