All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2] pseries: fix TCG migration
Date: Wed, 29 Nov 2017 12:04:39 +1100	[thread overview]
Message-ID: <20171129010439.GA3023@umbus.fritz.box> (raw)
In-Reply-To: <20171128174310.15700-1-lvivier@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]

On Tue, Nov 28, 2017 at 06:43:10PM +0100, Laurent Vivier wrote:
> Migration of pseries is broken with TCG because
> QEMU tries to restore KVM MMU state unconditionally.
> 
> The result is a SIGSEGV in kvm_vm_ioctl():
> 
>   #0  kvm_vm_ioctl (s=0x0, type=-2146390353)
>       at qemu/accel/kvm/kvm-all.c:2032
>   #1  0x00000001003e3e2c in kvmppc_configure_v3_mmu (cpu=<optimized out>,
>       radix=<optimized out>, gtse=<optimized out>, proc_tbl=<optimized out>)
>       at qemu/target/ppc/kvm.c:396
>   #2  0x00000001002f8b88 in spapr_post_load (opaque=0x1019103c0,
>       version_id=<optimized out>) at qemu/hw/ppc/spapr.c:1578
>   #3  0x000000010059e4cc in vmstate_load_state (f=0x106230000,
>       vmsd=0x1009479e0 <vmstate_spapr>, opaque=0x1019103c0,
>       version_id=<optimized out>) at qemu/migration/vmstate.c:165
>   #4  0x00000001005987e0 in vmstate_load (f=<optimized out>, se=<optimized out>)
>       at qemu/migration/savevm.c:748
> 
> This patch fixes the problem by not calling the KVM function with the
> TCG mode.
> 
> Fixes: d39c90f5f3 ("spapr: Fix migration of Radix guests")
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> v2: fix the comment to keep GDB backtrace lines starting with '#'

Applied to ppc-for-2.11.

> 
>  hw/ppc/spapr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 9efddeaee5..a471de6cab 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1570,7 +1570,7 @@ static int spapr_post_load(void *opaque, int version_id)
>          err = spapr_rtc_import_offset(&spapr->rtc, spapr->rtc_offset);
>      }
>  
> -    if (spapr->patb_entry) {
> +    if (kvm_enabled() && 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);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2017-11-29  1:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 17:43 [Qemu-devel] [PATCH v2] pseries: fix TCG migration Laurent Vivier
2017-11-28 19:26 ` [Qemu-devel] [Qemu-ppc] " Daniel Henrique Barboza
2017-11-28 23:55   ` Suraj Jitindar Singh
2017-11-28 23:58 ` Suraj Jitindar Singh
2017-11-29  4:39   ` Bharata B Rao
2017-11-29  1:04 ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171129010439.GA3023@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=danielhb@linux.vnet.ibm.com \
    --cc=lvivier@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.