diff mbox

[v10,00/21] Introduce ACPI for ARM64 based on ACPI 5.1

Message ID 550D17BE.70009@huawei.com
State New
Headers show

Commit Message

Hanjun Guo March 21, 2015, 7:03 a.m. UTC
On 2015/3/21 11:17, Hanjun Guo wrote:
> +CC Parth Dixit, Stefano Stabellini.
>
> On 2015年03月21日 02:54, Will Deacon wrote:
>> On Thu, Mar 19, 2015 at 04:09:33AM +0000, Hanjun Guo wrote:
>>> On 2015/3/19 3:05, Will Deacon wrote:
>>>> If you can get that in place, I'm not opposed to putting this into
>>>> linux-next ahead of the firmware summit in San Jose next week. Note that
>>>> this is not a commitment for 4.1, since I'm keen to see the outcomes of
>>>> next week before setting anything in stone.
>>>
>>> OK, I will stick to this mailing list and respond as soon as I can.
>>
>> This doesn't even build for me:
>>
>>
>> $ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- allmodconfig
>> $ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- Image
>>
>> [...]
>>
>> In file included from drivers/xen/acpi.c:33:0:
>
> Sorry, I didn't build ACPI with XEN enabled on ARM64.
>
>> include/xen/acpi.h: In function ‘xen_acpi_sleep_register’:
>> include/xen/acpi.h:102:3: error: ‘acpi_suspend_lowlevel’ undeclared (first use in this function)
>>     acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel;
>
> acpi_suspend_lowlevel is defined only for X86 and IA64 for now.
>
>>     ^
>> include/xen/acpi.h:102:3: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/xen/acpi.c: In function ‘xen_acpi_notify_hypervisor_state’:
>> drivers/xen/acpi.c:61:2: error: implicit declaration of function ‘HYPERVISOR_dom0_op’ [-Werror=implicit-function-declaration]
>>    HYPERVISOR_dom0_op(&op);
>
> And this is only for x86:
> ./arch/x86/include/asm/xen/hypercall.h:HYPERVISOR_dom0_op(struct xen_platform_op *platform_op)
>
>>    ^
>> cc1: some warnings being treated as errors
>> make[2]: *** [drivers/xen/acpi.o] Error 1
>> make[2]: *** Waiting for unfinished jobs....
>> make[1]: *** [drivers/xen] Error 2
>> make[1]: *** Waiting for unfinished jobs....
>> make: *** [drivers] Error 2
>>
>>
>> Am I missing some other patches?
>
> No, you miss nothing. Parth Dixit is still working on XEN ACPI for
> ARM64, before it's in full function, how about introduce a Kconfig
> CONFIG_XEN_ACPI and let it depends on x86? when XEN ACPI for ARM64
> comes, we can enable ARM64 for CONFIG_XEN_ACPI and fix the problems
> above.
>
> Stefano, Parth, what do you think?

I prepared a patch for further reference:

From 268dcdafa34a690e2f99c0784ca33a6d2352ecf5 Mon Sep 17 00:00:00 2001
From: Hanjun Guo <hanjun.guo@linaro.org>
Date: Sat, 21 Mar 2015 14:43:54 +0800
Subject: [PATCH] XEN / ACPI: Make XEN ACPI depend on X86

When ACPI is enabled on ARM64, XEN ACPI will also compiled
into the kernel, but XEN ACPI is x86 dependent, so introduce
CONFIG_XEN_ACPI to make it depend on x86 before XEN ACPI is
functional on ARM64.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 drivers/xen/Kconfig  | 4 ++++
 drivers/xen/Makefile | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Julien Grall March 22, 2015, 9:05 p.m. UTC | #1
Hello,

