Skip to content

Commit

Permalink
fix: add 640th KiB to the available memory
Browse files Browse the repository at this point in the history
As described in the issue #3044 FC was only announcing 639 KiB
as the first memory region available to the guest.

This commit fixes it by replacing `EBDA_START` value with `EBDA_END`
`EBDA_END` marks the end of the EBDA region and first memory region (640 KiB)

Signed-off-by: Egor Lazarchuk <[email protected]>
  • Loading branch information
ShadowCurse committed Oct 2, 2023
1 parent 2557b17 commit 5f4811f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/vmm/src/arch/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ pub enum ConfigurationError {
InitrdAddress,
}

// Where BIOS/VGA magic would live on a real PC.
const EBDA_START: u64 = 0x9fc00;
// EBDA is located in the last 1 KiB from 0x9FC00 - 0x9FFFF
// This values is used to mark first 0x0 - EBDA_END region
// of usable memory to the guest.
const EBDA_END: u64 = 0xa0000;
const FIRST_ADDR_PAST_32BITS: u64 = 1 << 32;
/// Size of MMIO gap at top of 32-bit address space.
pub const MEM_32BIT_GAP_SIZE: u64 = 768 << 20;
Expand Down Expand Up @@ -134,7 +136,7 @@ pub fn configure_system(
params.hdr.ramdisk_size = initrd_config.size as u32;
}

add_e820_entry(&mut params, 0, EBDA_START, E820_RAM)?;
add_e820_entry(&mut params, 0, EBDA_END, E820_RAM)?;

let last_addr = guest_mem.last_addr();
if last_addr < end_32bit_gap_start {
Expand Down

0 comments on commit 5f4811f

Please sign in to comment.