Skip to content

Linux mode mem dumps do not contain all physical memory #219

@jasocrow

Description

@jasocrow

I plan to submit a PR for this at some point, but not sure when I'll be able to get it out.

You can see via the output below that the physical memory range for the target VM is from 0 to 0x1bfffffff. However, the Linux mode mem dump code only saves from 0 to 0xffffffff.

When dumping mem via pmemsave, pmemsave has a size limitation, only allowing a max size of 0xffffffff. So fixing the issue requires calling pmemsave multiple times.

root@linux:~# cat /proc/iomem
00000000-00000fff : Reserved
00001000-0009fbff : System RAM
0009fc00-0009ffff : Reserved
000a0000-000bffff : PCI Bus 0000:00
000c0000-000c99ff : Video ROM
000ca000-000cadff : Adapter ROM
000cb000-000cb5ff : Adapter ROM
000f0000-000fffff : Reserved
  000f0000-000fffff : System ROM
00100000-bffdffff : System RAM
  01000000-021fffff : Kernel code
  02200000-02890fff : Kernel rodata
  02a00000-02cba3ff : Kernel data
  034c9000-035fffff : Kernel bss
bffe0000-bfffffff : Reserved
c0000000-febfffff : PCI Bus 0000:00
  fd000000-fdffffff : 0000:00:02.0
  feb80000-febbffff : 0000:00:03.0
  febc0000-febdffff : 0000:00:03.0
    febc0000-febdffff : e1000
  febf0000-febf0fff : 0000:00:02.0
fed00000-fed003ff : HPET 0
  fed00000-fed003ff : PNP0103:00
feffc000-feffffff : Reserved
fffc0000-ffffffff : Reserved
100000000-13fffffff : System RAM
  13fff0000-13fff03ff : IOAPIC 0
140000000-1bfffffff : PCI Bus 0000:00

This issue can cause inexplicable page faults, e.g.,

bochshooks: PhyAccessHook: Access 8 bytes to GPA 0x210ddefe0.
bochshooks: PhyAccessHook: Access 8 bytes to GPA 0x43fff2000.
wtf: cabi/mem-cabi.cc:34: static bool BX_MEM_C::dbg_fetch_mem(BX_CPU_C*, bx_phy_address, unsigned int, Bit8u*): Assertion `false' failed.
Aborted (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions