Skip to contentSkip to conversation

About CONFIG_ACPI_PROCESSOR_XEN

DISCUSSION Gianluca Guida 2 participants 8 messages Aug 24, 2009 – Aug 25, 2009 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

Hi,

While configuring dom0 kernels I've found certaing things in the handling of CONFIG_ACPI_PROCESSOR_XEN which are confusing to me.

- In case CONFIG_ACPI_PROCESSOR is set as a module (which was the default in my system) the compilation will break, because CONFIG_ACPI_PROCESSOR_XEN will not be set.

- CONFIG_ACPI_PROCESSOR_XEN is only set when CPU_FREQ=y, but these functions are used (in their empty versions) even when CONFIG_ACPI_PROCESSOR=y and CPU_FREQ=n. Is this the intended use?

Thanks,
Gianluca

#1 lore raw

Hi Gianluca

Thanks for trying and reporting this issue. The root cause of the compilation issue is found as: "when CONFIG_ACPI_PROCESSOR_XEN is not set, the <include/acpi/processor.h> is not included, thus the "struct acpi_processor" is not defined, which will cause compiling error for inline function processor_cntl_xen_prepare(struct acpi_processor *pr);"

I've worked out the attached patch, could you please try it? Thanks

For the second question, CONFIG_ACPI_PROCESSOR_XEN control whether enabling Xen Cx/Px power management or not. CONFIG_ACPI_PROCESSOR_XEN depends on both CONFIG_ACPI_PROCESSOR and CPU_FREQ, if CPU_FREQ=n, the CONFIG_ACPI_PROCESSOR_XEN will not be set, so the empty version is used and Xen Cx/Px power management will not be enabled. This is intended usage. Anything wrong observed in your side?

Best Regards
Ke

-----Original Message-----
From: Gianluca Guida [mailto:[email protected]]
Sent: Monday, August 24, 2009 9:25 PM
To: Yu, Ke; Tian, Kevin; Jeremy Fitzhardinge
Cc: [email protected]
Subject: About CONFIG_ACPI_PROCESSOR_XEN

Hi,

While configuring dom0 kernels I've found certaing things in the handling of CONFIG_ACPI_PROCESSOR_XEN which are confusing to me.

- In case CONFIG_ACPI_PROCESSOR is set as a module (which was the default in my system) the compilation will break, because CONFIG_ACPI_PROCESSOR_XEN will not be set.

- CONFIG_ACPI_PROCESSOR_XEN is only set when CPU_FREQ=y, but these functions are used (in their empty versions) even when CONFIG_ACPI_PROCESSOR=y and CPU_FREQ=n. Is this the intended use?

Thanks,
Gianluca

fix the compiling error when CONFIG_ACPI_PROCESSOR_XEN is not set

when CONFIG_ACPI_PROCESSOR_XEN is not set, the <include/acpi/processor.h> is not included, thus the "struct acpi_processor" is not defined, which will cause compiling error for inline function processor_cntl_xen_prepare(struct acpi_processor *pr);

moving the <include/acpi/processor.h> out of "#ifdef CONFIG_ACPI_PROCESSOR_XEN" will fix this issue.

include/xen/acpi.h +2 -2
index fafc337..3d73163 100644
@@ -2,6 +2,8 @@
 #define _XEN_ACPI_H
 
 #include <linux/types.h>
+#include <acpi/acpi_drivers.h>
+#include <acpi/processor.h>
 
 #ifdef CONFIG_XEN_S3
 #include <asm/xen/hypervisor.h>
