summaryrefslogtreecommitdiffstats
path: root/target/ppc/kvm.c
diff options
context:
space:
mode:
authorDavid Gibson2018-03-23 03:31:52 +0100
committerDavid Gibson2018-04-27 10:05:22 +0200
commitb07c59f7c8df6efc24576f07622b61ad115468e6 (patch)
tree5cbf088fe35640a1481d068f9422a0da61df4e14 /target/ppc/kvm.c
parenttarget/ppc: Move page size setup to helper function (diff)
downloadqemu-b07c59f7c8df6efc24576f07622b61ad115468e6.tar.gz
qemu-b07c59f7c8df6efc24576f07622b61ad115468e6.tar.xz
qemu-b07c59f7c8df6efc24576f07622b61ad115468e6.zip
target/ppc: Split page size information into a separate allocation
env->sps contains page size encoding information as an embedded structure. Since this information is specific to 64-bit hash MMUs, split it out into a separately allocated structure, to reduce the basic env size for other cpus. Along the way we make a few other cleanups: * Rename to PPCHash64Options which is more in line with qemu name conventions, and reflects that we're going to merge some more hash64 mmu specific details in there in future. Also rename its substructures to match qemu conventions. * Move structure definitions to the mmu-hash64.[ch] files. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Greg Kurz <groug@kaod.org> Reviewed-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'target/ppc/kvm.c')
-rw-r--r--target/ppc/kvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 660467aec6..c67254acca 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -442,7 +442,7 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
}
/* Convert to QEMU form */
- memset(&env->sps, 0, sizeof(env->sps));
+ 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.
@@ -456,7 +456,7 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
* the selected CPU has with the capabilities that KVM supports.
*/
for (ik = iq = 0; ik < KVM_PPC_PAGE_SIZES_MAX_SZ; ik++) {
- struct ppc_one_seg_page_size *qsps = &env->sps.sps[iq];
+ PPCHash64SegmentPageSizes *qsps = &cpu->hash64_opts->sps[iq];
struct kvm_ppc_one_seg_page_size *ksps = &smmu_info.sps[ik];
if (!kvm_valid_page_size(smmu_info.flags, max_cpu_page_size,