diff mbox series

[v2,03/10] xen/arm: add CONFIG_ARM_EFI to stub EFI API

Message ID 20220418090735.3940393-4-wei.chen@arm.com (mailing list archive)
State Superseded
Headers show
Series Device tree based NUMA support for Arm - Part#1 | expand

Commit Message

Wei Chen April 18, 2022, 9:07 a.m. UTC
x86 is using compiler feature testing to decide EFI
build enable or not. When EFI build is disabled, x86
will use a efi/stub.c file to replace efi/runtime.c
for build objects. Following this idea, we introduce
a stub file for Arm, but use CONFIG_ARM_EFI to decide
EFI build enable or not.

Signed-off-by: Wei Chen <wei.chen@arm.com>
---
v1 -> v2:
1. Use CONFIG_ARM_EFI to replace CONFIG_EFI
2. Remove help text and make CONFIG_ARM_EFI invisible.
3. Merge one following patch:
   xen/arm: introduce a stub file for non-EFI architectures
4. Use the common stub.c instead of creating new one.
---
 xen/arch/arm/Kconfig      | 5 +++++
 xen/arch/arm/Makefile     | 2 +-
 xen/arch/arm/efi/Makefile | 5 +++++
 3 files changed, 11 insertions(+), 1 deletion(-)

Comments

Stefano Stabellini April 21, 2022, 12:25 a.m. UTC | #1
On Mon, 18 Apr 2022, Wei Chen wrote:
> x86 is using compiler feature testing to decide EFI
> build enable or not. When EFI build is disabled, x86
> will use a efi/stub.c file to replace efi/runtime.c
> for build objects. Following this idea, we introduce
> a stub file for Arm, but use CONFIG_ARM_EFI to decide
> EFI build enable or not.
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
> v1 -> v2:
> 1. Use CONFIG_ARM_EFI to replace CONFIG_EFI
> 2. Remove help text and make CONFIG_ARM_EFI invisible.
> 3. Merge one following patch:
>    xen/arm: introduce a stub file for non-EFI architectures
> 4. Use the common stub.c instead of creating new one.
> ---
>  xen/arch/arm/Kconfig      | 5 +++++
>  xen/arch/arm/Makefile     | 2 +-
>  xen/arch/arm/efi/Makefile | 5 +++++
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index ecfa6822e4..5f1b0121b0 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -6,6 +6,7 @@ config ARM_64
>  	def_bool y
>  	depends on !ARM_32
>  	select 64BIT
> +	select ARM_EFI
>  	select HAS_FAST_MULTIPLY
>  
>  config ARM
> @@ -33,6 +34,10 @@ config ACPI
>  	  Advanced Configuration and Power Interface (ACPI) support for Xen is
>  	  an alternative to device tree on ARM64.
>  
> +config ARM_EFI
> +	bool
> +	depends on ARM_64

As ARM_EFI is selected by ARM_64 and it cannot be enable via a menu (it
is hidden) there is no need for the "depends" line here


>  config GICV3
>  	bool "GICv3 driver"
>  	depends on ARM_64 && !NEW_VGIC
> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
> index 1d862351d1..bb7a6151c1 100644
> --- a/xen/arch/arm/Makefile
> +++ b/xen/arch/arm/Makefile
> @@ -1,6 +1,5 @@
>  obj-$(CONFIG_ARM_32) += arm32/
>  obj-$(CONFIG_ARM_64) += arm64/
> -obj-$(CONFIG_ARM_64) += efi/
>  obj-$(CONFIG_ACPI) += acpi/
>  obj-$(CONFIG_HAS_PCI) += pci/
>  ifneq ($(CONFIG_NO_PLAT),y)
> @@ -20,6 +19,7 @@ obj-y += domain.o
>  obj-y += domain_build.init.o
>  obj-y += domctl.o
>  obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
> +obj-y += efi/
>  obj-y += gic.o
>  obj-y += gic-v2.o
>  obj-$(CONFIG_GICV3) += gic-v3.o
> diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile
> index 4313c39066..75ef180233 100644
> --- a/xen/arch/arm/efi/Makefile
> +++ b/xen/arch/arm/efi/Makefile
> @@ -1,4 +1,9 @@
>  include $(srctree)/common/efi/efi-common.mk
>  
> +ifeq ($(CONFIG_ARM_EFI),y)
>  obj-y += $(EFIOBJ-y)
>  obj-$(CONFIG_ACPI) +=  efi-dom0.init.o
> +else
> +EFIOBJ-y += stub.o
> +obj-y += stub.o

The change to EFIOBJ-y is not needed here as EFIOBJ-y is not used.
Only obj-y += stub.o should be enough

> +endif
> -- 
> 2.25.1
>
Wei Chen April 21, 2022, 7:01 a.m. UTC | #2
Hi Stefano,

