From bd40310ce834bf1d80f7dbc254fd6a341b45866b Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Tue, 4 Jul 2017 16:32:58 +0200 Subject: [PATCH 3/4] spapr: Fix migration of Radix guests RH-Author: Laurent Vivier Message-id: <20170704163258.9846-4-lvivier@redhat.com> Patchwork-id: 75707 O-Subject: [Pegas-1.0 qemu-kvm PATCH 3/3] spapr: Fix migration of Radix guests Bugzilla: 1456287 RH-Acked-by: David Gibson RH-Acked-by: Thomas Huth RH-Acked-by: Miroslav Rezanina From: Bharata B Rao Fix migration of radix guests by ensuring that we issue KVM_PPC_CONFIGURE_V3_MMU for radix case post migration. Reported-by: Nageswara R Sastry Signed-off-by: Bharata B Rao Reviewed-by: Suraj Jitindar Singh Signed-off-by: David Gibson (cherry picked from commit d39c90f5f3ae23a6c8202eb6e1204ea84991e7f5) Signed-off-by: Laurent Vivier Signed-off-by: Miroslav Rezanina --- hw/ppc/spapr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c322666..07c28d4 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1461,6 +1461,18 @@ static int spapr_post_load(void *opaque, int version_id) err = spapr_rtc_import_offset(spapr->rtc, spapr->rtc_offset); } + if (spapr->patb_entry) { + PowerPCCPU *cpu = POWERPC_CPU(first_cpu); + bool radix = !!(spapr->patb_entry & PATBE1_GR); + bool gtse = !!(cpu->env.spr[SPR_LPCR] & LPCR_GTSE); + + err = kvmppc_configure_v3_mmu(cpu, radix, gtse, spapr->patb_entry); + if (err) { + error_report("Process table config unsupported by the host"); + return -EINVAL; + } + } + return err; } -- 1.8.3.1