[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 08/21] PPC: booke: add tlbnps handling
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 08/21] PPC: booke: add tlbnps handling |
Date: |
Thu, 2 Feb 2012 02:49:31 +0100 |
When using MAV 2.0 TLB registers, we have another range of TLB registers
available to read the supported page sizes from.
Add SPR definitions for those and add a helper function that we can use
to receive such a bitmap even when using MAV 1.0.
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/cpu.h | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 6f4cdde..1026254 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -1355,6 +1355,10 @@ static inline void cpu_clone_regs(CPUState *env,
target_ulong newsp)
#define SPR_BOOKE_DVC2 (0x13F)
#define SPR_BOOKE_TSR (0x150)
#define SPR_BOOKE_TCR (0x154)
+#define SPR_BOOKE_TLB0PS (0x158)
+#define SPR_BOOKE_TLB1PS (0x159)
+#define SPR_BOOKE_TLB2PS (0x15A)
+#define SPR_BOOKE_TLB3PS (0x15B)
#define SPR_BOOKE_IVOR0 (0x190)
#define SPR_BOOKE_IVOR1 (0x191)
#define SPR_BOOKE_IVOR2 (0x192)
@@ -2116,6 +2120,27 @@ static inline ppcmas_tlb_t *booke206_get_tlbm(CPUState
*env, const int tlbn,
return &env->tlb.tlbm[r];
}
+/* returns bitmap of supported page sizes for a given TLB */
+static inline uint32_t booke206_tlbnps(CPUState *env, const int tlbn)
+{
+ bool mav2 = false;
+ uint32_t ret = 0;
+
+ if (mav2) {
+ ret = env->spr[SPR_BOOKE_TLB0PS + tlbn];
+ } else {
+ uint32_t tlbncfg = env->spr[SPR_BOOKE_TLB0CFG + tlbn];
+ uint32_t min = (tlbncfg & TLBnCFG_MINSIZE) >> TLBnCFG_MINSIZE_SHIFT;
+ uint32_t max = (tlbncfg & TLBnCFG_MAXSIZE) >> TLBnCFG_MAXSIZE_SHIFT;
+ int i;
+ for (i = min; i <= max; i++) {
+ ret |= (1 << (i << 1));
+ }
+ }
+
+ return ret;
+}
+
#endif
extern void (*cpu_ppc_hypercall)(CPUState *);
--
1.6.0.2
- [Qemu-ppc] [PATCH 16/21] PPC: Add CPU feature for processor control, (continued)
- [Qemu-ppc] [PATCH 16/21] PPC: Add CPU feature for processor control, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 18/21] PPC: E500: Implement msgclr, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 21/21] PPC: E500: Populate L1CFG0 SPR, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 11/21] PPC: booke206: Check for TLB overrun, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 07/21] PPC: booke206: allow NULL raddr in ppcmas_tlb_check, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 10/21] PPC: booke206: Implement tlbilx, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 20/21] PPC: e500mc: Enable processor control, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 17/21] PPC: Enable doorbell excp handlers, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 09/21] PPC: booke206: Check for min/max TLB entry size, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 02/21] PPC: KVM: Update HIOR code to new interface, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 08/21] PPC: booke: add tlbnps handling,
Alexander Graf <=
- [Qemu-ppc] [PATCH 04/21] PPC: e500mc: add missing IVORs to bitmap, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 05/21] PPC: e500: msync is 440 only, e500 has real sync, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 01/21] KVM: Update headers (except HIOR mess), Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 14/21] PPC: E500: Add some more excp vectors, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 06/21] PPC: rename msync to msync_4xx, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 15/21] PPC: E500: Add doorbell defines, Alexander Graf, 2012/02/01
- [Qemu-ppc] [PATCH 13/21] KVM: Fix compilation on non-x86, Alexander Graf, 2012/02/01
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/21] ppc patch queue 2012-02-02, Andreas Färber, 2012/02/02
- Re: [Qemu-ppc] [PULL 00/21] ppc patch queue 2012-02-02, Blue Swirl, 2012/02/04