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>tags/v1.20.1
|
|
||
| 558 |
|
558 |
|
| 559 |
|
559 |
|
| 560 |
|
560 |
|
| 561 |
|
|
|
|
561 |
|
|
| 562 |
|
562 |
|
| 563 |
|
563 |
|
| 564 |
|
|
|
| 565 |
|
|
|
| 566 |
|
|
|
| 567 |
|
|
|
| 568 |
|
|
|
|
564 |
|
|
|
565 |
|
|
| 569 |
|
566 |
|
| 570 |
|
567 |
|
| 571 |
|
568 |
|
|
|
||
| 616 |
|
613 |
|
| 617 |
|
614 |
|
| 618 |
|
615 |
|
| 619 |
|
|
|
| 620 |
|
|
|
|
616 |
|
|
|
617 |
|
|
| 621 |
|
618 |
|
| 622 |
|
619 |
|
| 623 |
|
620 |
|
|
|
||
| 247 |
|
247 |
|
| 248 |
|
248 |
|
| 249 |
|
249 |
|
| 250 |
|
|
|
| 251 |
|
|
|
|
250 |
|
|
|
251 |
|
|
| 252 |
|
252 |
|
| 253 |
|
253 |
|
| 254 |
|
254 |
|