Skip to contentSkip to conversation

EXPORT_SYMBOL_GPL(paravirt_ops);

DISCUSSION Jeremy Fitzhardinge 5 participants 8 messages Aug 10, 2006 – Aug 13, 2006 virtio core

lore
Share & tools
lore
#0 lore raw

This pretty much has to be EXPORT_SYMBOL(), otherwise we just required all modules to be GPL...

J

#1 lore raw
Quoted 2 lines · * Jeremy Fitzhardinge ([email protected]) wrote:

This pretty much has to be EXPORT_SYMBOL(), otherwise we just required all modules to be GPL...

muwhahaha

The plan is working...

Yeah, I agree. We had to do similar for LSM.

thanks,
-chris

#2 lore raw
Quoted 6 lines · Chris Wright
Quoted 3 lines · * Jeremy Fitzhardinge ([email protected]) wrote:

This pretty much has to be EXPORT_SYMBOL(), otherwise we just required all modules to be GPL...

Quoted 10 lines

muwhahaha

The plan is working...

Yeah, I agree. We had to do similar for LSM.

thanks,
-chris

EXPORT_SYMBOL_GPL is still possible - if you patch over every op in paravirt_ops. Then only the paravirt modules need to be GPL, not all modules.

Zach

#3 lore raw
Quoted 3 lines · * Zachary Amsden ([email protected]) wrote:

EXPORT_SYMBOL_GPL is still possible - if you patch over every op in paravirt_ops. Then only the paravirt modules need to be GPL, not all modules.

Problem is the pervasive nature. So any old module that was doing local_irq_disable() will need access to the paravirt_ops structure via

local_irq_disable() -> raw_local_irq_disable -> paravirt_ops.irq_disable()

IOW, all modules need paravirt_ops access, otherwise non-GPL modules will fail to load with "Unknown symbol paravirt_ops." We can't make an interface change like that.

thanks,
-chris

#4 lore raw
Quoted 7 lines · Chris Wright
Quoted 4 lines · * Zachary Amsden ([email protected]) wrote:

EXPORT_SYMBOL_GPL is still possible - if you patch over every op in paravirt_ops. Then only the paravirt modules need to be GPL, not all modules.

Quoted 9 lines

Problem is the pervasive nature. So any old module that was doing local_irq_disable() will need access to the paravirt_ops structure via

local_irq_disable() -> raw_local_irq_disable -> paravirt_ops.irq_disable()

IOW, all modules need paravirt_ops access, otherwise non-GPL modules will fail to load with "Unknown symbol paravirt_ops." We can't make an interface change like that.

But my point is that if you patch everything in the paravirt_ops struct, no module other than the paravirt_ops backend code needs paravirt_ops access, so paravirt_ops can still be GPL only. The problem is you would need to patch everything.

Zach

#5 lore raw
Quoted 4 lines · Zachary Amsden

But my point is that if you patch everything in the paravirt_ops struct, no module other than the paravirt_ops backend code needs paravirt_ops access, so paravirt_ops can still be GPL only. The problem is you would need to patch everything.

Sure, but the default code leaves the module with a static dependency on paravirt_ops, even if it doesn't have a dynamic one. If you patch every single pv_op, then you could just make the static code ".fill ud2" and have no dependency - but I don't think that's where we want to go.

J

#6 lore raw
In reply to Zachary Amsden
Quoted 4 lines · * Zachary Amsden ([email protected]) wrote:

But my point is that if you patch everything in the paravirt_ops struct, no module other than the paravirt_ops backend code needs paravirt_ops access, so paravirt_ops can still be GPL only. The problem is you would need to patch everything.

Oh, I see what you mean, yes. There was some discussion of that, basically run through generic patch, then ->patch() or some such.

#7 lore raw
Quoted 8 lines · Chris Wright
Quoted 4 lines · * Zachary Amsden ([email protected]) wrote:

But my point is that if you patch everything in the paravirt_ops struct, no module other than the paravirt_ops backend code needs paravirt_ops access, so paravirt_ops can still be GPL only. The problem is you would need to patch everything.

Oh, I see what you mean, yes. There was some discussion of that, basically run through generic patch, then ->patch() or some such.

There is another solution. You can simply make the users of paravirt_ops that aren't important enough to patch static functions in the kernel.

That plus the removal from the callers that always get patched should make the GPL export safe.

Eric