Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 432884 - app-emulation/virtualbox-modules: undeclared 'VM_RESERVED'
Summary: app-emulation/virtualbox-modules: undeclared 'VM_RESERVED'
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
Depends on:
Reported: 2012-08-26 16:55 UTC by Arvydas Sidorenko
Modified: 2013-10-03 22:10 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---

The fix (0001-VM_RESERVED-flag-got-removed.patch,1.46 KB, patch)
2012-08-26 16:55 UTC, Arvydas Sidorenko
Details | Diff
VM_RESERVED replaced by (VM_DONTEXPAND | VM_DONTDUMP (vm_reserved.patch,572 bytes, patch)
2012-12-12 09:56 UTC, Kent Hagebrand
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arvydas Sidorenko 2012-08-26 16:55:09 UTC
app-emulation/virtualbox-modules does not build on linux-next because VM_RESERVED flag got removed from include/linux/mm.h
To achieve same behavior a combination of `VM_DONTEXPAND | VM_DONTDUMP` could be used. I have attached a patch which does exactly that.

Reproducible: Always
Comment 1 Arvydas Sidorenko 2012-08-26 16:55:54 UTC
Created attachment 322300 [details, diff]
The fix
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2012-08-26 17:26:04 UTC
This probably needs to be sent upstream instead
Comment 3 Arvydas Sidorenko 2012-08-26 21:53:38 UTC
Probably but trying to open gives me: 
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/", line 436, in send_error
    data, 'text/html')
  File "/usr/lib/python2.4/site-packages/trac/web/", line 803, in render_template
    message = req.session.pop('chrome.%s.%d' % (type_, i))
  File "/usr/lib/python2.4/site-packages/trac/web/", line 212, in __getattr__

So I post a patch here in case someone faces the same problem.
Comment 4 Arvydas Sidorenko 2012-08-26 21:55:38 UTC
And overall I cannot find a public repository virtualbox-modules are developed in. Anyone knows?
Comment 5 Magnus Helmersson 2012-10-19 09:17:26 UTC
The removal of the VM_RESERVED flag has now been merged into v3.7-rc1. So this issue now applies to git-sources-3.7-rc1 as well.
Comment 6 Kent Hagebrand 2012-12-12 09:56:31 UTC
Created attachment 332100 [details, diff]

In kernel 3.7, the flag VM_RESERVED is removed, and should be replaced by (VM_DONTEXPAND | VM_DONTDUMP).
Comment 7 Kent Hagebrand 2012-12-12 10:06:31 UTC
Or you could make a more "official" patch from vbox changeset 43637.
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-12-16 19:42:18 UTC
The linked upstream patch is already included in the latest 4.2.4 version, however it still doesn't work. Please include the patch in attachment, or modify the conditional checks to check "#ifdef VM_RESERVED" before using it.
Comment 9 Trevor Jones 2013-01-24 15:45:20 UTC
I found the cause of this for me at least.
I use upstream kernel kept updated using git.  It looks like for 3.7 include/linux/version.h stopped getting generated so I had a stale file causing the macro in the virtualbox-modules sources to think I had a pre 3.7 kernel.
'make mrproper' does not remove the version.h file.
I manually removed it and rebuilt the 3.7 kernel.  The file was not regenerated. I was then able to compile virtualbox-modules without issue.

Looks like upstream kernel commit da01ee3c8e7954fb7ed0ceb002d482c79f8b2ccd will resolve this for everyone using git to pull the kernel, but is not currently in the 3.7 stable tree.;a=commit;h=da01ee3c8e7954fb7ed0ceb002d482c79f8b2ccd
Comment 10 Bjoern Rennhak 2013-04-13 17:45:41 UTC
Trevor's answer was spot on for me as well. Thanks.
Comment 11 Johannes Buchner 2013-09-14 14:33:45 UTC
I don't use a git kernel. But deleting include/linux/version.h in the build directory allowed me to emerge both app-emulation/virtualbox-modules-4.2.16 and app-emulation/virtualbox-modules-4.2.18.
Comment 12 Markos Chandras (RETIRED) gentoo-dev 2013-09-14 17:03:13 UTC
Is this still a problem with 4.2.18?
Comment 13 Ben Kohler gentoo-dev 2013-10-03 22:10:21 UTC
This is fixed in all versions still in the tree:


                    vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
                    vma->vm_flags |= VM_RESERVED;