Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-10-31 13:27:38 +0100
committerMichal Suchanek <msuchanek@suse.de>2018-10-31 23:28:44 +0100
commit2c77d8d71138ea2b677e58cc3baab8b2cfb186c2 (patch)
treef474585dabca92d21ce0d0cb2d0c8413416dd577
parent3d1fd5d32e9fc106ea96f588c394f456ecf78e55 (diff)
KVM: PPC: Book3S HV: Allow creating max number of VCPUs on
POWER9 (bsc#1061840).
-rw-r--r--patches.arch/KVM-PPC-Book3S-HV-Allow-creating-max-number-of-VCPUs.patch53
-rw-r--r--series.conf1
2 files changed, 54 insertions, 0 deletions
diff --git a/patches.arch/KVM-PPC-Book3S-HV-Allow-creating-max-number-of-VCPUs.patch b/patches.arch/KVM-PPC-Book3S-HV-Allow-creating-max-number-of-VCPUs.patch
new file mode 100644
index 0000000000..cae8d16646
--- /dev/null
+++ b/patches.arch/KVM-PPC-Book3S-HV-Allow-creating-max-number-of-VCPUs.patch
@@ -0,0 +1,53 @@
+From 1ebe6b81ebdba8faf377d1d7d84ad9368e7a0bae Mon Sep 17 00:00:00 2001
+From: Paul Mackerras <paulus@ozlabs.org>
+Date: Thu, 26 Jul 2018 14:53:54 +1000
+Subject: [PATCH] KVM: PPC: Book3S HV: Allow creating max number of VCPUs on
+ POWER9
+
+References: bsc#1061840
+Patch-mainline: v4.19-rc1
+Git-commit: 1ebe6b81ebdba8faf377d1d7d84ad9368e7a0bae
+
+Commit 1e175d2 ("KVM: PPC: Book3S HV: Pack VCORE IDs to access full
+VCPU ID space", 2018-07-25) allowed use of VCPU IDs up to
+KVM_MAX_VCPU_ID on POWER9 in all guest SMT modes and guest emulated
+hardware SMT modes. However, with the current definition of
+KVM_MAX_VCPU_ID, a guest SMT mode of 1 and an emulated SMT mode of 8,
+it is only possible to create KVM_MAX_VCPUS / 2 VCPUS, because
+threads_per_subcore is 4 on POWER9 CPUs. (Using an emulated SMT mode
+of 8 is useful when migrating VMs to or from POWER8 hosts.)
+
+This increases KVM_MAX_VCPU_ID to 8 * KVM_MAX_VCPUS when HV KVM is
+configured in, so that a full complement of KVM_MAX_VCPUS VCPUs can
+be created on POWER9 in all guest SMT modes and emulated hardware
+SMT modes.
+
+Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/include/asm/kvm_host.h | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
+index 5b9e6608c5bf..906bcbdfd2a1 100644
+--- a/arch/powerpc/include/asm/kvm_host.h
++++ b/arch/powerpc/include/asm/kvm_host.h
+@@ -42,7 +42,14 @@
+ #define KVM_USER_MEM_SLOTS 512
+
+ #include <asm/cputhreads.h>
+-#define KVM_MAX_VCPU_ID (threads_per_subcore * KVM_MAX_VCORES)
++
++#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
++#include <asm/kvm_book3s_asm.h> /* for MAX_SMT_THREADS */
++#define KVM_MAX_VCPU_ID (MAX_SMT_THREADS * KVM_MAX_VCORES)
++
++#else
++#define KVM_MAX_VCPU_ID KVM_MAX_VCPUS
++#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
+
+ #define __KVM_HAVE_ARCH_INTC_INITIALIZED
+
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index e745c1d98c..7f3f7cdf65 100644
--- a/series.conf
+++ b/series.conf
@@ -17782,6 +17782,7 @@
patches.arch/KVM-PPC-Book3S-HV-Add-of_node_put-in-success-path.patch
patches.arch/KVM-PPC-Book3S-HV-Fix-constant-size-warning.patch
patches.arch/KVM-PPC-Book3S-HV-Pack-VCORE-IDs-to-access-full-VCPU.patch
+ patches.arch/KVM-PPC-Book3S-HV-Allow-creating-max-number-of-VCPUs.patch
patches.fixes/kvm-s390-add-etoken-support-for-guests.patch
patches.arch/kvm-nvmx-fix-fault-vector-for-vmx-operation-at-cpl-0
patches.arch/kvm-vmx-track-host_state-loaded-using-a-loaded_vmcs-pointer