[OpenBIOS] [RFC v2] ppc: SDR1 fixes

Andreas Färber andreas.faerber at web.de
Sun Nov 21 14:44:25 CET 2010


Am 21.11.2010 um 01:24 schrieb Andreas Färber:

> Am 21.11.2010 um 01:10 schrieb Segher Boessenkool:
>
>>> Signed-off-by: Andreas Färber <andreas.faerber at web.de>
>>
>> Acked-by: Segher Boessenkool <segher at kernel.crashing.org>
>>
>> But one change please...
>>
>>> +#ifdef __powerpc64__
>>> +    return 1UL << (sdr1 & 0x1f);
>>> +#else
>>> +    return (((sdr1 & 0x1ff) << 10) | 0x3ff) + 1;
>>> +#endif
>>
>> ((sdr1 & 0x1ff) + 1) << 10
>>
>> looks a bit less silly :-)
>>
>> I'm not sure you got the size calculations right, but let's assume
>> you tested it :-)
>
> I'm not sure either, since my testing - as stated - breaks ppc.  
> Haven't debugged into ppc64 yet.
>
> I was hoping someone spots an obvious error, because if my code were  
> correct it would mean a bug hidden somewhere in QEMU... :-/

It turned out that on ppc my SDR1 shifts by 10 don't work despite the  
manual mentioning that number, with original 16 it works for whatever  
reason. (Alex, you don't happen to know why, do you? I peeked at  
target-ppc/helper.c without spotting something obvious.)

ppc64 needs the slbmte patch first for testing (0x700 otherwise).  
HASH_BITS likely should be 16 instead of 15 since 2 was shifted, not 1.

Andreas


More information about the OpenBIOS mailing list