[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] Please have a look at my attempted slbfee code

From: Alexander Graf
Subject: Re: [Qemu-ppc] Please have a look at my attempted slbfee code
Date: Fri, 29 Jun 2012 12:53:13 +0200

On 22.06.2012, at 08:46, Michael Sabino wrote:


I am trying to implement the slbfee instruction in agraf's AIX tree for AIX boot on qemu-system-ppc64. AIX appears to require this instruction. One important aspect of the slbfee function is to be able to search through the SLB and find a matching entry based on an Entry address/ESID. I am doing this in helper.c through the ppc_find_slb function. Please provide some input on whether this function looks valid, or provide me with some direction to work on this code some more.

Please send patches for review. It makes it a lot easier really. Also when you have a patch, throw it through checkpatch.pl to get warnings on where the patch doesn't look nice ;). The nicer (following patterns) a patch looks, the easier it is to review.

So for this round, I'll only comment on semantic concerns. But please do follow the normal patch submission procedures, even when you don't think the patch is ready to apply it yet:


Michael Sabino


int ppc_find_slb (CPUPPCState *env, target_ulong ea, target_ulong *flagg)

Missing the translate part. I assume that ea would be gpr[RB]? What is flagg?


int index = 0; // index initialized outside of for loop as per C99+ standards
target_ulong mask1 = 0xffffffffffffffff; // mask for determining active segment
int bitset = (int)log2(SLB_VSID_B_1T); // VSID for 1TB segments. Calculate logarithm to get bit position of set bit.

target_ulong mask2 = mask1 >> bitset; // move mask over to set bit, selecting segment
target_ulong ea2 = ea & mask2;

The mask is slb entry specific.

printf("--MASK2-- %llu --MASK2--",mask2);
for (; (index < 64) && (*flagg != 0); index++)

You can't rely on the SLB being 64 entries big.

        printf("SLB %d ESID: %llu",index,env->slb[index].esid);
//        if (slb->vsid != NULL)
        if (env->slb[index].esid == ea2)
                {*flagg = 1;
                printf("\nSLB Match!\n");}

You probably need to set gpr[RT] somehow, no?



return 0;


Thanks again,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]