Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read unmapped address when reload SPEC CPU2017 elfie files #10

Open
meditates opened this issue Mar 8, 2024 · 4 comments
Open

read unmapped address when reload SPEC CPU2017 elfie files #10

meditates opened this issue Mar 8, 2024 · 4 comments

Comments

@meditates
Copy link

I am trying to load the elfies files with gem5 released on https://looppoint.github.io/hpca2023/
The bwaves elfies could all run with Gem5, but for wrf elfies, only the first region can successfully finish running. The others have unmapped address problems.

This is the error output when I run the wrf region 2 elfie.
src/arch/x86/faults.cc:169: panic: Tried to read unmapped address 0x8.
PC: (0x15098e0b40d6=>0x15098e0b40da).(0=>1), Instr: MOV_R_M : ld rdi, DS:[rax + 0x8]
Memory Usage: 35694380 KBytes
Program aborted at tick 55477801332

I have used update vm.max_map_count in /etc/sysctl.conf and then sudo sysctl -p I tried both values of 2097152 and 33554432

I have tried to increase the max stack size in gem5, but it still does not work.
vi gem5/src/sim/syscall_emul.hh
line 2055,2098 8 * 1024 * 1024 to 64 * 1024 * 1024
vi gem5/src/arch/x86/process.cc
line 115 8 * 1024 * 1024 to 64 * 1024 * 1024

Any suggestions? Thanks a lot!

@alenks
Copy link
Contributor

alenks commented Mar 9, 2024

Hi @powerjg, can you please help us with this issue?

@William-An
Copy link

I have also encountered this unmapped address with SPEC 2017 when using looppoint + pinball2elf. It looks like the page count in the ELFie startup code section pbs.remap_page does not match with the actual page count in the created ELFie image.

@powerjg
Copy link

powerjg commented May 13, 2024

cc @studyztp

@William-An
Copy link

William-An commented May 15, 2024

In my case the problem looks like it is associated with the lte_memimg_t::compact() function in lte_memimg.cpp. The relevant code snippet is in line 247-255:

  for(lte_mempage_t* p = head; p; p = (lte_mempage_t*)p->next)
  {
     p->offs = offs = p->va - head->va;
     p->head = head;
     p->region_next = NULL;
     p->region_size = LTE_PAGE_SIZE;
  }
  head->region_next = region_next;
  head->region_size = offs + LTE_PAGE_SIZE;

The compaction code will create holes between pages. When compacting regions, they might not necessarily be adjacent as they would have when combining pages, which is tested with the can_combine_pages function. These extra holes is not reflected with the entrypoint startup code as compaction is done after hardcoding the startup function about the page count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants