[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 5/6] PPC: booke206: Check for min/max
From: |
Andreas Färber |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 5/6] PPC: booke206: Check for min/max TLB entry size |
Date: |
Fri, 20 Jan 2012 09:09:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 |
Am 20.01.2012 04:17, schrieb Alexander Graf:
> When setting a TLB entry, we need to check if the TLB we're putting it in
> actually supports the given size. According to the 2.06 PowerPC ISA, a
> value that's out of range results in the minimum page size for the TLB
> to be used.
>
> Signed-off-by: Alexander Graf <address@hidden>
> ---
> target-ppc/op_helper.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
> index 6339c95..0a88bf4 100644
> --- a/target-ppc/op_helper.c
> +++ b/target-ppc/op_helper.c
> @@ -4228,6 +4228,7 @@ void helper_booke206_tlbwe(void)
> {
> uint32_t tlbncfg, tlbn;
> ppcmas_tlb_t *tlb;
> + uint32_t size_tlb, size_min, size_max;
>
> switch (env->spr[SPR_BOOKE_MAS0] & MAS0_WQ_MASK) {
> case MAS0_WQ_ALWAYS:
> @@ -4273,6 +4274,16 @@ void helper_booke206_tlbwe(void)
> tlb->mas1 &= ~MAS1_IPROT;
> }
>
> + /* XXX only applies for MAV 1.0 */
> + size_tlb = (tlb->mas1 & MAS1_TSIZE_MASK) >> (MAS1_TSIZE_SHIFT + 1);
> + size_min = (tlbncfg & TLBnCFG_MINSIZE) >> TLBnCFG_MINSIZE_SHIFT;
> + size_max = (tlbncfg & TLBnCFG_MAXSIZE) >> TLBnCFG_MAXSIZE_SHIFT;
> + if ((size_tlb > size_max) || (size_tlb < size_max)) {
This looks wrong...?
Andreas
> + /* set to min size */
> + tlb->mas1 &= ~MAS1_TSIZE_MASK;
> + tlb->mas1 |= size_min << (MAS1_TSIZE_SHIFT + 1);
> + }
> +
> if (booke206_tlb_to_page_size(env, tlb) == TARGET_PAGE_SIZE) {
> tlb_flush_page(env, tlb->mas2 & MAS2_EPN_MASK);
> } else {
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-ppc] [PATCH 0/6] Make -cpu e500mc useful in TCG, Alexander Graf, 2012/01/19
- [Qemu-ppc] [PATCH 3/6] PPC: e500: msync is 440 only, e500 has real sync, Alexander Graf, 2012/01/19
- [Qemu-ppc] [PATCH 6/6] PPC: booke206: Implement tlbilx, Alexander Graf, 2012/01/19
- [Qemu-ppc] [PATCH 5/6] PPC: booke206: Check for min/max TLB entry size, Alexander Graf, 2012/01/19
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 5/6] PPC: booke206: Check for min/max TLB entry size,
Andreas Färber <=
- [Qemu-ppc] [PATCH] PPC: booke206: Check for min/max TLB entry size, Alexander Graf, 2012/01/20
- Re: [Qemu-ppc] [PATCH] PPC: booke206: Check for min/max TLB entry size, Scott Wood, 2012/01/20
- Re: [Qemu-ppc] [PATCH] PPC: booke206: Check for min/max TLB entry size, Alexander Graf, 2012/01/20
- Re: [Qemu-ppc] [PATCH] PPC: booke206: Check for min/max TLB entry size, Scott Wood, 2012/01/23
- Re: [Qemu-ppc] [PATCH] PPC: booke206: Check for min/max TLB entry size, Alexander Graf, 2012/01/23
[Qemu-ppc] [PATCH 4/6] PPC: booke206: allow NULL raddr in ppcmas_tlb_check, Alexander Graf, 2012/01/19
[Qemu-ppc] [PATCH 1/6] PPC: Add IVOR 38-42, Alexander Graf, 2012/01/19
[Qemu-ppc] [PATCH 2/6] PPC: e500mc: add missing IVORs to bitmap, Alexander Graf, 2012/01/19