All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Wei Chen <wei.chen@arm.com>
Cc: xen-devel@lists.xenproject.org, nd@arm.com,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: Re: [PATCH v2 02/10] xen/x86: move reusable EFI stub functions from x86 to common
Date: Wed, 20 Apr 2022 17:17:47 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2204201717320.915916@ubuntu-linux-20-04-desktop> (raw)
In-Reply-To: <20220418090735.3940393-3-wei.chen@arm.com>

On Mon, 18 Apr 2022, Wei Chen wrote:
> Most of the functions in x86 EFI stub.c can be reused for other
> architectures. So we move them to common and keep the x86 specific
> function in stub-x86.c.
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> v1 -> v2:
> 1. Drop the copy of stub.c from Arm EFI.
> 2. Share common codes of x86 EFI stub for other architectures.
> ---
>  xen/arch/x86/efi/Makefile               |  4 +--
>  xen/arch/x86/efi/{stub.c => stub-x86.c} | 37 ------------------------
>  xen/common/efi/stub.c                   | 38 +++++++++++++++++++++++++
>  3 files changed, 40 insertions(+), 39 deletions(-)
>  rename xen/arch/x86/efi/{stub.c => stub-x86.c} (71%)
>  create mode 100644 xen/common/efi/stub.c
> 
> diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
> index 034ec87895..5ca3a0b4a4 100644
> --- a/xen/arch/x86/efi/Makefile
> +++ b/xen/arch/x86/efi/Makefile
> @@ -11,8 +11,8 @@ $(obj)/boot.init.o: $(obj)/buildid.o
>  $(call cc-option-add,cflags-stack-boundary,CC,-mpreferred-stack-boundary=4)
>  $(addprefix $(obj)/,$(EFIOBJ-y)): CFLAGS_stack_boundary := $(cflags-stack-boundary)
>  
> -obj-y := stub.o
> +obj-y := stub.o stub-x86.o
>  obj-$(XEN_BUILD_EFI) := $(filter-out %.init.o,$(EFIOBJ-y))
>  obj-bin-$(XEN_BUILD_EFI) := $(filter %.init.o,$(EFIOBJ-y))
>  extra-$(XEN_BUILD_EFI) += buildid.o relocs-dummy.o
> -nocov-$(XEN_BUILD_EFI) += stub.o
> +nocov-$(XEN_BUILD_EFI) += stub.o stub-x86.o
> diff --git a/xen/arch/x86/efi/stub.c b/xen/arch/x86/efi/stub-x86.c
> similarity index 71%
> rename from xen/arch/x86/efi/stub.c
> rename to xen/arch/x86/efi/stub-x86.c
> index 9984932626..2cd5c8d4dc 100644
> --- a/xen/arch/x86/efi/stub.c
> +++ b/xen/arch/x86/efi/stub-x86.c
> @@ -1,7 +1,5 @@
>  #include <xen/efi.h>
> -#include <xen/errno.h>
>  #include <xen/init.h>
> -#include <xen/lib.h>
>  #include <asm/asm_defns.h>
>  #include <asm/efibind.h>
>  #include <asm/page.h>
> @@ -45,11 +43,6 @@ void __init noreturn efi_multiboot2(EFI_HANDLE ImageHandle,
>      unreachable();
>  }
>  
> -bool efi_enabled(unsigned int feature)
> -{
> -    return false;
> -}
> -
>  void __init efi_init_memory(void) { }
>  
>  bool efi_boot_mem_unused(unsigned long *start, unsigned long *end)
> @@ -61,33 +54,3 @@ bool efi_boot_mem_unused(unsigned long *start, unsigned long *end)
>  }
>  
>  void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) { }
> -
> -bool efi_rs_using_pgtables(void)
> -{
> -    return false;
> -}
> -
> -unsigned long efi_get_time(void)
> -{
> -    BUG();
> -    return 0;
> -}
> -
> -void efi_halt_system(void) { }
> -void efi_reset_system(bool warm) { }
> -
> -int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
> -{
> -    return -ENOSYS;
> -}
> -
> -int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *)
> -    __attribute__((__alias__("efi_get_info")));
> -
> -int efi_runtime_call(struct xenpf_efi_runtime_call *op)
> -{
> -    return -ENOSYS;
> -}
> -
> -int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *)
> -    __attribute__((__alias__("efi_runtime_call")));
> diff --git a/xen/common/efi/stub.c b/xen/common/efi/stub.c
> new file mode 100644
> index 0000000000..6e4f4de9af
> --- /dev/null
> +++ b/xen/common/efi/stub.c
> @@ -0,0 +1,38 @@
> +#include <xen/efi.h>
> +#include <xen/errno.h>
> +#include <xen/lib.h>
> +
> +bool efi_enabled(unsigned int feature)
> +{
> +    return false;
> +}
> +
> +bool efi_rs_using_pgtables(void)
> +{
> +    return false;
> +}
> +
> +unsigned long efi_get_time(void)
> +{
> +    BUG();
> +    return 0;
> +}
> +
> +void efi_halt_system(void) { }
> +void efi_reset_system(bool warm) { }
> +
> +int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
> +{
> +    return -ENOSYS;
> +}
> +
> +int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *)
> +    __attribute__((__alias__("efi_get_info")));
> +
> +int efi_runtime_call(struct xenpf_efi_runtime_call *op)
> +{
> +    return -ENOSYS;
> +}
> +
> +int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *)
> +    __attribute__((__alias__("efi_runtime_call")));
> -- 
> 2.25.1
> 
> 


  reply	other threads:[~2022-04-21  0:18 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18  9:07 [PATCH v2 00/10] Device tree based NUMA support for Arm - Part#1 Wei Chen
2022-04-18  9:07 ` [PATCH v2 01/10] xen/arm: Print a 64-bit number in hex from early uart Wei Chen
2022-04-19  9:13   ` Jiamei Xie
2022-04-21  7:05     ` Wei Chen
2022-04-18  9:07 ` [PATCH v2 02/10] xen/x86: move reusable EFI stub functions from x86 to common Wei Chen
2022-04-21  0:17   ` Stefano Stabellini [this message]
2022-04-26  8:53   ` Jan Beulich
2022-04-26 10:37     ` Wei Chen
2022-04-26 14:31       ` Jan Beulich
2022-04-27  2:56         ` Wei Chen
2022-04-27  5:54           ` Jan Beulich
2022-04-27  6:26             ` Wei Chen
2022-04-18  9:07 ` [PATCH v2 03/10] xen/arm: add CONFIG_ARM_EFI to stub EFI API Wei Chen
2022-04-21  0:25   ` Stefano Stabellini
2022-04-21  7:01     ` Wei Chen
2022-04-21 21:35       ` Stefano Stabellini
2022-04-18  9:07 ` [PATCH v2 04/10] xen/arm: Keep memory nodes in device tree when Xen boots from EFI Wei Chen
2022-04-21  0:30   ` Stefano Stabellini
2022-04-18  9:07 ` [PATCH v2 05/10] xen/x86: Use ASSERT instead of VIRTUAL_BUG_ON for phys_to_nid Wei Chen
2022-04-21  0:37   ` Stefano Stabellini
2022-04-26  9:02   ` Jan Beulich
2022-04-26 10:59     ` Wei Chen
2022-04-26 14:42       ` Jan Beulich
2022-04-27  3:52         ` Wei Chen
2022-04-27  5:56           ` Jan Beulich
2022-04-27  6:27             ` Wei Chen
2022-04-18  9:07 ` [PATCH v2 06/10] xen: introduce an arch helper for default dma zone status Wei Chen
2022-04-19  9:18   ` Jan Beulich
2022-04-21  7:03     ` Wei Chen
2022-04-18  9:07 ` [PATCH v2 07/10] xen: decouple NUMA from ACPI in Kconfig Wei Chen
2022-04-18  9:07 ` [PATCH v2 08/10] xen/arm: use !CONFIG_NUMA to keep fake NUMA API Wei Chen
2022-04-18  9:07 ` [PATCH v2 09/10] xen/x86: use paddr_t for addresses in NUMA node structure Wei Chen
2022-04-26  9:11   ` Jan Beulich
2022-04-26 10:42     ` Wei Chen
2022-04-18  9:07 ` [PATCH v2 10/10] xen/x86: add detection of memory interleaves for different nodes Wei Chen
2022-04-26  9:20   ` Jan Beulich
2022-04-26 11:07     ` Wei Chen
2022-04-19  9:29 ` [PATCH v2 00/10] Device tree based NUMA support for Arm - Part#1 Wei Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.22.394.2204201717320.915916@ubuntu-linux-20-04-desktop \
    --to=sstabellini@kernel.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=nd@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.chen@arm.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.