On 21/03/2015 12:09, Naresh Bhat wrote:
>      From 268dcdafa34a690e2f99c0784ca33a6d2352ecf5 Mon Sep 17 00:00:00 2001
>     From: Hanjun Guo <hanjun.guo@linaro.org <mailto:hanjun.guo@linaro.org>>
>     Date: Sat, 21 Mar 2015 14:43:54 +0800
>     Subject: [PATCH] XEN / ACPI: Make XEN ACPI depend on X86
>
>     When ACPI is enabled on ARM64, XEN ACPI will also compiled
>     into the kernel, but XEN ACPI is x86 dependent, so introduce
>     CONFIG_XEN_ACPI to make it depend on x86 before XEN ACPI is
>     functional on ARM64.
>
>     Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org
>     <mailto:hanjun.guo@linaro.org>>
>     ---
>       drivers/xen/Kconfig  | 4 ++++
>       drivers/xen/Makefile | 2 +-
>       2 files changed, 5 insertions(+), 1 deletion(-)
>
>     diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
>     index b812462..a31cd29 100644
>     --- a/drivers/xen/Kconfig
>     +++ b/drivers/xen/Kconfig
>     @@ -253,4 +253,8 @@ config XEN_EFI
>           def_bool y
>           depends on X86_64 && EFI
>
>     +config XEN_ACPI
>     +    def_bool y
>     +    depends on X86 && ACPI
>     +
>       endmenu
>     diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>     index 2ccd359..f4622ab 100644
>     --- a/drivers/xen/Makefile
>     +++ b/drivers/xen/Makefile
>     @@ -13,7 +13,7 @@ CFLAGS_efi.o                += -fshort-wchar
>
>       dom0-$(CONFIG_PCI) += pci.o
>       dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
>     -dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
>     +dom0-$(CONFIG_XEN_ACPI) += acpi.o $(xen-pad-y)
>       xen-pad-$(CONFIG_X86) += xen-acpi-pad.o
>       dom0-$(CONFIG_X86) += pcpu.o
>       obj-$(CONFIG_XEN_DOM0)            += $(dom0-y)

[..]

>
> AFAIK,  There is already a kernel patch exists to fix this issue.  I
> think  Julien or Parth is a right person to ask.  Hence I am CCed Julien
> Grall too.

The ACPI support for Xen is not ready. So I think avoiding to compile 
drivers/xen/acpi.c on ARM64/ARM seems the better solution for now.

Although, rather than introducing a new CONFIG option, I would use the 
same trick we use within the Makefile to avoid hotplug.c on ARM/ARM64.

ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)), )
dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
endif

