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

Vancouver fails to allocate guest memory #519

Closed
parthy opened this issue Nov 26, 2012 · 12 comments
Closed

Vancouver fails to allocate guest memory #519

parthy opened this issue Nov 26, 2012 · 12 comments
Assignees

Comments

@parthy
Copy link
Contributor

parthy commented Nov 26, 2012

I get

Not enough space (0x3789000) left for VMM, VM image to large

when starting my modified Vancouver. This problem used to be possible to handle by fiddling with the _initial_junk size or by commenting out exception handling sections in Vancouver. But with the most recent master branch, I cannot get it to work anymore. Is there any quickfix I can try?

@alex-ab
Copy link
Member

alex-ab commented Nov 26, 2012

Check out only until 5e66b6d of master. I presume I know what went wrong, I will investigate.

@ghost ghost assigned alex-ab Nov 26, 2012
@alex-ab alex-ab closed this as completed Nov 27, 2012
alex-ab added a commit that referenced this issue Mar 18, 2013
It's not guaranteed to be robust and will break in the future - I told you.

Related to issue #365, issue #519, issue #666
@alex-ab
Copy link
Member

alex-ab commented Aug 9, 2013

Running 64bit Seoul/Vancouver results in:

[init -> fb_drv] Found: VESA BIOS version 3.0
[init -> fb_drv] OEM: NVIDIA
[init -> fb_drv] Found: physical frame buffer at 0xd9000000 size: 0x00e00000
[init -> fb_drv] int Framebuffer_drv::map_io_mem(Genode::addr_t, Genode::size_t, bool, void**, Genode::addr_t, Genode::Dataspace_capability*): fb mapped to 1800000
[init -> fb_drv] Framebuffer::Session_component::Session_component(unsigned int, unsigned int, unsigned int, Genode::Dataspace_capability, bool): use buf size 1572864
[init -> fb_drv] using buffered output
[init -> nitpicker] framebuffer is 1024x768@1
[init] child "nitpicker" announces service "Nitpicker"
[init -> nitpicker] create session with args: fb_format=1, label="launchpad", ram_quota=1646592
[init -> nitpicker] Could not open file "config"
[init -> nitpicker] Could not obtain config file
[init -> nitpicker] create session with args: fb_width=400, fb_height=1504, fb_format=1, label="launchpad", ram_quota=1211392
[init -> launchpad] --- entering main loop --
[init -> launchpad] starting init with quota 301989888
[init -> launchpad] using unique child name "init"
[init -> launchpad -> init] Could not open file "ld.lib.so"
[init -> launchpad -> init -> vancouver] C++ runtime: Genode::Rm_session::Region_conflict
[init -> launchpad -> init -> vancouver] void* abort(): abort called

I like this bug. Really!

It will not disappear. I hate to cite myself (from commit above):

vmm: try to reserve lower virtual address space
It's not guaranteed to be robust and will break in the future - I told you.

The reason is that on 64bit somebody already attached a region of size 0x8000 to the low virtual address space region. All kind of attempts so far to reserve the region during startup are already to late, the mapping is just there.

@alex-ab alex-ab reopened this Aug 9, 2013
@parthy
Copy link
Contributor Author

parthy commented Aug 9, 2013

I can confirm this, I hit this again too lately. I get it on 32bit as well. The trick you told me (increasing the initial_heap size) helps in the 32bit case, but not for 64bit. So if you want me to test something on my diva machine, just tell me ;) Last year I also noticed that not having a try-catch-block in the main function sometimes helped. So could this be exception-handling related?

@alex-ab
Copy link
Member

alex-ab commented Aug 9, 2013

@parthy: can you please try the commit above ?

@parthy
Copy link
Contributor Author

parthy commented Aug 9, 2013

There is no region conflict anymore, but I don't get output from Vancouver. I can see the framebuffer session being created, but then nothing happens anymore. So apparently the guest_memory creation fails...

@alex-ab
Copy link
Member

alex-ab commented Aug 9, 2013

Right. On my serial output I get:

device: intel82576vf
[init -> launchpad -> init -> vancouver] configuration error: device model 'intel82576vf' does not exist
[init -> launchpad -> init -> vancouver] C++ runtime: Machine::Config_error
[init -> launchpad -> init -> vancouver] void* abort(): abort called

So, apparently I have to take this model from the VMM configuration since it does not work on 64bit

@alex-ab
Copy link
Member

alex-ab commented Aug 12, 2013

I enabled the intel82576 model for 64bit hosts. Now I get (when using r3_debug):

[init -> launchpad -> init -> vancouver] VMM: Attached 82576VF model at f7ce0000+0x4000, f7cc0000+0x1000
[init -> launchpad -> init -> vancouver] 
[init -> launchpad -> init -> vancouver] --- Booting VM ---
[init -> launchpad -> init -> vancouver] VMM: RESET device state
[init -> launchpad -> init -> vancouver] VMM: MessageLegacy::RESET requested
[init -> launchpad -> init -> vancouver] VMM: INIT done
[init -> launchpad -> init -> vancouver] VMM: reset CPU from 9 mtr_in e0010
[init -> launchpad -> init -> vancouver] VMM: receive() line 273: 'needed_len > r->length' error = 1VMM:  WRITE no idea how to increase the table ebda size from 5120 to 8192VMM: 
[init -> launchpad -> init -> vancouver] VMM: > bool VirtualBiosMultiboot::receive(MessageBios&) rip ffff ilen 0 cr0 10 efl 2
[init -> launchpad -> init -> vancouver] VMM:   module 0 start 11800000+1000 cmdline munich
[init -> launchpad -> init -> vancouver] VMM:   module 1 start 11802000+1c7000 cmdline bzImage-3.1 root=/dev/ram0 earlyprintk=ttyS0 vga=0x314
[init -> launchpad -> init -> vancouver] VMM: Hello, this is the network receiver.
[init -> launchpad -> init -> vancouver] VMM:   module 2 start 119ca000+2bad000 cmdline tc-browser.gz
[ 0] Killed EC:0xffffffff830c3a00 SC:0xffffffff830ec040 V:0x30 CR0:0x11 CR3:0x0 CR4:0x0 (vTLB addressing limit exceeded)

