summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/scripts
diff options
context:
space:
mode:
authorMichael Brown2016-02-12 14:59:06 +0100
committerMichael Brown2016-02-12 15:04:51 +0100
commit7ecfe7159f94193a666200a17057d4cd5981b850 (patch)
tree79231c567dccb649c55bd28d7ebc0679d5c8531f /src/arch/i386/scripts
parent[intel] Add INTEL_NO_PHY_RST for another I218-LM variant (diff)
downloadipxe-7ecfe7159f94193a666200a17057d4cd5981b850.tar.gz
ipxe-7ecfe7159f94193a666200a17057d4cd5981b850.tar.xz
ipxe-7ecfe7159f94193a666200a17057d4cd5981b850.zip
[prefix] Pad .text16 and .data16 segment sizes at build time
Commit c64747d ("[librm] Speed up real-to-protected mode transition under KVM") rounded down the .text16 segment address calculated in alloc_basemem() to a multiple of 64 bytes in order to speed up mode transitions under KVM. This creates a potential discrepancy between alloc_basemem() and free_basemem(), meaning that free_basemem() may free less memory than was allocated by alloc_basemem(). Fix by padding the calculated sizes of both .text16 and .data16 to a multiple of 64 bytes at build time. Debugged-by: Yossef Efraim <yossefe@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/scripts')
-rw-r--r--src/arch/i386/scripts/i386.lds4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds
index 38c89e14..865591ae 100644
--- a/src/arch/i386/scripts/i386.lds
+++ b/src/arch/i386/scripts/i386.lds
@@ -247,8 +247,8 @@ SECTIONS {
* Values calculated to save code from doing it
*
*/
- _text16_memsz_pgh = ( ( _text16_memsz + 15 ) / 16 );
- _data16_memsz_pgh = ( ( _data16_memsz + 15 ) / 16 );
+ _text16_memsz_ppgh = ( ( ( _text16_memsz + 63 ) / 64 ) * 4 );
+ _data16_memsz_ppgh = ( ( ( _data16_memsz + 63 ) / 64 ) * 4 );
_textdata_memsz_pgh = ( ( _textdata_memsz + 15 ) / 16 );
_textdata_memsz_kb = ( ( _textdata_memsz + 1023 ) / 1024 );
}