[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Wed, 27 Apr 2022 02:56:47 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=+eiHFMmyAILD3D274G2StM4c98d3voMhn9ruOzklON8=; b=FxlkGlyAQ5DPobpSycKLkLyMKGKfsuHeUKtuCY9uTNPVbscYE1vygqvHy1QTi9PGNg/wA8Cxz//maC4EbyWdMds6FmtYfwCjwbesqroYOxQB7WzWHiIIuDZfKXlgqlQcX2PQsj5Lwes731wlvhIYwR/rM0sRyvURSMoGnU61rqkOxocC4Fful9FY94RtP6JYbEDDfvvP2Vm+uIVQUk4PSwcZc9IzCacXVI3+1FvtlxGUcRrljoDjP2pqG6ceuiGCtkAq5JEPRpYzm3JQex+UiSIaoq/g/IB6SapaI6lIjUbE7HBbI/VJZwWPxzN4/nCs6bZdLEKF6Y3R9h39lJ40GQ==
  • 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=+eiHFMmyAILD3D274G2StM4c98d3voMhn9ruOzklON8=; b=EqMvgq17B8ICDG7ZkZx9p8+9ElNmJpi6jY9sPjKaOgbJTYdEqAmajhL7xgjfjP/7qKT9YK/bvDxUDuaTAoEF664hb6Og08bfKLK9myEBDVffGDKyJQJ+LJtl/Th1A7aSSAxVhL5Kv1WDsKetLosoJ64mIAGtEN2/LyxS3R28HJ5Fx2Iv2BpXeQttvghHEpbHqePMSeiy10bQ8mibvVHqSKvJAuwHKwauX4IyvO7132YrhgvxhD2tbsUgAj9YjogBN9DUHO9+ctiiLbuJ1RPw+8waapZXTn8Kpld9t2TQgkpnrV3SxMbB8QSYwTG9o43bT2/fdAIsdSzWP+wiqsLEMQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ZGr+4liXdb4ROwukegBJSPuvtq3fqY0mGWmBEd9TmEYx6y65YLpQQYT4OcOn5SGUugmI2AZ5vGj3e5LK3Y/rEF9hWpIBqi6UJ5CWUxlWIQnNJswAnm34Pl8fP+MShOSMDzS7KOmJqFLE//VoFaXTNnStvxlUz+aObCwbQ2zJWMKDSZ1qMHMstZf7Ho71OhOy1JZFO4H1eCo0sssxt0xc9xWNvlrNwtrCkgjkol2O3IT4altq5ALBUzBEIBGJLuU9MfkO+EzjuqchA+eQ17LFk27lhVPYnvEsMp/7f85JbBf7uHNjMYaGY42DJwJ71Wkx72tow4eYhqErJ/NbGCIm2g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E7aHnPdJoazaEZdN8bq6xfGG5U449DmZws6qM1GSoRpciLs2ULZ7kjyqN7E4tibRUlqQKvL/dYfprL/y53pIc2FrmNkH6xh0Cz/hqqZkfnJhQPInc7sP2y22+b+6J2KbpPL86yiQfve1eX9+74HB8U/XPO24Es0YzAovKtFHeAcueqh3dFg9qdY+9CPmhHGs1xSsYdn9HW/SfFLMrkXrxaYaZqxGQlTDwuQUByZRJ3EZNeOTiXCUfwM1euumN8m1iofOJ/UBmH77pw9mVUA4SFXm6vJ4u9prRF3whuAmVmRFI8OPJ4fsI5KEO0iRfDetfZS8DsLR0W3QkdeqW3U23g==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: nd <nd@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 27 Apr 2022 02:57:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYUwP3lRK/2WFhVk685C9kDsNXZq0B8EgAgAAdAwCAAEFBgIAAx9fQ
  • Thread-topic: [PATCH v2 02/10] xen/x86: move reusable EFI stub functions from x86 to common

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 2022年4月26日 22:31
> To: Wei Chen <Wei.Chen@xxxxxxx>
> Cc: nd <nd@xxxxxxx>; Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; Roger Pau
> Monné <roger.pau@xxxxxxxxxx>; Wei Liu <wl@xxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2 02/10] xen/x86: move reusable EFI stub functions
> from x86 to common
> 
> On 26.04.2022 12:37, Wei Chen wrote:
> > On 2022/4/26 16:53, Jan Beulich wrote:
> >> 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.
> >>
> >
> > How about using stub-arch.c to indicate this stub file only contains
> > the arch specific contents? However, we cannot predict what link files
> > will be created in this directory in the future. If someone needs to
> > create a stub-arch.c link file in the future, can we solve it at that
> > time?  Or do you have any suggestions?
> 
> I did provide my suggestion. I do not like stub-arch.c any better than
> stub-x86.c or stub-common.c.
> 

With my limited English level, I can only see that you don't like this, but
I can't get what you want clearly from your comments. I can only guess:
For "x86 file wants to simply include the common one":
1. Did you mean, x86 still keeps it stub.c and includes all its original
   contents. The common/efi/stub.c link behavior will be ignored, because
   of x86 has a real stub.c? And common/efi/stub.c still can works for
   other architectures like Arm whom doesn't have a real stub.c?
   But in previous version's discussion, I had said I created a stub.c in
   Arm/efi, and copied Arm required functions from x86/efi/stub.c. But
   people didn't like it. If my guess is correct, I don't know what is
   the essential difference between the two approaches.
2. Keeps stub.c in x86/efi, and use it to include common/stub.c.
   I think this may not be the right understanding, but I can't think
   of any other understanding.
   And please forgive my limited reading level again!

> >>> --- /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.
> >>
> >
> > You're correct, I check the code, Arm doesn't need above two
> > compat functions. I will restore them to x86 specific file.
> >
> >> 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.
> >>
> >
> > Yes, but I didn't deliberately ignore your comment from the last
> > series. I also hesitated for a while when constructing this patch.
> > I felt that this independent work, maybe it would be better to use
> > an independent patch.
> 
> Well, it of course depends on further aspects. If it had been clear
> that what is moved is actually going to be wired up, this being a
> standalone patch would be okay-ish. But with this unclear (and, as
> per above, actually having gone too far) it's imo better to move
> things as they get re-used.
> 

Ok, I understand it now.

Thanks,
Wei Chen

> Jan


 


Rackspace

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