Regards,
Julien Grall March 22, 2015, 9:32 p.m. UTC | #2
On 22/03/2015 21:49, Rafael J. Wysocki wrote:
> On Sunday, March 22, 2015 09:05:21 PM Julien Grall wrote:
>> Hello,
>>
>> On 21/03/2015 12:09, Naresh Bhat wrote:
>>>       From 268dcdafa34a690e2f99c0784ca33a6d2352ecf5 Mon Sep 17 00:00:00 2001
>>>      From: Hanjun Guo <hanjun.guo@linaro.org <mailto:hanjun.guo@linaro.org>>
>>>      Date: Sat, 21 Mar 2015 14:43:54 +0800
>>>      Subject: [PATCH] XEN / ACPI: Make XEN ACPI depend on X86
>>>
>>>      When ACPI is enabled on ARM64, XEN ACPI will also compiled
>>>      into the kernel, but XEN ACPI is x86 dependent, so introduce
>>>      CONFIG_XEN_ACPI to make it depend on x86 before XEN ACPI is
>>>      functional on ARM64.
>>>
>>>      Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org
>>>      <mailto:hanjun.guo@linaro.org>>
>>>      ---
>>>        drivers/xen/Kconfig  | 4 ++++
>>>        drivers/xen/Makefile | 2 +-
>>>        2 files changed, 5 insertions(+), 1 deletion(-)
>>>
>>>      diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
>>>      index b812462..a31cd29 100644
>>>      --- a/drivers/xen/Kconfig
>>>      +++ b/drivers/xen/Kconfig
>>>      @@ -253,4 +253,8 @@ config XEN_EFI
>>>            def_bool y
>>>            depends on X86_64 && EFI
>>>
>>>      +config XEN_ACPI
>>>      +    def_bool y
>>>      +    depends on X86 && ACPI
>>>      +
>>>        endmenu
>>>      diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>>>      index 2ccd359..f4622ab 100644
>>>      --- a/drivers/xen/Makefile
>>>      +++ b/drivers/xen/Makefile
>>>      @@ -13,7 +13,7 @@ CFLAGS_efi.o                += -fshort-wchar
>>>
>>>        dom0-$(CONFIG_PCI) += pci.o
>>>        dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
>>>      -dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
>>>      +dom0-$(CONFIG_XEN_ACPI) += acpi.o $(xen-pad-y)
>>>        xen-pad-$(CONFIG_X86) += xen-acpi-pad.o
>>>        dom0-$(CONFIG_X86) += pcpu.o
>>>        obj-$(CONFIG_XEN_DOM0)            += $(dom0-y)
>>
>> [..]
>>
>>>
>>> AFAIK,  There is already a kernel patch exists to fix this issue.  I
>>> think  Julien or Parth is a right person to ask.  Hence I am CCed Julien
>>> Grall too.
>>
>> The ACPI support for Xen is not ready. So I think avoiding to compile
>> drivers/xen/acpi.c on ARM64/ARM seems the better solution for now.
>>
>> Although, rather than introducing a new CONFIG option, I would use the
>> same trick we use within the Makefile to avoid hotplug.c on ARM/ARM64.
>>
>> ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)), )
>> dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
>> endif
>
> Well, is avoiding an extra CONFIG_ option worth the ugliness of this?

When the support of ACPI for Xen will come, the CONFIG_ option will be 
an alias to CONFIG_XEN.

In this case the CONFIG_ option won't bring much improvement to the code 
and add an extra indirection.

The "ugliness" option has, at least, the advantage to be tiny and 
self-contained.

Regards,
Rafael J. Wysocki March 22, 2015, 9:49 p.m. UTC | #3
On Sunday, March 22, 2015 09:05:21 PM Julien Grall wrote:
> Hello,
> 
> On 21/03/2015 12:09, Naresh Bhat wrote:
> >      From 268dcdafa34a690e2f99c0784ca33a6d2352ecf5 Mon Sep 17 00:00:00 2001
> >     From: Hanjun Guo <hanjun.guo@linaro.org <mailto:hanjun.guo@linaro.org>>
> >     Date: Sat, 21 Mar 2015 14:43:54 +0800
> >     Subject: [PATCH] XEN / ACPI: Make XEN ACPI depend on X86
> >
> >     When ACPI is enabled on ARM64, XEN ACPI will also compiled
> >     into the kernel, but XEN ACPI is x86 dependent, so introduce
> >     CONFIG_XEN_ACPI to make it depend on x86 before XEN ACPI is
> >     functional on ARM64.
> >
> >     Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org
> >     <mailto:hanjun.guo@linaro.org>>
> >     ---
> >       drivers/xen/Kconfig  | 4 ++++
> >       drivers/xen/Makefile | 2 +-
> >       2 files changed, 5 insertions(+), 1 deletion(-)
> >
> >     diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> >     index b812462..a31cd29 100644
> >     --- a/drivers/xen/Kconfig
> >     +++ b/drivers/xen/Kconfig
> >     @@ -253,4 +253,8 @@ config XEN_EFI
> >           def_bool y
> >           depends on X86_64 && EFI
> >
> >     +config XEN_ACPI
> >     +    def_bool y
> >     +    depends on X86 && ACPI
> >     +
> >       endmenu
> >     diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> >     index 2ccd359..f4622ab 100644
> >     --- a/drivers/xen/Makefile
> >     +++ b/drivers/xen/Makefile
> >     @@ -13,7 +13,7 @@ CFLAGS_efi.o                += -fshort-wchar
> >
> >       dom0-$(CONFIG_PCI) += pci.o
> >       dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
> >     -dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
> >     +dom0-$(CONFIG_XEN_ACPI) += acpi.o $(xen-pad-y)
> >       xen-pad-$(CONFIG_X86) += xen-acpi-pad.o
> >       dom0-$(CONFIG_X86) += pcpu.o
> >       obj-$(CONFIG_XEN_DOM0)            += $(dom0-y)
> 
> [..]
> 
> >
> > AFAIK,  There is already a kernel patch exists to fix this issue.  I
> > think  Julien or Parth is a right person to ask.  Hence I am CCed Julien
> > Grall too.
> 
> The ACPI support for Xen is not ready. So I think avoiding to compile 
> drivers/xen/acpi.c on ARM64/ARM seems the better solution for now.
> 
> Although, rather than introducing a new CONFIG option, I would use the 
> same trick we use within the Makefile to avoid hotplug.c on ARM/ARM64.
> 
> ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)), )
> dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
> endif

