]> xenbits.xensource.com Git - qemu-xen.git/commit
spapr: don't initialize PATB entry if max-cpu-compat < power9
authorLaurent Vivier <lvivier@redhat.com>
Thu, 14 Dec 2017 18:09:48 +0000 (19:09 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 5 Feb 2018 05:38:26 +0000 (23:38 -0600)
commit97d17551b57bfbcae5371295cf48850076ce6caa
tree0d88c2aea8ef2c5e13810b92d00c67c0257c5ded
parent7e25155a7bd23902d41d6b4e7d3d4f6310e86cc0
spapr: don't initialize PATB entry if max-cpu-compat < power9

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 <lvivier@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 1481fe5fcfeb7fcf3c1ebb9d8c0432e3e0188ccf)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ppc/spapr.c