[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/26] PPC: Bamboo: Set initial TLB entry
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 03/26] PPC: Bamboo: Set initial TLB entry |
Date: |
Sat, 21 Jan 2012 05:18:48 +0100 |
Back in the day when the bamboo target got introduced, the initial TLB was
dictated by KVM. TCG has been missing initial TLB values ever since, rendering
the target unusable for TCG usage.
This patch adds linear TLB maps the way Linux expects them, making the target
work.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc440_bamboo.c | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c
index f82d587..c17f6f7 100644
--- a/hw/ppc440_bamboo.c
+++ b/hw/ppc440_bamboo.c
@@ -103,6 +103,29 @@ out:
return ret;
}
+/* Create reset TLB entries for BookE, spanning the 32bit addr space. */
+static void mmubooke_create_initial_mapping(CPUState *env,
+ target_ulong va,
+ target_phys_addr_t pa)
+{
+ ppcemb_tlb_t *tlb = &env->tlb.tlbe[0];
+
+ tlb->attr = 0;
+ tlb->prot = PAGE_VALID | ((PAGE_READ | PAGE_WRITE | PAGE_EXEC) << 4);
+ tlb->size = 1 << 31; /* up to 0x80000000 */
+ tlb->EPN = va & TARGET_PAGE_MASK;
+ tlb->RPN = pa & TARGET_PAGE_MASK;
+ tlb->PID = 0;
+
+ tlb = &env->tlb.tlbe[1];
+ tlb->attr = 0;
+ tlb->prot = PAGE_VALID | ((PAGE_READ | PAGE_WRITE | PAGE_EXEC) << 4);
+ tlb->size = 1 << 31; /* up to 0xffffffff */
+ tlb->EPN = 0x80000000 & TARGET_PAGE_MASK;
+ tlb->RPN = 0x80000000 & TARGET_PAGE_MASK;
+ tlb->PID = 0;
+}
+
static void main_cpu_reset(void *opaque)
{
CPUState *env = opaque;
@@ -111,6 +134,9 @@ static void main_cpu_reset(void *opaque)
env->gpr[1] = (16<<20) - 8;
env->gpr[3] = FDT_ADDR;
env->nip = entry;
+
+ /* Create a mapping for the kernel. */
+ mmubooke_create_initial_mapping(env, 0, 0);
}
static void bamboo_init(ram_addr_t ram_size,
@@ -181,7 +207,6 @@ static void bamboo_init(ram_addr_t ram_size,
fprintf(stderr, "couldn't load device tree\n");
exit(1);
}
- /* XXX we currently depend on KVM to create some initial TLB entries.
*/
}
if (kvm_enabled())
--
1.6.0.2
- [Qemu-devel] [PULL 00/26] ppc patch queue 2012-01-2 1, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 06/26] PPC: 440: Default to 440EP CPU, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 02/26] PPC: Bamboo: Register CPU reset, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 12/26] PPC: Bamboo: Integrate SoC instatiation, use qdev for PCI, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 04/26] PPC: 440: Ignore invalid PCI IRQs, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 07/26] PPC: Enable 440EP CPU target, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 11/26] PPC: Bamboo: fold ppc440.c and ppc440_bamboo.c into a single file, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 10/26] PPC: 4xx: Qdevify the 440 PCI host controller, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 14/26] virtio: change memcpy to guest reads, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 03/26] PPC: Bamboo: Set initial TLB entry,
Alexander Graf <=
- [Qemu-devel] [PATCH 13/26] virtio-pci: Fix endianness of virtio config, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 09/26] PPC: bamboo: fix whitespace, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 01/26] PPC: 440EP: Initialize timer, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 26/26] grackle_pci: Clean up qdev names, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 24/26] PPC: Pseries: Check for PCI boundaries, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 05/26] PPC: Bamboo: recompile device tree, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 16/26] Fix dirty logging with 32-bit qemu & 64-bit guests, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 17/26] Update gitignore file, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 08/26] PPC: bamboo: remove old machine descriptions, Alexander Graf, 2012/01/20
- [Qemu-devel] [PATCH 23/26] MAINTAINERS: Add PCI host bridge files to CHRP machines, Alexander Graf, 2012/01/20