Well, is avoiding an extra CONFIG_ option worth the ugliness of this?
Rafael J. Wysocki March 22, 2015, 10:11 p.m. UTC | #4
On Sunday, March 22, 2015 09:32:48 PM Julien Grall wrote:
> 
> On 22/03/2015 21:49, Rafael J. Wysocki wrote:
> > On Sunday, March 22, 2015 09:05:21 PM Julien Grall wrote:
> >> Hello,
> >>
> >> On 21/03/2015 12:09, Naresh Bhat wrote:
> >>>       From 268dcdafa34a690e2f99c0784ca33a6d2352ecf5 Mon Sep 17 00:00:00 2001
> >>>      From: Hanjun Guo <hanjun.guo@linaro.org <mailto:hanjun.guo@linaro.org>>
> >>>      Date: Sat, 21 Mar 2015 14:43:54 +0800
> >>>      Subject: [PATCH] XEN / ACPI: Make XEN ACPI depend on X86
> >>>
> >>>      When ACPI is enabled on ARM64, XEN ACPI will also compiled
> >>>      into the kernel, but XEN ACPI is x86 dependent, so introduce
> >>>      CONFIG_XEN_ACPI to make it depend on x86 before XEN ACPI is
> >>>      functional on ARM64.
> >>>
> >>>      Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org
> >>>      <mailto:hanjun.guo@linaro.org>>
> >>>      ---
> >>>        drivers/xen/Kconfig  | 4 ++++
> >>>        drivers/xen/Makefile | 2 +-
> >>>        2 files changed, 5 insertions(+), 1 deletion(-)
> >>>
> >>>      diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> >>>      index b812462..a31cd29 100644
> >>>      --- a/drivers/xen/Kconfig
> >>>      +++ b/drivers/xen/Kconfig
> >>>      @@ -253,4 +253,8 @@ config XEN_EFI
> >>>            def_bool y
> >>>            depends on X86_64 && EFI
> >>>
> >>>      +config XEN_ACPI
> >>>      +    def_bool y
> >>>      +    depends on X86 && ACPI
> >>>      +
> >>>        endmenu
> >>>      diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> >>>      index 2ccd359..f4622ab 100644
> >>>      --- a/drivers/xen/Makefile
> >>>      +++ b/drivers/xen/Makefile
> >>>      @@ -13,7 +13,7 @@ CFLAGS_efi.o                += -fshort-wchar
> >>>
> >>>        dom0-$(CONFIG_PCI) += pci.o
> >>>        dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
> >>>      -dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
> >>>      +dom0-$(CONFIG_XEN_ACPI) += acpi.o $(xen-pad-y)
> >>>        xen-pad-$(CONFIG_X86) += xen-acpi-pad.o
> >>>        dom0-$(CONFIG_X86) += pcpu.o
> >>>        obj-$(CONFIG_XEN_DOM0)            += $(dom0-y)
> >>
> >> [..]
> >>
> >>>
> >>> AFAIK,  There is already a kernel patch exists to fix this issue.  I
> >>> think  Julien or Parth is a right person to ask.  Hence I am CCed Julien
> >>> Grall too.
> >>
> >> The ACPI support for Xen is not ready. So I think avoiding to compile
> >> drivers/xen/acpi.c on ARM64/ARM seems the better solution for now.
> >>
> >> Although, rather than introducing a new CONFIG option, I would use the
> >> same trick we use within the Makefile to avoid hotplug.c on ARM/ARM64.
> >>
> >> ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)), )
> >> dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
> >> endif
> >
> > Well, is avoiding an extra CONFIG_ option worth the ugliness of this?
> 
> When the support of ACPI for Xen will come, the CONFIG_ option will be 
> an alias to CONFIG_XEN.
> 
> In this case the CONFIG_ option won't bring much improvement to the code 
> and add an extra indirection.
> 
> The "ugliness" option has, at least, the advantage to be tiny and 
> self-contained.

