[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: Tue, 26 Apr 2022 18:37:44 +0800
- 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=Z1FOdQPbwu+U7H+tA7xv7lJ1j2B+Y3tQm4KthetOVbg=; b=XQP4++EmpR63ScxCUSlc2yLlyxD/jEX5kNddTI4b1rJFmyTfHxfrNmB6HmlUCX/pu2HnRpbYqKXQ5LGp+n6PUipxnOAunmLX8BjaGeRpYpHKgdpOa5NOjDzd1nsf61kIGh+qMrJUTwHmR1O8hiC0WAnjP08LI7fvS0LnqkHyRroq5+vUgZqQluGUir5PoRJA8oOUk4UQQQ9dPKzCbFFojom9sDmkCoelqYuxXij9896qjwjX/OtzzXvsnGNriJsYzM7lzi29aDhjcmrg1uP91Ffs567p/BdydO0FNJlUuBlxBP8GtDCf/ttIM0Gu6Ocjnqsy496Ul+GXxZ4xs+7eGQ==
- 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=Z1FOdQPbwu+U7H+tA7xv7lJ1j2B+Y3tQm4KthetOVbg=; b=JHSRFFkOQCX+5a54aBHV4NYUFMx+Cj6HjHg0jta9sFay7fp03jRz20WXc0RQzMfBQVbQ232WmdqIyI4Jy0+CWiwro36MORmGg1elSya0hWUV8JjXqFo5YgQjimZj2iqJrmPmQInnoOksmsu1PTUod1VPGURiQVDJ1VUArfrPZSpzAqznoNfZ/JxkNcwwSUF8LOd+5cXR9xK+9T4ohsRaKkIN/oz6tl2xFERGI9OONw7ZiNKI/gOhtTUXhlkjQv39bxal844hU47NsPLqUGoUrCF5IaUSGoWugFDgXxOiriUyT5qMcM/Lyp1e1E0TOyoMv+LqN6w8806/nuDgk+RTPA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=SZTIuKZKyyV/DEcTdQtLzpMWS0tXCxML5g6aeQnQa8qiHwDuynIzQsu5pYtbzPKRJXkRSpooDpmdy672eVvzlf5BX0xR0AIUuUH1PgN/gQ8aQnUjNH6fOsj0Lg0SVtomuYxe8i231Bf0vqcYYbt43SWNTs7FpDcZy038roHc9c7lvUS7PE+i0tmJzTfRsmhEPxd9bWOIPy2VaAv7qHdddnAMjLp/fQ1TcQmt0lzIrHrnEJpQtYKbSGSCtHbVkbPIwmlyfnEiYFRa4PgbZgvHH3bHhd1TAY8wf7+kXJTD0DrRyob9dNqjkVQfm+YENhb6mb31LxWtmwxMR3BBU+oYhg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=InSCoix0qvmQbZO9tr4sojLYqyoQWWy9yvdbqUmu7Ib8gtJ2QdW5GmFciePSEsXKVRhUSVGt553YgkPFgL2hGzAe66K2Sb1tiBTs2r5HvptZjo4eWTK6fvbzZ7dFeQEblJqImZUHqbKgracxKD9sfs0/z6AaAkcTl4YAyhNfn/DVZzZ/InKzALIe5fI9m9eC1wPvqrFHbdPZJfpNwfBkN1DY8jNFKlagONl6KzSY7gNYAxrcFQBq89pRcJ3Iv2wJlVEThwUHWKmEreAS2QeaO7K/fZOies1u44ROdNLF0q4CGoaMYP9TXQZZRPYZ8vpWTdc0HT/foyuLVFPfnKyUtA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.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 10:38:13 +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;
Hi Jan,
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?
--- /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.
I will merge patch3 with it, indicating that this movement is to
share the EFI stub for Arm.
Thanks,
Wei Che
Jan
|