Skip to contentSkip to conversation

disallow DRM on 386

PATCH In review Adrian Bunk 4 participants 8 messages Jan 20, 2004 – Jan 21, 2004 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 disallow DRM on 386

I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n. This problem is not specific to -mm, and it always occurs when you include support for the 386 cpu (oposed to the 486 or later cpus) since in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in include/asm-i386/system.h .

The patch below disallows DRM if X86_CMPXCHG=n.

Please apply
Adrian

drivers/char/drm/Kconfig renamed from drivers/char/drm/Kconfig.old +1 -0
@@ -6,6 +6,7 @@
 #
 config DRM
 	bool "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
+	depends on !X86 || X86_CMPXCHG
 	help
 	  Kernel-level support for the Direct Rendering Infrastructure (DRI)
 	  introduced in XFree86 4.0. If you say Y here, you need to select
#1 lore raw
Quoted 7 lines · El Tue, 20 Jan 2004 22:24:21 +0100 Adrian Bunk <[email protected]> escribió:

I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n. This problem is not specific to -mm, and it always occurs when you include support for the 386 cpu (oposed to the 486 or later cpus) since in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in include/asm-i386/system.h .

The patch below disallows DRM if X86_CMPXCHG=n.

I got a "cmpxchg not defined" error when compiling the drm stuff in -mm5. When I looked at the configuration, I saw that all the cpus types had been selected (I didn't even realize of your stuuf and menuconfig put the defaults). I removed all types of cpus except PIII and it compiled.

#2 lore raw
Quoted 8 lines · Diego Calleja
Quoted 6 lines · El Tue, 20 Jan 2004 22:24:21 +0100 Adrian Bunk <[email protected]> escribió:

I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n. This problem is not specific to -mm, and it always occurs when you include support for the 386 cpu (oposed to the 486 or later cpus) since in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in include/asm-i386/system.h .

Quoted 6 lines
Quoted 1 line

The patch below disallows DRM if X86_CMPXCHG=n.

I got a "cmpxchg not defined" error when compiling the drm stuff in -mm5. When I looked at the configuration, I saw that all the cpus types had been selected (I didn't even realize of your stuuf and menuconfig put the defaults). I removed all types of cpus except PIII and it compiled.

Yup, that's exactly the problem.

Selecting CPU_386 in -mm4 or -mm5 or selecting M386 in other kernels triggers it.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 17 lines · Adrian Bunk
Quoted 8 lines · Diego Calleja
Quoted 6 lines · El Tue, 20 Jan 2004 22:24:21 +0100 Adrian Bunk <[email protected]> escribió:

I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n. This problem is not specific to -mm, and it always occurs when you include support for the 386 cpu (oposed to the 486 or later cpus) since in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in include/asm-i386/system.h .

Quoted 6 lines
Quoted 1 line

The patch below disallows DRM if X86_CMPXCHG=n.

I got a "cmpxchg not defined" error when compiling the drm stuff in -mm5. When I looked at the configuration, I saw that all the cpus types had been selected (I didn't even realize of your stuuf and menuconfig put the defaults). I removed all types of cpus except PIII and it compiled.

Quoted 5 lines

Yup, that's exactly the problem.

Selecting CPU_386 in -mm4 or -mm5 or selecting M386 in other kernels triggers it.

I'll remove 386 from the default CPU types as well.

#4 lore raw
Quoted 18 lines · Andrew Morton
Quoted 17 lines · Adrian Bunk
Quoted 14 lines · Diego Calleja
Quoted 7 lines · El Tue, 20 Jan 2004 22:24:21 +0100 Adrian Bunk <[email protected]> escribió:

I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n. This problem is not specific to -mm, and it always occurs when you include support for the 386 cpu (oposed to the 486 or later cpus) since in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in include/asm-i386/system.h .

The patch below disallows DRM if X86_CMPXCHG=n.

I got a "cmpxchg not defined" error when compiling the drm stuff in -mm5. When I looked at the configuration, I saw that all the cpus types had been selected (I didn't even realize of your stuuf and menuconfig put the defaults). I removed all types of cpus except PIII and it compiled.

Quoted 7 lines
Quoted 5 lines

Yup, that's exactly the problem.

Selecting CPU_386 in -mm4 or -mm5 or selecting M386 in other kernels triggers it.

I'll remove 386 from the default CPU types as well.

Thanks, this sounds reasonable.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#5 lore raw
In reply to Adrian Bunk
Quoted 7 lines · Adrian Bunk

I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n. This problem is not specific to -mm, and it always occurs when you include support for the 386 cpu (oposed to the 486 or later cpus) since in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in include/asm-i386/system.h .

The patch below disallows DRM if X86_CMPXCHG=n.

Ugly.

Fix system.h to always define cmpxchg.h and check its presence at runtime when the DRM module loads, then you can build 386 kernels that support DRI on higher machines.

The problem isnt that cmpxchg definitely doesn't exist, so system.h is wrong IMHO

#6 lore raw
Quoted 9 lines · Alan Cox
Quoted 7 lines · Adrian Bunk

I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n. This problem is not specific to -mm, and it always occurs when you include support for the 386 cpu (oposed to the 486 or later cpus) since in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in include/asm-i386/system.h .

The patch below disallows DRM if X86_CMPXCHG=n.

Quoted 8 lines

Ugly.

Fix system.h to always define cmpxchg.h and check its presence at runtime when the DRM module loads, then you can build 386 kernels that support DRI on higher machines.

The problem isnt that cmpxchg definitely doesn't exist, so system.h is wrong IMHO

???

AFAIR cmpxchg wasn't present in cpus earlier than the 486.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#7 lore raw
Quoted 10 lines · Adrian Bunk
Quoted 6 lines

Fix system.h to always define cmpxchg.h and check its presence at runtime when the DRM module loads, then you can build 386 kernels that support DRI on higher machines.

The problem isnt that cmpxchg definitely doesn't exist, so system.h is wrong IMHO

???

AFAIR cmpxchg wasn't present in cpus earlier than the 486.

This is not relevant to the discussion assuming you are talking about kernels for 386 and higher as well as kernels solely for Intel 386. If the kernel is for 386 and higher then the DRI modules should be built but should check for cmpxchg at run time - as we do with many other CPU features