@@ -40,8 +42,6 @@ int acpi_notify_hypervisor_state(u8 sleep_state,
 #define HOTPLUG_TYPE_REMOVE	1
 
 #ifdef CONFIG_ACPI_PROCESSOR_XEN
-#include <acpi/acpi_drivers.h>
-#include <acpi/processor.h>
 
 struct processor_cntl_xen_ops {
 	/* Transfer processor PM events to xen */

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

Hi Ke,

Quoted 1 line · Ke

Thanks for trying and reporting this issue. The root cause of the compilation issue is found as: "when CONFIG_ACPI_PROCESSOR_XEN is not set, the <include/acpi/processor.h> is not included, thus the "struct acpi_processor" is not defined, which will cause compiling error for inline function processor_cntl_xen_prepare(struct acpi_processor *pr);"

Hm no, I was not referring to the compilation warning. I've also made a mistake on explaining the problem. :-)

So, the problem is that when CONFIG_ACPI_PROCESSOR is set to 'm', CONFIG_ACPI_PROCESSOR_XEN will be set (being bolean, to 'y'). This will cause the final linking to fail because of undefined symbols (those now in the module called in the xen acpi code).

Here's what happens in my .config:

CONFIG_ACPI_PROCESSOR=m
[...]
CONFIG_ACPI_PROCESSOR_XEN=y

And this is the result:

LD .tmp_vmlinux1
drivers/built-in.o: In function `processor_cntl_xen_prepare':
(.text+0x543e8): undefined reference to acpi_processor_get_performance_info' drivers/built-in.o: In function processor_cntl_xen_prepare':
(.text+0x5440c): undefined reference to `acpi_processor_get_psd' make[1]: *** [.tmp_vmlinux1] Error 1
make: *** [sub-make] Error 2

As of your patch, yes that's useful to remove the warning.

Cheers,
Gianluca

#3 lore raw

Ha, I see, then the following simple patch should fix this issue, but this will limit CONFIG_ACPI_PROCESSOR to be y. I am still thinking if there is better fix to allow CONFIG_ACPI_PROCESSOR=m.

drivers/xen/Kconfig +1 -1
index 33976f7..2e7d673 100644
@@ -98,5 +98,5 @@ config XEN_MCE
 
 config ACPI_PROCESSOR_XEN
        bool
-       depends on XEN_DOM0 && ACPI_PROCESSOR && CPU_FREQ
+       depends on XEN_DOM0 && ACPI_PROCESSOR = y && CPU_FREQ
        default y

-----Original Message-----
From: Gianluca Guida [mailto:[email protected]]
Sent: Monday, August 24, 2009 11:07 PM
To: Yu, Ke
Cc: Gianluca Guida; Tian, Kevin; Jeremy Fitzhardinge; [email protected]
Subject: RE: About CONFIG_ACPI_PROCESSOR_XEN

Hi Ke,

Quoted 1 line · Ke

Thanks for trying and reporting this issue. The root cause of the compilation issue is found as: "when CONFIG_ACPI_PROCESSOR_XEN is not set, the <include/acpi/processor.h> is not included, thus the "struct acpi_processor" is not defined, which will cause compiling error for inline function processor_cntl_xen_prepare(struct acpi_processor *pr);"

Hm no, I was not referring to the compilation warning. I've also made a mistake on explaining the problem. :-)

So, the problem is that when CONFIG_ACPI_PROCESSOR is set to 'm', CONFIG_ACPI_PROCESSOR_XEN will be set (being bolean, to 'y'). This will cause the final linking to fail because of undefined symbols (those now in the module called in the xen acpi code).

Here's what happens in my .config:

CONFIG_ACPI_PROCESSOR=m
[...]
CONFIG_ACPI_PROCESSOR_XEN=y

And this is the result:

LD .tmp_vmlinux1
drivers/built-in.o: In function `processor_cntl_xen_prepare':
(.text+0x543e8): undefined reference to acpi_processor_get_performance_info' drivers/built-in.o: In function processor_cntl_xen_prepare':
(.text+0x5440c): undefined reference to `acpi_processor_get_psd' make[1]: *** [.tmp_vmlinux1] Error 1
make: *** [sub-make] Error 2

As of your patch, yes that's useful to remove the warning.

Cheers,
Gianluca

#4 lore raw
Quoted 1 line · Ke

Ha, I see, then the following simple patch should fix this issue, but this will limit CONFIG_ACPI_PROCESSOR to be y. I am still thinking if there is better fix to allow CONFIG_ACPI_PROCESSOR=m.

Hm. Perhaps it's better the compilation error than this patch. This will make the ACPI processor module not notify the hypervisor about the ACPI events. I don't know how serious this is, though.

Thanks,
Gianluca

#5 lore raw

Hi Gianluca,

Could you please elaborate more on the better way to fix this issue in your mind? Sorry that I did not quite catch your point.

Best Regards
Ke

-----Original Message-----
From: Gianluca Guida [mailto:[email protected]]
Sent: Tuesday, August 25, 2009 12:25 AM
To: Yu, Ke
Cc: Gianluca Guida; Tian, Kevin; Jeremy Fitzhardinge; [email protected]
Subject: RE: About CONFIG_ACPI_PROCESSOR_XEN

Quoted 1 line · Ke

Ha, I see, then the following simple patch should fix this issue, but this will limit CONFIG_ACPI_PROCESSOR to be y. I am still thinking if there is better fix to allow CONFIG_ACPI_PROCESSOR=m.

Hm. Perhaps it's better the compilation error than this patch. This will make the ACPI processor module not notify the hypervisor about the ACPI events. I don't know how serious this is, though.

Thanks,
Gianluca

#6 lore raw

Hi Ke,

Quoted 1 line · Ke

Could you please elaborate more on the better way to fix this issue in your mind? Sorry that I did not quite catch your point.

Well, the purpose of my mail was to get aware the authors of the patch (as in the Signed-off-by lines) and whoever was interested in compiling dom0 kernels (i.e., xen-devel) that there are issues in compiling the ACPI processor support for Xen.

I think it's useful to know that things go wrong when CONFIG_ACPI_PROCESSOR=m in the .config file. Your patch just hide the issue, it doesn't fix it.

Hope this clarifies things.
Gianluca

#7 lore raw

Oh, I see. Thanks for the explanation. So let's just keep it as it is currently.

Best Regards
Ke

Quoted 24 lines

-----Original Message-----
From: Gianluca Guida [mailto:[email protected]]
Sent: Tuesday, August 25, 2009 5:23 PM
To: Yu, Ke
Cc: Tian, Kevin; Jeremy Fitzhardinge; [email protected]
Subject: RE: About CONFIG_ACPI_PROCESSOR_XEN

Hi Ke,

Quoted 1 line · Ke

Could you please elaborate more on the better way to fix this issue in your

mind? Sorry that I did not quite catch your point.

Well, the purpose of my mail was to get aware the authors of the patch (as in the Signed-off-by lines) and whoever was interested in compiling dom0 kernels (i.e., xen-devel) that there are issues in compiling the ACPI processor support for Xen.

I think it's useful to know that things go wrong when CONFIG_ACPI_PROCESSOR=m in the .config file. Your patch just hide the issue, it doesn't fix it.

Hope this clarifies things.
Gianluca