* [Qemu-devel] [PATCH] pseries: Restore support for total vcpus not a multiple of threads-per-core for old machine types
@ 2017-05-23 6:36 David Gibson
2017-05-23 6:59 ` Laurent Vivier
2017-05-23 7:16 ` Greg Kurz
0 siblings, 2 replies; 3+ messages in thread
From: David Gibson @ 2017-05-23 6:36 UTC (permalink / raw)
To: groug, bharata; +Cc: lvivier, thuth, mdroth, qemu-devel, qemu-ppc, David Gibson
As of pseries-2.7 and later, we require the total number of guest vcpus to
be a multiple of the threads-per-core. pseries-2.6 and earlier machine
types, however, are supposed to allow this for the sake of migration from
old qemu versions which allowed this.
Unfortunately, 8149e29 "pseries: Enforce homogeneous threads-per-core"
broke this by not considering the old machine type case. This fixes it by
only applying the check when the machine type supports hotpluggable cpus.
By not-entirely-coincidence, that corresponds to the same time when we
started enforcing total threads being a multiple of threads-per-core.
Fixes: 8149e2992f7811355cc34721b79d69d1a3a667dd
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index c92d269..bcb0e18 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2863,7 +2863,13 @@ static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
goto out;
}
- if (cc->nr_threads != smp_threads) {
+ /*
+ * In general we should have homogeneous threads-per-core, but old
+ * (pre hotplug support) machine types allow the last core to have
+ * reduced threads as a compatibility hack for when we allowed
+ * total vcpus not a multiple of threads-per-core.
+ */
+ if (mc->has_hotpluggable_cpus && (cc->nr_threads != smp_threads)) {
error_setg(errp, "invalid nr-threads %d, must be %d",
cc->nr_threads, smp_threads);
return;
--
2.9.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Qemu-devel] [PATCH] pseries: Restore support for total vcpus not a multiple of threads-per-core for old machine types
2017-05-23 6:36 [Qemu-devel] [PATCH] pseries: Restore support for total vcpus not a multiple of threads-per-core for old machine types David Gibson
@ 2017-05-23 6:59 ` Laurent Vivier
2017-05-23 7:16 ` Greg Kurz
1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2017-05-23 6:59 UTC (permalink / raw)
To: David Gibson, groug, bharata; +Cc: thuth, mdroth, qemu-devel, qemu-ppc
On 23/05/2017 08:36, David Gibson wrote:
> As of pseries-2.7 and later, we require the total number of guest vcpus to
> be a multiple of the threads-per-core. pseries-2.6 and earlier machine
> types, however, are supposed to allow this for the sake of migration from
> old qemu versions which allowed this.
>
> Unfortunately, 8149e29 "pseries: Enforce homogeneous threads-per-core"
> broke this by not considering the old machine type case. This fixes it by
> only applying the check when the machine type supports hotpluggable cpus.
> By not-entirely-coincidence, that corresponds to the same time when we
> started enforcing total threads being a multiple of threads-per-core.
>
> Fixes: 8149e2992f7811355cc34721b79d69d1a3a667dd
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> hw/ppc/spapr.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index c92d269..bcb0e18 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2863,7 +2863,13 @@ static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
> goto out;
> }
>
> - if (cc->nr_threads != smp_threads) {
> + /*
> + * In general we should have homogeneous threads-per-core, but old
> + * (pre hotplug support) machine types allow the last core to have
> + * reduced threads as a compatibility hack for when we allowed
> + * total vcpus not a multiple of threads-per-core.
> + */
> + if (mc->has_hotpluggable_cpus && (cc->nr_threads != smp_threads)) {
> error_setg(errp, "invalid nr-threads %d, must be %d",
> cc->nr_threads, smp_threads);
> return;
>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Qemu-devel] [PATCH] pseries: Restore support for total vcpus not a multiple of threads-per-core for old machine types
2017-05-23 6:36 [Qemu-devel] [PATCH] pseries: Restore support for total vcpus not a multiple of threads-per-core for old machine types David Gibson
2017-05-23 6:59 ` Laurent Vivier
@ 2017-05-23 7:16 ` Greg Kurz
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kurz @ 2017-05-23 7:16 UTC (permalink / raw)
To: David Gibson; +Cc: bharata, lvivier, thuth, mdroth, qemu-devel, qemu-ppc
[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]
On Tue, 23 May 2017 16:36:45 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:
> As of pseries-2.7 and later, we require the total number of guest vcpus to
> be a multiple of the threads-per-core. pseries-2.6 and earlier machine
> types, however, are supposed to allow this for the sake of migration from
> old qemu versions which allowed this.
>
> Unfortunately, 8149e29 "pseries: Enforce homogeneous threads-per-core"
> broke this by not considering the old machine type case. This fixes it by
> only applying the check when the machine type supports hotpluggable cpus.
> By not-entirely-coincidence, that corresponds to the same time when we
> started enforcing total threads being a multiple of threads-per-core.
>
> Fixes: 8149e2992f7811355cc34721b79d69d1a3a667dd
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
and
Tested-by: Greg Kurz <groug@kaod.org>
> hw/ppc/spapr.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index c92d269..bcb0e18 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2863,7 +2863,13 @@ static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
> goto out;
> }
>
> - if (cc->nr_threads != smp_threads) {
> + /*
> + * In general we should have homogeneous threads-per-core, but old
> + * (pre hotplug support) machine types allow the last core to have
> + * reduced threads as a compatibility hack for when we allowed
> + * total vcpus not a multiple of threads-per-core.
> + */
> + if (mc->has_hotpluggable_cpus && (cc->nr_threads != smp_threads)) {
> error_setg(errp, "invalid nr-threads %d, must be %d",
> cc->nr_threads, smp_threads);
> return;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-23 7:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23 6:36 [Qemu-devel] [PATCH] pseries: Restore support for total vcpus not a multiple of threads-per-core for old machine types David Gibson
2017-05-23 6:59 ` Laurent Vivier
2017-05-23 7:16 ` Greg Kurz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).