diff options
author | Michael Brown | 2016-02-18 03:58:03 +0100 |
---|---|---|
committer | Michael Brown | 2016-02-18 14:37:36 +0100 |
commit | 4e4727079b718a8c0c62629f7d0df2f492074853 (patch) | |
tree | a657ff70f3f5559cd6f4eedd9d80969e5f9ffc00 /src/arch/x86/prefix | |
parent | [prefix] Align INT 15,88 temporary decompression area to a page boundary (diff) | |
download | ipxe-4e4727079b718a8c0c62629f7d0df2f492074853.tar.gz ipxe-4e4727079b718a8c0c62629f7d0df2f492074853.tar.xz ipxe-4e4727079b718a8c0c62629f7d0df2f492074853.zip |
[romprefix] Align PMM temporary decompression area to a page boundary
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/prefix')
-rw-r--r-- | src/arch/x86/prefix/romprefix.S | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/arch/x86/prefix/romprefix.S b/src/arch/x86/prefix/romprefix.S index 57eb31af..287a986c 100644 --- a/src/arch/x86/prefix/romprefix.S +++ b/src/arch/x86/prefix/romprefix.S @@ -402,19 +402,22 @@ pmm_scan: /* Shrink ROM */ movb shrunk_rom_size, %al movb %al, romheader_size -1: /* Allocate decompression PMM block. Round up the size to the - * nearest 128kB and use the size within the PMM handle; this - * allows the same decompression area to be shared between - * multiple iPXE ROMs even with differing build IDs +1: /* Allocate decompression PMM block. Allow 4kB for page + * alignment and round up the size to the nearest 128kB, then + * use the size within the PMM handle; this allows the same + * decompression area to be shared between multiple iPXE ROMs + * even with differing build IDs */ movl $_textdata_memsz_pgh, %ecx - addl $0x00001fff, %ecx - andl $0xffffe000, %ecx + addl $( 0x00000100 /* 4kB */ + 0x00001fff /* 128kB - 1 */ ), %ecx + andl $( 0xffffe000 /* ~( 128kB - 1 ) */ ), %ecx movl %ecx, %ebx shrw $12, %bx orl $PMM_HANDLE_BASE_DECOMPRESS_TO, %ebx movw $get_pmm_decompress_to, %bp call get_pmm + addl $( 0x00000fff /* 4kB - 1 */ ), %esi + andl $( 0xfffff000 /* ~( 4kB - 1 ) */ ), %esi movl %esi, decompress_to /* Restore registers */ popal |