[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 02/10] xen/x86: move reusable EFI stub functions from x86 to common


  • To: Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 26 Apr 2022 10:53:54 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mQoK8qMH+pmcRX0aCwjGFUHjI0xneEzZZ2wQfZ8XyL8=; b=D+dZOKM3XbywCz2DIH7bclVJxEJQ3/PJwUXCChetyGqSM01FmPT/va9W8+QCCZNhl2YkzuUPGsWtOkUjkLknlqdwlK9oE2N0qX9Ccwcnv4X/jB80WyJ8Hh1LMVpVtolioXc1O9vuCDY+2Nm3JQvZkUHyUwBUCvzMBN5PI9/1QdLgKcRr6U1D5Q2itLfagChoT1HG1ZxEx3/+H7Ughx4S7bSHMak1fULsRl3OULgU34V4EQvnyR6efhfmjBlGMVN6jD2e1hX33z5Hq7u/1+cCol5K3OFUUmQ7GZeFmqD2cZOf6kLe9rDL/jAqMf21DgDx1q4q/Kv3dUGW5nHzSeyxCw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C8QUhMGQKATdgz7yWpH5NlZZbnsOhBQqsU2qhsoAcAy6MmU80U3pYtqn1UU0cnPttmopBF2PZXlnyunuqqRQ7Nk0iYM+tYc/bVZdiWTSxMLdNKOnL4q+xr+abvP67dY8OQZ9MH7ATtUC6hbSieGvR5+C3gUR0LmZeIFYqxRebgGARVpMYRtv/XR+gUoCSuL1JbilwqXEdu/XAmBbaH3JjfXrrh02ILn3V9JMZhxTb2psqae2wL13elgRUqKjlnByb+KQn36U8RWGpGsG++doOSugVCJmNY4Ja4KQX2Rq84Q2CGpW8YJxz4Ptmuugk15sta4gsmNCdLdoDAhjiWSG2g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: nd@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 26 Apr 2022 08:54:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.04.2022 11:07, Wei Chen wrote:
> 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

I'm not happy to see a file named *x86*.[ch] under x86/. I think the
x86 file wants to simply include the common one (and the symlinking
be suppressed when a real file already exists). Naming the common
file stub-common.c wouldn't help, as a similar anomaly would result.

> --- /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")));

I doubt you need this outside of x86.

> +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")));

Same here.

Even for the non-compat variants the need is un-obvious: Are you
intending to wire these up anywhere in Arm or common code? This
of course is once again pointing out that such code movement would
better be done when the new consumers actually appear, such that
it's clear why the movement is done - for every individual item.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.