46 lines
1.7 KiB
Diff
46 lines
1.7 KiB
Diff
From f88758420a256bb2b277d21cb3f3b60426caf51d Mon Sep 17 00:00:00 2001
|
|
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
Date: Fri, 18 Jul 2025 18:03:47 +0200
|
|
Subject: [PATCH 059/115] kvm: Check KVM_CAP_MAX_VCPUS at vm level
|
|
|
|
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
|
|
RH-MergeRequest: 391: TDX support, including attestation and device assignment
|
|
RH-Jira: RHEL-15710 RHEL-20798 RHEL-49728
|
|
RH-Acked-by: Yash Mankad <None>
|
|
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
|
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
|
RH-Commit: [59/115] aac4b448f0e64cdca79d2a8f3c53f683b9514a8a (bonzini/rhel-qemu-kvm)
|
|
|
|
KVM with TDX support starts to report different KVM_CAP_MAX_VCPUS per
|
|
different VM types. So switch to check the KVM_CAP_MAX_VCPUS at vm level.
|
|
|
|
KVM still returns the global KVM_CAP_MAX_VCPUS when the KVM is old that
|
|
doesn't report different value at vm level.
|
|
|
|
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
|
|
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
|
|
Link: https://lore.kernel.org/r/20250508150002.689633-31-xiaoyao.li@intel.com
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
(cherry picked from commit 77b5403a0298a5460554f768a2098fd21588e555)
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
---
|
|
accel/kvm/kvm-all.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
|
|
index 65952d7f4e..c1605bc4fa 100644
|
|
--- a/accel/kvm/kvm-all.c
|
|
+++ b/accel/kvm/kvm-all.c
|
|
@@ -2419,7 +2419,7 @@ static int kvm_recommended_vcpus(KVMState *s)
|
|
|
|
static int kvm_max_vcpus(KVMState *s)
|
|
{
|
|
- int ret = kvm_check_extension(s, KVM_CAP_MAX_VCPUS);
|
|
+ int ret = kvm_vm_check_extension(s, KVM_CAP_MAX_VCPUS);
|
|
return (ret) ? ret : kvm_recommended_vcpus(s);
|
|
}
|
|
|
|
--
|
|
2.50.1
|
|
|