[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
signature.asc
Description: PGP signature
- [Qemu-ppc] [PATCH for-2.13 06/13] target/ppc: Move page size setup to helper function, (continued)
- [Qemu-ppc] [PATCH for-2.13 06/13] target/ppc: Move page size setup to helper function, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 11/13] target/ppc: Remove unnecessary POWERPC_MMU_V3 flag from mmu_model, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 01/13] target/ppc: Standardize instance_init and realize function names, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 05/13] target/ppc: Remove fallback 64k pagesize information, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 03/13] target/ppc: Pass cpu instead of env to ppc_create_page_sizes_prop(), David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 08/13] target/ppc: Make hash64_opts field mandatory for 64-bit hash MMUs, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 10/13] target/ppc: Fold ci_large_pages flag into PPCHash64Options, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 04/13] target/ppc: Avoid taking "env" parameter to mmu-hash64 functions, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 09/13] target/ppc: Move 1T segment and AMR options to PPCHash64Options, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 12/13] target/ppc: Get rid of POWERPC_MMU_VER() macros, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 07/13] target/ppc: Split page size information into a separate allocation, David Gibson, 2018/04/04
- [Qemu-ppc] [PATCH for-2.13 13/13] target/ppc: Fold slb_nr into PPCHash64Options, David Gibson, 2018/04/04