130 lines
3.8 KiB
Diff
130 lines
3.8 KiB
Diff
|
|
From f90dc9f811195fabd68faf2ca98b2fe5b4fbe3d0 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Paolo Bonzini <pbonzini@redhat.com>
|
||
|
|
Date: Thu, 29 Sep 2022 15:20:12 +0800
|
||
|
|
Subject: [PATCH] kvm: allow target-specific accelerator properties
|
||
|
|
|
||
|
|
from mainline-v7.2.0-rc0
|
||
|
|
commit 3dba0a335cf5c53146b606be6ddfab4df81c464e
|
||
|
|
category: feature
|
||
|
|
feature: Notify VM Exit
|
||
|
|
bugzilla: https://gitee.com/openeuler/intel-qemu/issues/I6GWQE
|
||
|
|
|
||
|
|
Intel-SIG: commit 3dba0a335cf5 ("kvm: allow target-specific accelerator properties")
|
||
|
|
|
||
|
|
------------------------------------------------------------------
|
||
|
|
|
||
|
|
kvm: allow target-specific accelerator properties
|
||
|
|
|
||
|
|
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.
|
||
|
|
|
||
|
|
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>
|
||
|
|
[ remove changes in target/riscv/kvm.c since riscv kvm is not
|
||
|
|
supported in qemu-6.2.0 and linux 5.10 ]
|
||
|
|
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/mips/kvm.c | 4 ++++
|
||
|
|
target/ppc/kvm.c | 4 ++++
|
||
|
|
target/s390x/kvm/kvm.c | 4 ++++
|
||
|
|
7 files changed, 24 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
|
||
|
|
index 946ccb260b..e5681a6cd0 100644
|
||
|
|
--- a/accel/kvm/kvm-all.c
|
||
|
|
+++ b/accel/kvm/kvm-all.c
|
||
|
|
@@ -3703,6 +3703,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 19c5c8402a..1ec9432493 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 29ac3f40e0..22ac5bcb97 100644
|
||
|
|
--- a/target/arm/kvm.c
|
||
|
|
+++ b/target/arm/kvm.c
|
||
|
|
@@ -1095,3 +1095,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 e97d967c73..e2f28ce958 100644
|
||
|
|
--- a/target/i386/kvm/kvm.c
|
||
|
|
+++ b/target/i386/kvm/kvm.c
|
||
|
|
@@ -5168,3 +5168,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/mips/kvm.c b/target/mips/kvm.c
|
||
|
|
index 086debd9f0..f80ac72dd1 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 d73563045b..9693aab3c7 100644
|
||
|
|
--- a/target/ppc/kvm.c
|
||
|
|
+++ b/target/ppc/kvm.c
|
||
|
|
@@ -2975,3 +2975,7 @@ bool kvm_arch_cpu_check_are_resettable(void)
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
+
|
||
|
|
+void kvm_arch_accel_class_init(ObjectClass *oc)
|
||
|
|
+{
|
||
|
|
+}
|
||
|
|
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
|
||
|
|
index 5b1fdb55c4..671d0f179c 100644
|
||
|
|
--- a/target/s390x/kvm/kvm.c
|
||
|
|
+++ b/target/s390x/kvm/kvm.c
|
||
|
|
@@ -2562,3 +2562,7 @@ bool kvm_arch_cpu_check_are_resettable(void)
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
+
|
||
|
|
+void kvm_arch_accel_class_init(ObjectClass *oc)
|
||
|
|
+{
|
||
|
|
+}
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|