@parthy
Copy link
Contributor Author

parthy commented Aug 12, 2013

Looks familiar :) See here: TUD-OS/NRE#33

@alex-ab
Copy link
Member

alex-ab commented Aug 12, 2013

Ok. I rebased all our stuff to the the latest commit of the vanilla kernel (using https://github.com/alex-ab/NOVA/tree/staging_genode) and now the 64bit seoul-fancy stuff works for me.

@parthy
Copy link
Contributor Author

parthy commented Aug 12, 2013

Great, I will give it a spin later today.

@parthy
Copy link
Contributor Author

parthy commented Aug 12, 2013

Yep, that works.

alex-ab added a commit that referenced this issue Aug 13, 2013
At least 64bit Seoul dies with Region_conflict reliable and reproducible.

When during startup of Seoul some Genode code (caused by executing some
constructors) try to attach a region, the region manager code in the rm_session
will try to place the attachment at the smallest large enough aligned free
virtual region.

For now, I observed one attachment causing trouble (but not knowing who causes
this - it does also not really matter). The questionable region is 0x4000 of
size for 32bit and 0x8000 of size for 64bit.

To steer the region manager a bit, we try now following trick:

With this commit the load address of the binary for 32 and 64 bit is moved
close to the end of the virtual address space, but leaving enough free virtual
space for the above observed attachment (and a bit more).

The region manager code now will try to fill up the virtual region behind
the binary up to the end of the virtual address space, effectively letting the
lower virtual region untouched - hopefully.

Works for now, but it will break again - for sure.

Fixes #519
@alex-ab
Copy link
Member

alex-ab commented Aug 13, 2013

Thank you for testing. Everything is now on genode/staging and r3 kernel branch is updated accordingly.

alex-ab added a commit that referenced this issue Aug 13, 2013
At least 64bit Seoul dies with Region_conflict reliable and reproducible.

When during startup of Seoul some Genode code (caused by executing some
constructors) try to attach a region, the region manager code in the rm_session
will try to place the attachment at the smallest large enough aligned free
virtual region.

For now, I observed one attachment causing trouble (but not knowing who causes
this - it does also not really matter). The questionable region is 0x4000 of
size for 32bit and 0x8000 of size for 64bit.

To steer the region manager a bit, we try now following trick:

With this commit the load address of the binary for 32 and 64 bit is moved
close to the end of the virtual address space, but leaving enough free virtual
space for the above observed attachment (and a bit more).

The region manager code now will try to fill up the virtual region behind
the binary up to the end of the virtual address space, effectively letting the
lower virtual region untouched - hopefully.

Works for now, but it will break again - for sure.

Fixes #519
nfeske pushed a commit to nfeske/genode that referenced this issue Aug 14, 2013
At least 64bit Seoul dies with Region_conflict reliable and reproducible.

When during startup of Seoul some Genode code (caused by executing some
constructors) try to attach a region, the region manager code in the rm_session
will try to place the attachment at the smallest large enough aligned free
virtual region.

For now, I observed one attachment causing trouble (but not knowing who causes
this - it does also not really matter). The questionable region is 0x4000 of
size for 32bit and 0x8000 of size for 64bit.

To steer the region manager a bit, we try now following trick:

With this commit the load address of the binary for 32 and 64 bit is moved
close to the end of the virtual address space, but leaving enough free virtual
space for the above observed attachment (and a bit more).

The region manager code now will try to fill up the virtual region behind
the binary up to the end of the virtual address space, effectively letting the
lower virtual region untouched - hopefully.

Works for now, but it will break again - for sure.

Fixes genodelabs#519
cproc pushed a commit to cproc/genode that referenced this issue May 12, 2014
cproc pushed a commit to cproc/genode that referenced this issue May 12, 2014
It's not guaranteed to be robust and will break in the future - I told you.

Related to issue genodelabs#365, issue genodelabs#519, issue genodelabs#666
cproc pushed a commit to cproc/genode that referenced this issue May 12, 2014
At least 64bit Seoul dies with Region_conflict reliable and reproducible.

When during startup of Seoul some Genode code (caused by executing some
constructors) try to attach a region, the region manager code in the rm_session
will try to place the attachment at the smallest large enough aligned free
virtual region.

For now, I observed one attachment causing trouble (but not knowing who causes
this - it does also not really matter). The questionable region is 0x4000 of
size for 32bit and 0x8000 of size for 64bit.

To steer the region manager a bit, we try now following trick:

With this commit the load address of the binary for 32 and 64 bit is moved
close to the end of the virtual address space, but leaving enough free virtual
space for the above observed attachment (and a bit more).

The region manager code now will try to fill up the virtual region behind
the binary up to the end of the virtual address space, effectively letting the
lower virtual region untouched - hopefully.

Works for now, but it will break again - for sure.

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

No branches or pull requests

2 participants