On 05/04/13 02:23, Artyom Tarasenko wrote:
>> That's interesting. You're asking for a page size (0x2000) on a non-page
>> boundary (0xffc6.5000). The complaint is because it extends far enough to
>> overlap with what the map_page_range above (0xffc6.6000).
>
> Yes. After looking more carefully I think it goes wrong before this point:
>
> OFMEM: ofmem_claim phys=ffffffffffffffff size=00001000 align=00001000
> OFMEM: ofmem_claim_virt virt=00000000 size=00001000 align=00001000
> OFMEM: ofmem_map_page_range ffc7f000 -> 006f7f000 00001000 mode 000000bc
> OFMEM: ofmem_claim phys=ffffffffffffffff size=00001000 align=00001000
> OFMEM: ofmem_claim_virt virt=00000000 size=00001000 align=00001000
> OFMEM: ofmem_map_page_range ffc7e000 -> 006f7e000 00001000 mode 000000bc
> OFMEM: ofmem_claim phys=ffffffffffffffff size=00001000 align=00001000
> OFMEM: ofmem_claim_virt virt=00000000 size=00001000 align=00001000
> OFMEM: ofmem_map_page_range ffc7d000 -> 006f7d000 00001000 mode 000000bc
> OFMEM: ofmem_claim phys=ffffffffffffffff size=00014000 align=00020000
> OFMEM: ofmem_claim_virt virt=00000000 size=00014000 align=00014000
> OFMEM: bad alignment 81920
>
> ^^^ here is something OpenBIOS doesn't like.
Ah yes. Since in the case where va == NULL we've set align = size, we
still need to round align to the nearest power of 2. Does the attached
patch help at all?
Note that this is just a proof-of-concept patch. Since the specification
is quite clear about this behaviour, if it works then I'll move the
power of 2 rounding directly into OFMEM so cases like this are handled
automatically.
ATB,
Mark.