Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
The HMM subsystem exists to support peripherals that have direct access to system memory through their own memory-management units. It allows the ownership of ranges of memory to be passed back and forth and notifies peripherals of changes in memory mappings to keep everything working well together. HMM is not a small or simple subsystem, and bringing it into the kernel has forced a number of low-level memory-management changes. After a multi-year development process, the core HMM code was merged for the 4.14 kernel, despite the lack of any users.
The immediate issue has to do with HMM's use of devm_memremap_pages(), which allows the mapping of pages that exist in device memory. Early versions of HMM used this function before switching to an internal version with some changes. Dan Williams recently posted a patch series adjusting devm_memremap_pages() and changing HMM to use it, getting rid of the duplicated code. That change is not controversial, but one other part of the patch set is: he changed the export declaration of devm_memremap_pages() to EXPORT_SYMBOL_GPL().
There are, of course, two ways to export symbols from the kernel to loadable modules, with and without the _GPL suffix. Symbols exported with that suffix will be unavailable to any module that does not declare a GPL-compatible license. It is a statement that, in the developers' belief, any use of those symbols will necessarily make the module a derived work of the kernel. In this case, the proposed changes will make it harder for proprietary modules to use HMM.
Jérôme Glisse, the author of HMM, is naturally opposed to this change, since it defeats part of the purpose for HMM in the first place. Dave Airlie has also questioned the change, noting that devm_memremap_pages() was exported normally for three years and wondering what has changed:
Williams responded that the initial marking
of the symbol was "an oversight
" that is being corrected now.
In support of the claim that any user of devm_memremap_pages()
must be derived from the kernel, he pointed out that turning on this
remapping capability changes the kernel
fundamentally. The reverse of Airlie's logic also works: if a user of this
functionality was a derived work of the kernel before, the non-GPL status
of the export will not have changed that fact.
Williams further explained the reasoning behind his proposed changes as:
The rest of his message perhaps gets closer to the real source of this particular dispute, though: the fact that there are no in-tree users of the HM functionality.
Glisse has a response to all of these
complaints. HMM, he says, is meant to isolate drivers from core
memory-management internals rather than tying them together. There is a
user now in the form of patches to the
Nouveau driver for NVIDIA
GPUs; he said he hopes to get that code upstream in 4.19. And upstreaming
the pieces, he said, has been "a big chicken and egg
nightmare
" with a lot of independent pieces to prepare together;
that has made it hard to get the users merged along with the infrastructure.
The merging of the Nouveau code, if and when it happens, should resolve the question of whether HMM should be in the kernel at all; it might reopen some questions about specific HMM interfaces, though. The question about the GPL-only export may prove harder to reach a conclusion on, though. There is no easy or objective standard for deciding whether the use of a specific kernel function makes a module into a derived work; it usually comes down to the judgment of the developers who wrote the code in the first place. In this case, those developers are Williams and Christoph Hellwig, who has stated that he is willing to enforce the GPL against users of devm_memremap_pages().
While a case could thus be made for changing the status of this symbol,
it's not at all clear what will actually happen. Either Andrew Morton or
Linus Torvalds will almost certainly end up making the final decision.
It is more clear, though,
that a number of developers are unhappy with the no-users status of HMM in
the kernel. The most likely outcome of this particular episode may end up
being a redoubling of the community's determination not to accept new
subsystems into the kernel until users exist.
| Index entries for this article | |
|---|---|
| Kernel | Copyright issues |
| Kernel | Memory management/Heterogeneous memory management |
Posted Jun 12, 2018 19:45 UTC (Tue)
by compenguy (guest, #25359)
[Link]
And while in the thread they were talking about the way it interacts with kernel internals as being a guide to deciding whether it should be EXPORT_SYMBOL_GPL or not, I think that doesn't align well with a reasonable copyright-informed interpretation.
I feel a better question to guide that decisionmaking might be "To what degree are the concepts and interfaces linux-specific?". This also aligns somewhat with Linus's stance that driver code written for other OSes and ported to Linux doesn't de facto derive from Linux (https://lwn.net/Articles/13398/).
Posted Jun 12, 2018 20:05 UTC (Tue)
by Cyberax (✭ supporter ✭, #52523)
[Link] (6 responses)
After all, GPL enforcement for Linux is MIA.
Posted Jun 13, 2018 12:05 UTC (Wed)
by Funcan (guest, #44209)
[Link] (1 responses)
Posted Jun 13, 2018 17:47 UTC (Wed)
by flussence (guest, #85566)
[Link]
That's how we ended up with the current swamp of proprietary and/or Electron-based software that advertise support for “Linux”, where in practice that usually means “Ubuntu $(($year - 6)), x86-32 only, good luck with anything else”. I don't think making concessions at this point will make that situation go away, unfortunately.
Posted Jun 21, 2018 7:27 UTC (Thu)
by oldtomas (guest, #72579)
[Link] (3 responses)
Tell us something new, will ya?
Posted Jun 21, 2018 10:33 UTC (Thu)
by Wol (subscriber, #4433)
[Link] (1 responses)
The other problem I see - I don't know if it's happening here - is that some people seem to have this need to relabel OTHER PEOPLE'S code as GPL. As far as copyrights and legalities are concerned, this can start to get VERY hairy, VERY fast. If I choose NOT to stick "GPL" on the end of my export, I don't want other people changing it.
Cheers,
Posted Jun 21, 2018 11:06 UTC (Thu)
by anselm (subscriber, #2796)
[Link]
The issue here is that in the kernel, some symbols (variables, functions, …) are marked as OK to use in non-free third-party modules, and a superset of those is marked as OK to use in GPL third-party modules. Sometimes it turns out that someone working on a non-free third-party module would really love to use one of the symbols that are only available to GPL modules. Since the only thing standing between such a developer and using the symbol is the missing EXPORT_SYMBOL_GPL declaration, Cyberax suggests that such a developer should go right ahead and relabel the symbol in their copy of the kernel, because nobody cares enough to police that sort of thing.
Personally I think if you do something like that and it comes out, as it inevitably will sooner or later, that will certainly not make you popular in the Linux kernel community. Whether that is an actual problem as far as you're concerned is for you to decide.
Posted Jun 21, 2018 11:00 UTC (Thu)
by Cyberax (✭ supporter ✭, #52523)
[Link]
The VMWare suit has shown us that GPL is pretty much unenforceable. That’s why I think that Apache-style licenses are,way better.
Posted Jun 13, 2018 1:37 UTC (Wed)
by unixbhaskar (guest, #44758)
[Link] (1 responses)
Posted Jun 13, 2018 11:51 UTC (Wed)
by robclark (subscriber, #74945)
[Link]
Posted Jun 17, 2018 3:27 UTC (Sun)
by benh (subscriber, #43720)
[Link]
Posted Nov 12, 2018 16:12 UTC (Mon)
by fxkuehl (guest, #128016)
[Link]
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Wol
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
Heterogeneous memory management meets EXPORT_SYMBOL_GPL()
