Skip to contentSkip to conversation

x86/mm: Export cpu_tlbstate as non-GPL symbol

PATCH Andy Lutomirski 4 participants 6 messages Sep 22, 2015 – Sep 27, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · James Forcier

Exporting cpu_tlbstate as a GPL symbol was introduced in 1e02ce4c; however, this breaks non-GPL modules which need to link against it, particularly the AMD Catalyst drivers.

What is AMD Catalyst doing with cpu_tlbstate?

--Andy

Quoted 22 lines
---
 arch/x86/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/init.c +1 -2
index 1d8a83d..94be56b 100644
@@ -742,7 +742,7 @@ DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = {
 #endif
        .cr4 = ~0UL,    /* fail hard if we screw up cr4 shadow initialization */
 };
-EXPORT_SYMBOL_GPL(cpu_tlbstate);
+EXPORT_SYMBOL(cpu_tlbstate);
 
 void update_cache_mode_entry(unsigned entry, enum page_cache_mode cache)
 {
--

2.4.6

Signature · 2 lines
Andy Lutomirski
AMA Capital Management, LLC
#2 lore raw
Quoted 6 lines · Andy Lutomirski
Quoted 3 lines · James Forcier

Exporting cpu_tlbstate as a GPL symbol was introduced in 1e02ce4c; however, this breaks non-GPL modules which need to link against it, particularly the AMD Catalyst drivers.

What is AMD Catalyst doing with cpu_tlbstate?

Fiddling with it behind the kernels back. Out of tree graphic drivers always have their special needs. Just lookup the discussions about unexporting init_mm ....

Thanks,

tglx

#3 lore raw
Quoted 7 lines · Thomas Gleixner
Quoted 5 lines · Andy Lutomirski
Quoted 3 lines · James Forcier

Exporting cpu_tlbstate as a GPL symbol was introduced in 1e02ce4c; however, this breaks non-GPL modules which need to link against it, particularly the AMD Catalyst drivers.

Quoted 5 lines
Quoted 1 line

What is AMD Catalyst doing with cpu_tlbstate?

Fiddling with it behind the kernels back. Out of tree graphic drivers always have their special needs. Just lookup the discussions about unexporting init_mm ....

Look for kcl_mem_pat_setup here:

https://github.com/kolasa/fglrx-13.152/blob/master/firegl_public.c

I can't NAK this patch hard enough. The correct fix is for fglrx to delete all of the offending code and just use ioremap_wc (which is a plain old EXPORT_SYMBOL). We've supported ioremap_wc properly for *years*.

My personal view is that non-GPL modules are awful things to do, are so bloody annoying for their (paying!) users that I'm amazed that anyone puts up with them, but are nonetheless things that we shouldn't go out of our way to break. But for $*!&'s sake, we maybe should go out of our way to prevent utter bovine excrement* like the PAT hack in there from working.

--Andy, who is *really* looking forward to either Nvidia releasing signed firmware blobs or Intel releasing a reasonable new integrated GPU chip so he can stop using the nvidia binary driver.

* This is apparently the new polite term for it.

#4 lore raw
Quoted 10 lines · Andy Lutomirski
Quoted 9 lines · Thomas Gleixner
Quoted 6 lines · Andy Lutomirski
Quoted 3 lines · James Forcier

Exporting cpu_tlbstate as a GPL symbol was introduced in 1e02ce4c; however, this breaks non-GPL modules which need to link against it, particularly the AMD Catalyst drivers.

What is AMD Catalyst doing with cpu_tlbstate?

Quoted 7 lines
Quoted 3 lines

Fiddling with it behind the kernels back. Out of tree graphic drivers always have their special needs. Just lookup the discussions about unexporting init_mm ....

Look for kcl_mem_pat_setup here:

https://github.com/kolasa/fglrx-13.152/blob/master/firegl_public.c

I stopped looking at this line:

MODULE_LICENSE("GPL\0Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY");

Thanks,

tglx

#5 lore raw
Quoted 5 lines · Thomas Gleixner
Quoted 1 line

https://github.com/kolasa/fglrx-13.152/blob/master/firegl_public.c

I stopped looking at this line:

MODULE_LICENSE("GPL\0Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY");

"GPL" *and* "Proprietary"??!

How does that even work?

Oh, that depends on the kernel version:

#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) MODULE_LICENSE("Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY"); #else
MODULE_LICENSE("GPL\0Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY"); #endif

With that '\0' string terminator in there?! WTF now?!

Signature · 4 lines
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
#6 lore raw
Quoted 7 lines · Borislav Petkov

#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) MODULE_LICENSE("Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY"); #else
MODULE_LICENSE("GPL\0Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY"); #endif

With that '\0' string terminator in there?! WTF now?!

AFACT this gem is not part of the official AMD Catalyst driver.

Signature · 2 lines
Thanks,
//richard