[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/25] target/s390x/kvm: Turn KVM_CAP_SYNC_REGS into a hard requir
From: |
Thomas Huth |
Subject: |
[PULL 23/25] target/s390x/kvm: Turn KVM_CAP_SYNC_REGS into a hard requirement |
Date: |
Wed, 18 Oct 2023 15:07:14 +0200 |
Since we already require at least kernel 3.15 in the s390x KVM code,
we can assume that the KVM_CAP_SYNC_REGS capability is always there.
Thus turn this into a hard requirement now.
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Message-ID: <20231011080538.796999-2-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/kvm/kvm.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index 2e43dc746f..068e9826e1 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -338,21 +338,29 @@ int kvm_arch_get_default_type(MachineState *ms)
int kvm_arch_init(MachineState *ms, KVMState *s)
{
+ int required_caps[] = {
+ KVM_CAP_DEVICE_CTRL,
+ KVM_CAP_SYNC_REGS,
+ };
+
+ for (int i = 0; i < ARRAY_SIZE(required_caps); i++) {
+ if (!kvm_check_extension(s, required_caps[i])) {
+ error_report("KVM is missing capability #%d - "
+ "please use kernel 3.15 or newer", required_caps[i]);
+ return -1;
+ }
+ }
+
object_class_foreach(ccw_machine_class_foreach, TYPE_S390_CCW_MACHINE,
false, NULL);
- if (!kvm_check_extension(kvm_state, KVM_CAP_DEVICE_CTRL)) {
- error_report("KVM is missing capability KVM_CAP_DEVICE_CTRL - "
- "please use kernel 3.15 or newer");
- return -1;
- }
if (!kvm_check_extension(s, KVM_CAP_S390_COW)) {
error_report("KVM is missing capability KVM_CAP_S390_COW - "
"unsupported environment");
return -1;
}
- cap_sync_regs = kvm_check_extension(s, KVM_CAP_SYNC_REGS);
+ cap_sync_regs = true;
cap_async_pf = kvm_check_extension(s, KVM_CAP_ASYNC_PF);
cap_mem_op = kvm_check_extension(s, KVM_CAP_S390_MEM_OP);
cap_mem_op_extension = kvm_check_extension(s,
KVM_CAP_S390_MEM_OP_EXTENSION);
--
2.41.0
- [PULL 17/25] tests/avocado: s390x cpu topology entitlement tests, (continued)
- [PULL 17/25] tests/avocado: s390x cpu topology entitlement tests, Thomas Huth, 2023/10/18
- [PULL 13/25] qapi/s390x/cpu topology: add query-s390x-cpu-polarization command, Thomas Huth, 2023/10/18
- [PULL 21/25] tests/avocado: s390x cpu topology bad move, Thomas Huth, 2023/10/18
- [PULL 24/25] target/s390x/kvm: Simplify the GPRs, ACRs, CRs and prefix synchronization code, Thomas Huth, 2023/10/18
- [PULL 22/25] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req(), Thomas Huth, 2023/10/18
- [PULL 15/25] tests/avocado: s390x cpu topology core, Thomas Huth, 2023/10/18
- [PULL 14/25] docs/s390x/cpu topology: document s390x cpu topology, Thomas Huth, 2023/10/18
- [PULL 18/25] tests/avocado: s390x cpu topology test dedicated CPU, Thomas Huth, 2023/10/18
- [PULL 19/25] tests/avocado: s390x cpu topology test socket full, Thomas Huth, 2023/10/18
- [PULL 20/25] tests/avocado: s390x cpu topology dedicated errors, Thomas Huth, 2023/10/18
- [PULL 23/25] target/s390x/kvm: Turn KVM_CAP_SYNC_REGS into a hard requirement,
Thomas Huth <=
- [PULL 25/25] tests/qtest/migration-test: Disable the analyze-migration.py test on s390x, Thomas Huth, 2023/10/18
- [PULL 16/25] tests/avocado: s390x cpu topology polarization, Thomas Huth, 2023/10/18