[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 24/24] spapr: don't initialize PATB entry if max-cpu-
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 24/24] spapr: don't initialize PATB entry if max-cpu-compat < power9 |
Date: |
Fri, 15 Dec 2017 16:54:35 +1100 |
From: Laurent Vivier <address@hidden>
if KVM is enabled and KVM capabilities MMU radix is available,
the partition table entry (patb_entry) for the radix mode is
initialized by default in ppc_spapr_reset().
It's a problem if we want to migrate the guest to a POWER8 host
while the kernel is not started to set the value to the one
expected for a POWER8 CPU.
The "-machine max-cpu-compat=power8" should allow to migrate
a POWER9 KVM host to a POWER8 KVM host, but because patb_entry
is set, the destination QEMU tries to enable radix mode on the
POWER8 host. This fails and cancels the migration:
Process table config unsupported by the host
error while loading state for instance 0x0 of device 'spapr'
load of migration failed: Invalid argument
This patch doesn't set the PATB entry if the user provides
a CPU compatibility mode that doesn't support radix mode.
Signed-off-by: Laurent Vivier <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 4f354a8760..6785a90c60 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1466,7 +1466,10 @@ static void spapr_machine_reset(void)
/* Check for unknown sysbus devices */
foreach_dynamic_sysbus_device(find_unknown_sysbus_device, NULL);
- if (kvm_enabled() && kvmppc_has_cap_mmu_radix()) {
+ first_ppc_cpu = POWERPC_CPU(first_cpu);
+ if (kvm_enabled() && kvmppc_has_cap_mmu_radix() &&
+ ppc_check_compat(first_ppc_cpu, CPU_POWERPC_LOGICAL_3_00, 0,
+ spapr->max_compat_pvr)) {
/* If using KVM with radix mode available, VCPUs can be started
* without a HPT because KVM will start them in radix mode.
* Set the GR bit in PATB so that we know there is no HPT. */
@@ -1525,7 +1528,6 @@ static void spapr_machine_reset(void)
g_free(fdt);
/* Set up the entry state */
- first_ppc_cpu = POWERPC_CPU(first_cpu);
first_ppc_cpu->env.gpr[3] = fdt_addr;
first_ppc_cpu->env.gpr[5] = 0;
first_cpu->halted = 0;
--
2.14.3
- [Qemu-devel] [PULL 16/24] spapr: introduce a spapr_irq_set_lsi() helper, (continued)
- [Qemu-devel] [PULL 16/24] spapr: introduce a spapr_irq_set_lsi() helper, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 13/24] ppc/xics: introduce an icp_create() helper, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 20/24] spapr_events: drop bogus cell from "interrupt-ranges" property, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 07/24] pcc: define the Power-saving mode Exit Cause Enable bits in PowerPCCPUClass, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 14/24] ppc/xics: assign of the CPU 'intc' pointer under the core, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 15/24] spapr: move the IRQ allocation routines under the machine, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 08/24] openpic: debug w/ info_report(), David Gibson, 2017/12/15
- [Qemu-devel] [PULL 18/24] spapr: replace numa_get_node() with lookup in pc-dimm list, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 22/24] spapr: Rename machine init functions for clarity, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 19/24] spapr: fix LSI interrupt specifiers in the device tree, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 24/24] spapr: don't initialize PATB entry if max-cpu-compat < power9,
David Gibson <=
- [Qemu-devel] [PULL 21/24] target/ppc: introduce the PPC_BIT() macro, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 23/24] spapr: Assume msi_nonbroken, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 11/24] spapr/rtas: fix reboot of a a SMP TCG guest, David Gibson, 2017/12/15
- [Qemu-devel] [PULL 17/24] spapr: introduce a spapr_qirq() helper, David Gibson, 2017/12/15
- Re: [Qemu-devel] [PULL 00/24] ppc-for-2.12 queue 20171215, Peter Maydell, 2017/12/15