Oh well, not really.  You're moving a config-time check to compile time
which means that it will be done every time this Makefile is executed
and for all architectures that execute it.  Not nice.

Also I think that ia64 is missing from the list, but I may be wrong.

Not to mention the fact that the dependency will be rather difficult to find
for tools like xconfig ...
Hanjun Guo March 23, 2015, 1:37 a.m. UTC | #5
On 2015/3/23 6:11, Rafael J. Wysocki wrote:
> On Sunday, March 22, 2015 09:32:48 PM Julien Grall wrote:
>> On 22/03/2015 21:49, Rafael J. Wysocki wrote:
>>> On Sunday, March 22, 2015 09:05:21 PM Julien Grall wrote:
>>>> Hello,
>>>>
>>>> On 21/03/2015 12:09, Naresh Bhat wrote:
>>>>>       From 268dcdafa34a690e2f99c0784ca33a6d2352ecf5 Mon Sep 17 00:00:00 2001
>>>>>      From: Hanjun Guo <hanjun.guo@linaro.org <mailto:hanjun.guo@linaro.org>>
>>>>>      Date: Sat, 21 Mar 2015 14:43:54 +0800
>>>>>      Subject: [PATCH] XEN / ACPI: Make XEN ACPI depend on X86
>>>>>
>>>>>      When ACPI is enabled on ARM64, XEN ACPI will also compiled
>>>>>      into the kernel, but XEN ACPI is x86 dependent, so introduce
>>>>>      CONFIG_XEN_ACPI to make it depend on x86 before XEN ACPI is
>>>>>      functional on ARM64.
>>>>>
>>>>>      Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org
>>>>>      <mailto:hanjun.guo@linaro.org>>
>>>>>      ---
>>>>>        drivers/xen/Kconfig  | 4 ++++
>>>>>        drivers/xen/Makefile | 2 +-
>>>>>        2 files changed, 5 insertions(+), 1 deletion(-)
>>>>>
>>>>>      diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
>>>>>      index b812462..a31cd29 100644
>>>>>      --- a/drivers/xen/Kconfig
>>>>>      +++ b/drivers/xen/Kconfig
>>>>>      @@ -253,4 +253,8 @@ config XEN_EFI
>>>>>            def_bool y
>>>>>            depends on X86_64 && EFI
>>>>>
>>>>>      +config XEN_ACPI
>>>>>      +    def_bool y
>>>>>      +    depends on X86 && ACPI
>>>>>      +
>>>>>        endmenu
>>>>>      diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
>>>>>      index 2ccd359..f4622ab 100644
>>>>>      --- a/drivers/xen/Makefile
>>>>>      +++ b/drivers/xen/Makefile
>>>>>      @@ -13,7 +13,7 @@ CFLAGS_efi.o                += -fshort-wchar
>>>>>
>>>>>        dom0-$(CONFIG_PCI) += pci.o
>>>>>        dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
>>>>>      -dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
>>>>>      +dom0-$(CONFIG_XEN_ACPI) += acpi.o $(xen-pad-y)
>>>>>        xen-pad-$(CONFIG_X86) += xen-acpi-pad.o
>>>>>        dom0-$(CONFIG_X86) += pcpu.o
>>>>>        obj-$(CONFIG_XEN_DOM0)            += $(dom0-y)
>>>> [..]
>>>>
>>>>> AFAIK,  There is already a kernel patch exists to fix this issue.  I
>>>>> think  Julien or Parth is a right person to ask.  Hence I am CCed Julien
>>>>> Grall too.
>>>> The ACPI support for Xen is not ready. So I think avoiding to compile
>>>> drivers/xen/acpi.c on ARM64/ARM seems the better solution for now.
>>>>
>>>> Although, rather than introducing a new CONFIG option, I would use the
>>>> same trick we use within the Makefile to avoid hotplug.c on ARM/ARM64.
>>>>
>>>> ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)), )
>>>> dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
>>>> endif
>>> Well, is avoiding an extra CONFIG_ option worth the ugliness of this?
>> When the support of ACPI for Xen will come, the CONFIG_ option will be 
>> an alias to CONFIG_XEN.
>>
>> In this case the CONFIG_ option won't bring much improvement to the code 
>> and add an extra indirection.
>>
>> The "ugliness" option has, at least, the advantage to be tiny and 
>> self-contained.
> Oh well, not really.  You're moving a config-time check to compile time
> which means that it will be done every time this Makefile is executed
> and for all architectures that execute it.  Not nice.
>
> Also I think that ia64 is missing from the list, but I may be wrong.

