cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
febaa2
From c5616455a4db0e5b67a41e4f6ec12b939e95eaa1 Mon Sep 17 00:00:00 2001
22c213
From: Andrew Jones <drjones@redhat.com>
22c213
Date: Tue, 21 Jan 2014 10:46:52 +0100
22c213
Subject: globally limit the maximum number of CPUs
22c213
22c213
We now globally limit the number of VCPUs.
22c213
Especially, there is no way one can specify more than
22c213
max_cpus VCPUs for a VM.
22c213
22c213
This allows us the restore the ppc max_cpus limitation to the upstream
22c213
default and minimize the ppc hack in kvm-all.c.
22c213
22c213
Signed-off-by: David Hildenbrand <david@redhat.com>
22c213
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
22c213
Signed-off-by: Danilo Cesar Lemes de Paula <ddepaula@redhat.com>
22c213
22c213
Rebase notes (2.11.0):
22c213
- Removed CONFIG_RHV reference
22c213
- Update commit log
22c213
22c213
Merged patches (2.11.0):
22c213
- 92fef14623 redhat: remove manual max_cpus limitations for ppc
22c213
- bb722e9eff redhat: globally limit the maximum number of CPUs
22c213
- fdeef3c1c7 RHEL: Set vcpus hard limit to 240 for Power
22c213
- 0584216921 Match POWER max cpus to x86
22c213
22c213
Signed-off-by: Andrew Jones <drjones@redhat.com>
22c213
febaa2
Merged patches (5.1.0):
febaa2
- redhat: globally limit the maximum number of CPUs
febaa2
- redhat: remove manual max_cpus limitations for ppc
febaa2
- use recommended max vcpu count
22c213
febaa2
Merged patches (5.2.0 rc0):
febaa2
- f8a4123 vl: Remove downstream-only MAX_RHEL_CPUS code
22c213
22c213
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
22c213
---
22c213
 accel/kvm/kvm-all.c | 12 ++++++++++++
febaa2
 1 file changed, 12 insertions(+)
22c213
22c213
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
febaa2
index 0125c17edb..b5d488a027 100644
22c213
--- a/accel/kvm/kvm-all.c
22c213
+++ b/accel/kvm/kvm-all.c
febaa2
@@ -2413,6 +2413,18 @@ static int kvm_init(MachineState *ms)
22c213
     soft_vcpus_limit = kvm_recommended_vcpus(s);
22c213
     hard_vcpus_limit = kvm_max_vcpus(s);
22c213
 
22c213
+#ifdef HOST_PPC64
22c213
+    /*
22c213
+     * On POWER, the kernel advertises a soft limit based on the
22c213
+     * number of CPU threads on the host.  We want to allow exceeding
22c213
+     * this for testing purposes, so we don't want to set hard limit
22c213
+     * to soft limit as on x86.
22c213
+     */
22c213
+#else
22c213
+    /* RHEL doesn't support nr_vcpus > soft_vcpus_limit */
22c213
+    hard_vcpus_limit = soft_vcpus_limit;
22c213
+#endif
22c213
+
22c213
     while (nc->name) {
22c213
         if (nc->num > soft_vcpus_limit) {
22c213
             warn_report("Number of %s cpus requested (%d) exceeds "
22c213
-- 
febaa2
2.31.1
22c213