Kernel 2.6.38 phc-k8 compiling error

Discuss about PHC here. For problems please use the PHC Help forum
Post Reply
patrick85
Posts: 7
Joined: Sun 7. Jun 2009, 09:48

Kernel 2.6.38 phc-k8 compiling error

Post by patrick85 » Thu 17. Mar 2011, 10:12

Hello.

I get an error if I try to compile the phc-k8 module for Kernel 2.6.38.

make -C /lib/modules/`uname -r`/build SUBDIRS=/home/patrick/phc-k8_v0.4.4a2 phc-k8.ko
make[1]: Entering directory `/usr/src/linux-2.6.38-ARCH'
CC [M] /home/patrick/phc-k8_v0.4.4a2/phc-k8.o
/home/patrick/phc-k8_v0.4.4a2/phc-k8.c: In Funktion »check_supported_cpu«:
/home/patrick/phc-k8_v0.4.4a2/phc-k8.c:725:6: Fehler: »current_cpu_data« undeclared (first use in this function)
/home/patrick/phc-k8_v0.4.4a2/phc-k8.c:725:6: Anmerkung: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [/home/patrick/phc-k8_v0.4.4a2/phc-k8.o] Fehler 1
make[1]: *** [phc-k8.ko] Fehler 2
make[1]: Leaving directory `/usr/src/linux-2.6.38-ARCH'
make: *** [phc-k8.ko] Fehler 2

phc-k8: 4.4 Alpha 2
Distro: up-to-date Arch-Linux

Thanks for all your work.

User avatar
DavidG
Posts: 180
Joined: Fri 18. Jul 2008, 11:25
Contact:

Re: Kernel 2.6.38 phc-k8 compiling error

Post by DavidG » Sun 20. Mar 2011, 00:39

If you apply a patch like this it should work again.

Code: Select all

@@ -722,7 +722,7 @@ static void check_supported_cpu(void *_rc)
 
        *rc = -ENODEV;
 
-       if (current_cpu_data.x86_vendor != X86_VENDOR_AMD)
+       if (__this_cpu_read(cpu_info.x86_vendor) != X86_VENDOR_AMD)
                return;
 
        eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
I just returned from holiday and I never would have guessed the new kernel was released this soon, normally it takes a lot longer. There are some other changes I need to look into, but this is the most important one. Note that this patch is also required for phc-k8 v0.4.3 to work on 2.6.38.

(By the way, I'm still compiling 2.6.38 at the moment...)
A bank is a place where they lend you an umbrella in fair weather and ask for it back when it begins to rain -- R. Frost

patrick85
Posts: 7
Joined: Sun 7. Jun 2009, 09:48

Re: Kernel 2.6.38 phc-k8 compiling error

Post by patrick85 » Mon 21. Mar 2011, 00:14

Thanks.

I have applied the patch and it is working like charm again.

minimal
Posts: 3
Joined: Sat 2. Oct 2010, 13:12

Re: Kernel 2.6.38 phc-k8 compiling error

Post by minimal » Mon 21. Mar 2011, 14:13

Sorry for the dumb question but.. i've never applied a patch. How can I do? Thanks if you can help me. If not, i will wait until the next phc release.

Debian unstable - liquorix kernel

User avatar
DavidG
Posts: 180
Joined: Fri 18. Jul 2008, 11:25
Contact:

Re: Kernel 2.6.38 phc-k8 compiling error

Post by DavidG » Mon 21. Mar 2011, 14:44

This you can find at the 725th line in phc-k8.c:

Code: Select all

	if (current_cpu_data.x86_vendor != X86_VENDOR_AMD)
You should change that line into:

Code: Select all

	if (__this_cpu_read(cpu_info.x86_vendor) != X86_VENDOR_AMD)
That's it!
A bank is a place where they lend you an umbrella in fair weather and ask for it back when it begins to rain -- R. Frost

minimal
Posts: 3
Joined: Sat 2. Oct 2010, 13:12

Re: Kernel 2.6.38 phc-k8 compiling error

Post by minimal » Wed 30. Mar 2011, 14:09

Sorry DavidG... I forgot to answer... It works!
Thanks a lot for your help and keep up the good work!

User avatar
DavidG
Posts: 180
Joined: Fri 18. Jul 2008, 11:25
Contact:

Re: Kernel 2.6.38 phc-k8 compiling error

Post by DavidG » Fri 20. May 2011, 21:52

The latest test release (phc-k8 v0.4.4b1) should compile without any additional changes. I am planning to release it ASAP as stable version 0.4.4.
A bank is a place where they lend you an umbrella in fair weather and ask for it back when it begins to rain -- R. Frost

Post Reply