On 2022/4/21 8:25, Stefano Stabellini wrote:
> On Mon, 18 Apr 2022, Wei Chen wrote:
>> x86 is using compiler feature testing to decide EFI
>> build enable or not. When EFI build is disabled, x86
>> will use a efi/stub.c file to replace efi/runtime.c
>> for build objects. Following this idea, we introduce
>> a stub file for Arm, but use CONFIG_ARM_EFI to decide
>> EFI build enable or not.
>>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> ---
>> v1 -> v2:
>> 1. Use CONFIG_ARM_EFI to replace CONFIG_EFI
>> 2. Remove help text and make CONFIG_ARM_EFI invisible.
>> 3. Merge one following patch:
>>     xen/arm: introduce a stub file for non-EFI architectures
>> 4. Use the common stub.c instead of creating new one.
>> ---
>>   xen/arch/arm/Kconfig      | 5 +++++
>>   xen/arch/arm/Makefile     | 2 +-
>>   xen/arch/arm/efi/Makefile | 5 +++++
>>   3 files changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index ecfa6822e4..5f1b0121b0 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -6,6 +6,7 @@ config ARM_64
>>   	def_bool y
>>   	depends on !ARM_32
>>   	select 64BIT
>> +	select ARM_EFI
>>   	select HAS_FAST_MULTIPLY
>>   
>>   config ARM
>> @@ -33,6 +34,10 @@ config ACPI
>>   	  Advanced Configuration and Power Interface (ACPI) support for Xen is
>>   	  an alternative to device tree on ARM64.
>>   
>> +config ARM_EFI
>> +	bool
>> +	depends on ARM_64
> 
> As ARM_EFI is selected by ARM_64 and it cannot be enable via a menu (it
> is hidden) there is no need for the "depends" line here
> 

Ok, I will remove it.

> 
>>   config GICV3
>>   	bool "GICv3 driver"
>>   	depends on ARM_64 && !NEW_VGIC
>> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
>> index 1d862351d1..bb7a6151c1 100644
>> --- a/xen/arch/arm/Makefile
>> +++ b/xen/arch/arm/Makefile
>> @@ -1,6 +1,5 @@
>>   obj-$(CONFIG_ARM_32) += arm32/
>>   obj-$(CONFIG_ARM_64) += arm64/
>> -obj-$(CONFIG_ARM_64) += efi/
>>   obj-$(CONFIG_ACPI) += acpi/
>>   obj-$(CONFIG_HAS_PCI) += pci/
>>   ifneq ($(CONFIG_NO_PLAT),y)
>> @@ -20,6 +19,7 @@ obj-y += domain.o
>>   obj-y += domain_build.init.o
>>   obj-y += domctl.o
>>   obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
>> +obj-y += efi/
>>   obj-y += gic.o
>>   obj-y += gic-v2.o
>>   obj-$(CONFIG_GICV3) += gic-v3.o
>> diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile
>> index 4313c39066..75ef180233 100644
>> --- a/xen/arch/arm/efi/Makefile
>> +++ b/xen/arch/arm/efi/Makefile
>> @@ -1,4 +1,9 @@
>>   include $(srctree)/common/efi/efi-common.mk
>>   
>> +ifeq ($(CONFIG_ARM_EFI),y)
>>   obj-y += $(EFIOBJ-y)
>>   obj-$(CONFIG_ACPI) +=  efi-dom0.init.o
>> +else
>> +EFIOBJ-y += stub.o
>> +obj-y += stub.o
> 
> The change to EFIOBJ-y is not needed here as EFIOBJ-y is not used.
> Only obj-y += stub.o should be enough
> 

I add stub.o to EFIOBJ-y that's because I want to use the clean-files
in efi-common.mk. Otherwise the link of stub.c in arm/efi will not
be cleaned in "make clean".

