[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 006/113] spapr: Allow some cases where we can't set
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 006/113] spapr: Allow some cases where we can't set VSMT mode in the kernel |
Date: |
Mon, 18 Jun 2018 20:41:32 -0500 |
From: David Gibson <address@hidden>
At present if we require a vsmt mode that's not equal to the kernel's
default, and the kernel doesn't let us change it (e.g. because it's an old
kernel without support) then we always fail.
But in fact we can cope with the kernel having a different vsmt as long as
a) it's >= the actual number of vthreads/vcore (so that guest threads
that are supposed to be on the same core act like it)
b) it's a submultiple of the requested vsmt mode (so that guest threads
spaced by the vsmt value will act like they're on different cores)
Allowing this case gives us a bit more freedom to adjust the vsmt behaviour
without breaking existing cases.
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Tested-by: Greg Kurz <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
(cherry picked from commit 1f20f2e0ee61d91abff4e86ed1cda1b5244647d3)
Signed-off-by: Greg Kurz <address@hidden>
---
hw/ppc/spapr.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index b57528baf4..37388f1416 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2291,17 +2291,29 @@ static void spapr_set_vsmt_mode(sPAPRMachineState
*spapr, Error **errp)
if (kvm_enabled() && (spapr->vsmt != kvm_smt)) {
ret = kvmppc_set_smt_threads(spapr->vsmt);
if (ret) {
+ /* Looks like KVM isn't able to change VSMT mode */
error_setg(&local_err,
"Failed to set KVM's VSMT mode to %d (errno %d)",
spapr->vsmt, ret);
- if (!vsmt_user) {
- error_append_hint(&local_err, "On PPC, a VM with %d threads/"
- "core on a host with %d threads/core requires "
- " the use of VSMT mode %d.\n",
- smp_threads, kvm_smt, spapr->vsmt);
+ /* We can live with that if the default one is big enough
+ * for the number of threads, and a submultiple of the one
+ * we want. In this case we'll waste some vcpu ids, but
+ * behaviour will be correct */
+ if ((kvm_smt >= smp_threads) && ((spapr->vsmt % kvm_smt) == 0)) {
+ warn_report_err(local_err);
+ local_err = NULL;
+ goto out;
+ } else {
+ if (!vsmt_user) {
+ error_append_hint(&local_err,
+ "On PPC, a VM with %d threads/core"
+ " on a host with %d threads/core"
+ " requires the use of VSMT mode %d.\n",
+ smp_threads, kvm_smt, spapr->vsmt);
+ }
+ kvmppc_hint_smt_possible(&local_err);
+ goto out;
}
- kvmppc_hint_smt_possible(&local_err);
- goto out;
}
}
/* else TCG: nothing to do currently */
--
2.11.0
- [Qemu-devel] [PATCH 064/113] tcg/arm: Fix memory barrier encoding, (continued)
- [Qemu-devel] [PATCH 064/113] tcg/arm: Fix memory barrier encoding, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 065/113] target/arm: Implement v8M VLLDM and VLSTM, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 066/113] target/ppc: always set PPC_MEM_TLBIE in pre 2.8 migration hack, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 068/113] qxl: fix local renderer crash, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 067/113] spapr: don't advertise radix GTSE if max-compat-cpu < power9, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 069/113] configure: recognize more rpmbuild macros, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 070/113] qemu-img: Resolve relative backing paths in rebase, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 073/113] qemu-img: Use only string options in img_open_opts, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 074/113] iotests: Add test for -U/force-share conflicts, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 071/113] iotests: Add test for rebasing with relative paths, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 006/113] spapr: Allow some cases where we can't set VSMT mode in the kernel,
Michael Roth <=
- [Qemu-devel] [PATCH 072/113] qemu-io: Use purely string blockdev options, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 075/113] lm32: take BQL before writing IP/IM register, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 078/113] pc-bios/s390-ccw: struct tpi_info must be declared as aligned(4), Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 079/113] qdev: rename typedef qdev_resetfn() -> DeviceReset(), Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 077/113] s390x/css: disabled subchannels cannot be status pending, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 076/113] raw: Check byte range uniformly, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 080/113] qdev: add helpers to be more explicit when using abstract QOM parent functions, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 007/113] spapr: Adjust default VSMT value for better migration compatibility, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 081/113] s390x/virtio: Convert virtio-ccw from *_exit to *_unrealize, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 082/113] virtio-ccw: common reset handler, Michael Roth, 2018/06/18