aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/machine.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2011-06-17 01:00:28 +0200
committerAlexander Graf <agraf@suse.de>2011-06-17 02:58:37 +0200
commit1c53accceeb01246aea0ec361e1efd15cac6db0f (patch)
tree19d6bae7c21f0d852d5a1af0ad63b61a3d84fabf /target-ppc/machine.c
parent0dd4bc7dd45de7afa88662d24bd50a3aafdbab64 (diff)
downloadqemu-arm-1c53accceeb01246aea0ec361e1efd15cac6db0f.tar.gz
PPC: move TLBs to their own arrays
Until now, we've created a union over multiple different TLB types and allocated that union. While it's a waste of memory (and cache) to allocate TLB information for a TLB type with much information when you only need little, it also inflicts another issue. With the new KVM API, we can now share the TLB between KVM and qemu, but for that to work we need to have both be in the same layout. We can't just stretch it over to fit some internal different TLB representation. Hence this patch moves all TLB types to their own array, allowing us to only address and allocate exactly the boundaries required for the specific TLB type at hand. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-ppc/machine.c')
-rw-r--r--target-ppc/machine.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/target-ppc/machine.c b/target-ppc/machine.c
index 0c1986e528..1c40d4358a 100644
--- a/target-ppc/machine.c
+++ b/target-ppc/machine.c
@@ -52,12 +52,12 @@ void cpu_save(QEMUFile *f, void *opaque)
qemu_put_sbe32s(f, &env->last_way);
qemu_put_sbe32s(f, &env->id_tlbs);
qemu_put_sbe32s(f, &env->nb_pids);
- if (env->tlb) {
+ if (env->tlb.tlb6) {
// XXX assumes 6xx
for (i = 0; i < env->nb_tlb; i++) {
- qemu_put_betls(f, &env->tlb[i].tlb6.pte0);
- qemu_put_betls(f, &env->tlb[i].tlb6.pte1);
- qemu_put_betls(f, &env->tlb[i].tlb6.EPN);
+ qemu_put_betls(f, &env->tlb.tlb6[i].pte0);
+ qemu_put_betls(f, &env->tlb.tlb6[i].pte1);
+ qemu_put_betls(f, &env->tlb.tlb6[i].EPN);
}
}
for (i = 0; i < 4; i++)
@@ -140,12 +140,12 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_sbe32s(f, &env->last_way);
qemu_get_sbe32s(f, &env->id_tlbs);
qemu_get_sbe32s(f, &env->nb_pids);
- if (env->tlb) {
+ if (env->tlb.tlb6) {
// XXX assumes 6xx
for (i = 0; i < env->nb_tlb; i++) {
- qemu_get_betls(f, &env->tlb[i].tlb6.pte0);
- qemu_get_betls(f, &env->tlb[i].tlb6.pte1);
- qemu_get_betls(f, &env->tlb[i].tlb6.EPN);
+ qemu_get_betls(f, &env->tlb.tlb6[i].pte0);
+ qemu_get_betls(f, &env->tlb.tlb6[i].pte1);
+ qemu_get_betls(f, &env->tlb.tlb6[i].EPN);
}
}
for (i = 0; i < 4; i++)