>> +endif
>> -- 
>> 2.25.1
>>
Stefano Stabellini April 21, 2022, 9:35 p.m. UTC | #3
On Thu, 21 Apr 2022, Wei Chen wrote:
> Hi Stefano,
> 
> On 2022/4/21 8:25, Stefano Stabellini wrote:
> > On Mon, 18 Apr 2022, Wei Chen wrote:
> > > x86 is using compiler feature testing to decide EFI
> > > build enable or not. When EFI build is disabled, x86
> > > will use a efi/stub.c file to replace efi/runtime.c
> > > for build objects. Following this idea, we introduce
> > > a stub file for Arm, but use CONFIG_ARM_EFI to decide
> > > EFI build enable or not.
> > > 
> > > Signed-off-by: Wei Chen <wei.chen@arm.com>
> > > ---
> > > v1 -> v2:
> > > 1. Use CONFIG_ARM_EFI to replace CONFIG_EFI
> > > 2. Remove help text and make CONFIG_ARM_EFI invisible.
> > > 3. Merge one following patch:
> > >     xen/arm: introduce a stub file for non-EFI architectures
> > > 4. Use the common stub.c instead of creating new one.
> > > ---
> > >   xen/arch/arm/Kconfig      | 5 +++++
> > >   xen/arch/arm/Makefile     | 2 +-
> > >   xen/arch/arm/efi/Makefile | 5 +++++
> > >   3 files changed, 11 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> > > index ecfa6822e4..5f1b0121b0 100644
> > > --- a/xen/arch/arm/Kconfig
> > > +++ b/xen/arch/arm/Kconfig
> > > @@ -6,6 +6,7 @@ config ARM_64
> > >   	def_bool y
> > >   	depends on !ARM_32
> > >   	select 64BIT
> > > +	select ARM_EFI
> > >   	select HAS_FAST_MULTIPLY
> > >     config ARM
> > > @@ -33,6 +34,10 @@ config ACPI
> > >   	  Advanced Configuration and Power Interface (ACPI) support for Xen is
> > >   	  an alternative to device tree on ARM64.
> > >   +config ARM_EFI
> > > +	bool
> > > +	depends on ARM_64
> > 
> > As ARM_EFI is selected by ARM_64 and it cannot be enable via a menu (it
> > is hidden) there is no need for the "depends" line here
> > 
> 
> Ok, I will remove it.
> 
> > 
> > >   config GICV3
> > >   	bool "GICv3 driver"
> > >   	depends on ARM_64 && !NEW_VGIC
> > > diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
> > > index 1d862351d1..bb7a6151c1 100644
> > > --- a/xen/arch/arm/Makefile
> > > +++ b/xen/arch/arm/Makefile
> > > @@ -1,6 +1,5 @@
> > >   obj-$(CONFIG_ARM_32) += arm32/
> > >   obj-$(CONFIG_ARM_64) += arm64/
> > > -obj-$(CONFIG_ARM_64) += efi/
> > >   obj-$(CONFIG_ACPI) += acpi/
> > >   obj-$(CONFIG_HAS_PCI) += pci/
> > >   ifneq ($(CONFIG_NO_PLAT),y)
> > > @@ -20,6 +19,7 @@ obj-y += domain.o
> > >   obj-y += domain_build.init.o
> > >   obj-y += domctl.o
> > >   obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
> > > +obj-y += efi/
> > >   obj-y += gic.o
> > >   obj-y += gic-v2.o
> > >   obj-$(CONFIG_GICV3) += gic-v3.o
> > > diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile
> > > index 4313c39066..75ef180233 100644
> > > --- a/xen/arch/arm/efi/Makefile
> > > +++ b/xen/arch/arm/efi/Makefile
> > > @@ -1,4 +1,9 @@
> > >   include $(srctree)/common/efi/efi-common.mk
> > >   +ifeq ($(CONFIG_ARM_EFI),y)
> > >   obj-y += $(EFIOBJ-y)
> > >   obj-$(CONFIG_ACPI) +=  efi-dom0.init.o
> > > +else
> > > +EFIOBJ-y += stub.o
> > > +obj-y += stub.o
> > 
> > The change to EFIOBJ-y is not needed here as EFIOBJ-y is not used.
> > Only obj-y += stub.o should be enough
> > 
> 
> I add stub.o to EFIOBJ-y that's because I want to use the clean-files
> in efi-common.mk. Otherwise the link of stub.c in arm/efi will not
> be cleaned in "make clean".

I see. Makes sense.
diff mbox series

Patch

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index ecfa6822e4..5f1b0121b0 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -6,6 +6,7 @@  config ARM_64
 	def_bool y
 	depends on !ARM_32
 	select 64BIT
+	select ARM_EFI
 	select HAS_FAST_MULTIPLY
 
 config ARM
@@ -33,6 +34,10 @@  config ACPI
 	  Advanced Configuration and Power Interface (ACPI) support for Xen is
 	  an alternative to device tree on ARM64.
 
+config ARM_EFI
+	bool
+	depends on ARM_64
+
 config GICV3
 	bool "GICv3 driver"
 	depends on ARM_64 && !NEW_VGIC
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 1d862351d1..bb7a6151c1 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -1,6 +1,5 @@ 
 obj-$(CONFIG_ARM_32) += arm32/
 obj-$(CONFIG_ARM_64) += arm64/
-obj-$(CONFIG_ARM_64) += efi/
 obj-$(CONFIG_ACPI) += acpi/
 obj-$(CONFIG_HAS_PCI) += pci/
 ifneq ($(CONFIG_NO_PLAT),y)
@@ -20,6 +19,7 @@  obj-y += domain.o
 obj-y += domain_build.init.o
 obj-y += domctl.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
+obj-y += efi/
 obj-y += gic.o
 obj-y += gic-v2.o
 obj-$(CONFIG_GICV3) += gic-v3.o
diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile
index 4313c39066..75ef180233 100644
--- a/xen/arch/arm/efi/Makefile
+++ b/xen/arch/arm/efi/Makefile
@@ -1,4 +1,9 @@ 
 include $(srctree)/common/efi/efi-common.mk
 
+ifeq ($(CONFIG_ARM_EFI),y)
 obj-y += $(EFIOBJ-y)
 obj-$(CONFIG_ACPI) +=  efi-dom0.init.o
+else
+EFIOBJ-y += stub.o
+obj-y += stub.o
+endif