qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH for-2.13 09/13] target/ppc: Move 1T segment and AM


From: David Gibson
Subject: Re: [Qemu-ppc] [PATCH for-2.13 09/13] target/ppc: Move 1T segment and AMR options to PPCHash64Options
Date: Fri, 6 Apr 2018 14:58:19 +1000
User-agent: Mutt/1.9.2 (2017-12-15)

On Thu, Apr 05, 2018 at 02:06:19PM +0200, Greg Kurz wrote:
> On Thu,  5 Apr 2018 12:14:33 +1000
> David Gibson <address@hidden> wrote:
> 
> > Currently env->mmu_model is a bit of an unholy mess of an enum of distinct
> > MMU types, with various flag bits as well.  This makes which bits of the
> > field should be compared pretty confusing.
> > 
> > Make a start on cleaning that up by moving two of the flags bits -
> > POWERPC_MMU_1TSEG and POWERPC_MMU_AMR - which are specific to the 64-bit
> > hash MMU into a new flags field in PPCHash64Options structure.
> > 
> > Signed-off-by: David Gibson <address@hidden>
> > Reviewed-by: C├ędric Le Goater <address@hidden>
> > Reviewed-by: Greg Kurz <address@hidden>
> > ---
> 
> While investigating a migration failure from an older QEMU, I realized
> this patch has a problem. The *cpu->hash64_opts structure is zeroed in
> kvm_fixup_page_sizes(), which has now the unwanted effect of clearing
> the cpu->hash64_opts->flags as well.
> 
> We only need to zero the segment page sizes actually. The following
> fixes migration:
> 
> @@ -442,7 +442,7 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
>      }
>  
>      /* Convert to QEMU form */
> -    memset(cpu->hash64_opts, 0, sizeof(*cpu->hash64_opts));
> +    memset(&cpu->hash64_opts->sps, 0, sizeof(cpu->hash64_opts->sps));
>  
>      /* If we have HV KVM, we need to forbid CI large pages if our
>       * host page size is smaller than 64K.

Ah, good catch.  I mistakenly thought that kvm_fixup_page_sizes() was
completely rewriting those flags as well.  I've made this fix now.

I'm also currently working on some other patches which amongst other
things get rid of kvm_fixup_page_sizes(), because it's completely
broken by design.  But might as well not break things excessively in
the meantime.

-- 
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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]