On Tue, 2019-07-30 at 14:30 -0700, James Bottomley wrote: > On Tue, 2019-07-30 at 22:58 +0200, Helge Deller wrote: > > PALO version 2.10 was released last week, but it has a bug > > which may prevent that you are able to boot your kernels: > > > > Entry 000e0000 first 000e0000 n 2 > > Segment 0 load 000e0000 size 8249207 mediaptr 0x1000 > > Abort: Would overwrite palo 00060000-000f8e30 or data 3faef580 > > areas. > > ERROR: failed to load kernel > > Ah, that's unfortunate. It must be an artifact of compressed kernels > because my uncompressed one boots here: > > Entry 00100000 first 00100000 n 5 > Segment 0 load 00100000 size 508616 mediaptr 0x1000 > Segment 1 load 0017d000 size 370864 mediaptr 0x7e000 > Segment 2 load 00200000 size 12026224 mediaptr 0xd9000 > Segment 3 load 00d79000 size 3850884 mediaptr 0xc52000 > Segment 4 load 01200000 size 2690120 mediaptr 0xfff000 > Loading ramdisk 24263780 bytes @ 3e8ca000... > > which would be why I never saw this. This is what I'm currently testing as the fix; it reduces the bss from 6 .bss 0008d8b0 0006b580 0006b580 0000b5f8 2**6 ALLOC To 6 .bss 0003d8b0 0006b600 0006b600 0000b654 2**6 ALLOC Which will get us under 0x000e0000 assuming that's the lowest address a kernel can be loaded at ... James --- diff --git a/ipl/ext2.c b/ipl/ext2.c index 31b8469..d8b0c2f 100644 --- a/ipl/ext2.c +++ b/ipl/ext2.c @@ -475,17 +475,25 @@ static int ext3_extent_node_find(struct ext2_inode *ip, static int ext3_extent_load_find(struct ext2_inode *ip, int leaf, int d, int blkoff) { - static char blockbuf[EXTENT_MAX_DEPTH][EXT2_MAX_BLOCK_SIZE]; + static char *blockbuf; static int cached_blockno[EXTENT_MAX_DEPTH]; struct ext3_extent_header *hdr; - hdr = (struct ext3_extent_header *)blockbuf[d]; + if (!blockbuf) { + blockbuf = malloc(EXTENT_MAX_DEPTH*EXT2_MAX_BLOCK_SIZE); + if (!blockbuf) { + printf("Failed to allocate memory for block buffer\n"); + return -1; + } + } + + hdr = (struct ext3_extent_header *)&blockbuf[d * EXT2_MAX_BLOCK_SIZE]; if (cached_blockno[d] != leaf) { printf("load extent tree[%d] block at %d\n", d, leaf); - if (cons_read(dev, blockbuf[d], sizeof(blockbuf[d]), + if (cons_read(dev, hdr, EXT2_MAX_BLOCK_SIZE, leaf * ext2_blocksize) != - sizeof(blockbuf[d])) { + EXT2_MAX_BLOCK_SIZE) { printf("ext3_extent_load_find: read error\n"); return -1; } @@ -504,7 +512,7 @@ static int ext3_extent_load_find(struct ext2_inode *ip, int leaf, int d, return -1; } if (sizeof(hdr) + sizeof(struct ext3_extent)*hdr->eh_entries > - sizeof(blockbuf[d])) { + EXT2_MAX_BLOCK_SIZE) { printf("ext3_extent_load_find: extent is larger than buffer\n"); return -1; }