In commit d52eefb47d (ia64/xen: Remove Xen support for ia64), XEN is
not supported anymore on ia64 now.

>
> Not to mention the fact that the dependency will be rather difficult to find
> for tools like xconfig ...

I also think introducing a CONFIG_ option is a better idea.

Thanks
Hanjun
Stefano Stabellini March 23, 2015, 6:39 p.m. UTC | #6
On Mon, 23 Mar 2015, Hanjun Guo wrote:
> On 2015/3/23 6:11, Rafael J. Wysocki wrote:
> > On Sunday, March 22, 2015 09:32:48 PM Julien Grall wrote:
> >> On 22/03/2015 21:49, Rafael J. Wysocki wrote:
> >>> On Sunday, March 22, 2015 09:05:21 PM Julien Grall wrote:
> >>>> Hello,
> >>>>
> >>>> On 21/03/2015 12:09, Naresh Bhat wrote:
> >>>>>       From 268dcdafa34a690e2f99c0784ca33a6d2352ecf5 Mon Sep 17 00:00:00 2001
> >>>>>      From: Hanjun Guo <hanjun.guo@linaro.org <mailto:hanjun.guo@linaro.org>>
> >>>>>      Date: Sat, 21 Mar 2015 14:43:54 +0800
> >>>>>      Subject: [PATCH] XEN / ACPI: Make XEN ACPI depend on X86
> >>>>>
> >>>>>      When ACPI is enabled on ARM64, XEN ACPI will also compiled
> >>>>>      into the kernel, but XEN ACPI is x86 dependent, so introduce
> >>>>>      CONFIG_XEN_ACPI to make it depend on x86 before XEN ACPI is
> >>>>>      functional on ARM64.
> >>>>>
> >>>>>      Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org
> >>>>>      <mailto:hanjun.guo@linaro.org>>
> >>>>>      ---
> >>>>>        drivers/xen/Kconfig  | 4 ++++
> >>>>>        drivers/xen/Makefile | 2 +-
> >>>>>        2 files changed, 5 insertions(+), 1 deletion(-)
> >>>>>
> >>>>>      diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> >>>>>      index b812462..a31cd29 100644
> >>>>>      --- a/drivers/xen/Kconfig
> >>>>>      +++ b/drivers/xen/Kconfig
> >>>>>      @@ -253,4 +253,8 @@ config XEN_EFI
> >>>>>            def_bool y
> >>>>>            depends on X86_64 && EFI
> >>>>>
> >>>>>      +config XEN_ACPI
> >>>>>      +    def_bool y
> >>>>>      +    depends on X86 && ACPI
> >>>>>      +
> >>>>>        endmenu
> >>>>>      diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> >>>>>      index 2ccd359..f4622ab 100644
> >>>>>      --- a/drivers/xen/Makefile
> >>>>>      +++ b/drivers/xen/Makefile
> >>>>>      @@ -13,7 +13,7 @@ CFLAGS_efi.o                += -fshort-wchar
> >>>>>
> >>>>>        dom0-$(CONFIG_PCI) += pci.o
> >>>>>        dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
> >>>>>      -dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
> >>>>>      +dom0-$(CONFIG_XEN_ACPI) += acpi.o $(xen-pad-y)
> >>>>>        xen-pad-$(CONFIG_X86) += xen-acpi-pad.o
> >>>>>        dom0-$(CONFIG_X86) += pcpu.o
> >>>>>        obj-$(CONFIG_XEN_DOM0)            += $(dom0-y)
> >>>> [..]
> >>>>
> >>>>> AFAIK,  There is already a kernel patch exists to fix this issue.  I
> >>>>> think  Julien or Parth is a right person to ask.  Hence I am CCed Julien
> >>>>> Grall too.
> >>>> The ACPI support for Xen is not ready. So I think avoiding to compile
> >>>> drivers/xen/acpi.c on ARM64/ARM seems the better solution for now.
> >>>>
> >>>> Although, rather than introducing a new CONFIG option, I would use the
> >>>> same trick we use within the Makefile to avoid hotplug.c on ARM/ARM64.
> >>>>
> >>>> ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)), )
> >>>> dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
> >>>> endif
> >>> Well, is avoiding an extra CONFIG_ option worth the ugliness of this?
> >> When the support of ACPI for Xen will come, the CONFIG_ option will be 
> >> an alias to CONFIG_XEN.
> >>
> >> In this case the CONFIG_ option won't bring much improvement to the code 
> >> and add an extra indirection.
> >>
> >> The "ugliness" option has, at least, the advantage to be tiny and 
> >> self-contained.
> > Oh well, not really.  You're moving a config-time check to compile time
> > which means that it will be done every time this Makefile is executed
> > and for all architectures that execute it.  Not nice.
> >
> > Also I think that ia64 is missing from the list, but I may be wrong.
> 
> In commit d52eefb47d (ia64/xen: Remove Xen support for ia64), XEN is
> not supported anymore on ia64 now.
> 
> >
> > Not to mention the fact that the dependency will be rather difficult to find
> > for tools like xconfig ...
> 
> I also think introducing a CONFIG_ option is a better idea.

Me too
diff mbox

Patch

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index b812462..a31cd29 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -253,4 +253,8 @@  config XEN_EFI
     def_bool y
     depends on X86_64 && EFI
 
+config XEN_ACPI
+    def_bool y
+    depends on X86 && ACPI
+
 endmenu
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index 2ccd359..f4622ab 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -13,7 +13,7 @@  CFLAGS_efi.o                += -fshort-wchar
 
 dom0-$(CONFIG_PCI) += pci.o
 dom0-$(CONFIG_USB_SUPPORT) += dbgp.o
-dom0-$(CONFIG_ACPI) += acpi.o $(xen-pad-y)
+dom0-$(CONFIG_XEN_ACPI) += acpi.o $(xen-pad-y)
 xen-pad-$(CONFIG_X86) += xen-acpi-pad.o
 dom0-$(CONFIG_X86) += pcpu.o
 obj-$(CONFIG_XEN_DOM0)            += $(dom0-y)