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

[PATCH 04/11] xen/platform_op: Wrap around XENPF_firmware_info


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jiqian Chen <Jiqian.Chen@xxxxxxx>
  • Date: Fri, 25 Jul 2025 14:15:23 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=gAL+xqL35bIe5J2w9qcpDdUvbMX7wPcjZi5f8A3G+Dc=; b=k7NMaRnrs1xljLgH4V23zEIjadPaFCBMQFst2f6yjJEHNsCWW0pZUrYaTxCuwLyerYK4nuiQw/2h0ofdJijnvhbq5Zprnf6XLFQHUP3G22lKm2MdjXL9GgLR1b14QejkV+EZ0kH3MdZDz+zgn4LLCH1uqrUGm9oO+8yFfXpVv0vhv+dD7fRUQtYd+hG9zsz7FmGB3FDrdlrbLCetdQHyif+e9WPKDDGuOnj3gY/ptAsPcmm8UNJQJ+5lENAzXwEZCwwI6t8OSgE2+/E8Bfmt4yOr7HaLuZLWf6EH2zLF7R9IbkVEA5mINNWzbIu1TMe32WHXCkTNrIUy7xxSmlM0rg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bsXeIUKC73sL1E22cDKJrtI9FtBE/nqFCwl1Dav4jR61JHmBIg3SoE2q+0eTx2qqBj6G8O++KvNermuy7GtkIIDdE+eFk0mnVIogm0P5LhPe5eJqYdUqzktc7mRcy0VYZTzfM66TbUuQcBl63Ol785J09Wr8nkOiQ6s1XmiJxCMbc2s/67YlY8f+sQZKh2m1qEG/nqdRqpAuY10shVaxdGj62UejJK6tAgWLlpGsUZjdXCOmv6oqU0KEUINU2BEQtU+X54O0DnYPw1A8jEO3IH/Lsbs6gem5qh4do+SrMw/WTrQNL+rCwPPuZ4HRrHt/jbNG6sc3cM0F2douckVr+A==
  • Cc: Huang Rui <ray.huang@xxxxxxx>, Jiqian Chen <Jiqian.Chen@xxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Fri, 25 Jul 2025 06:16:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

efi_get_info() is only used for XEN_FW_EFI_INFO of XENPF_firmware_info,
so wrap it.
And wrap its compat function efi_compat_get_info().

Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
---
cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
cc: "Marek Marczykowski-Górecki" <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
cc: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/common/efi/common-stub.c | 4 ++++
 xen/common/efi/compat.c      | 2 ++
 xen/common/efi/runtime.c     | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/xen/common/efi/common-stub.c b/xen/common/efi/common-stub.c
index 77f138a6c574..05a84c60fb70 100644
--- a/xen/common/efi/common-stub.c
+++ b/xen/common/efi/common-stub.c
@@ -21,10 +21,12 @@ unsigned long efi_get_time(void)
 void efi_halt_system(void) { }
 void efi_reset_system(bool warm) { }
 
+#ifdef CONFIG_PLATFORM_OP
 int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
 {
     return -ENOSYS;
 }
+#endif /* CONFIG_PLATFORM_OP */
 
 int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 {
@@ -33,8 +35,10 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 
 #ifdef CONFIG_COMPAT
 
+#ifdef CONFIG_PLATFORM_OP
 int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *)
     __attribute__((__alias__("efi_get_info")));
+#endif /* CONFIG_PLATFORM_OP */
 
 int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *)
     __attribute__((__alias__("efi_runtime_call")));
diff --git a/xen/common/efi/compat.c b/xen/common/efi/compat.c
index 7cc6279b8f36..4f5f59fcac2e 100644
--- a/xen/common/efi/compat.c
+++ b/xen/common/efi/compat.c
@@ -1,8 +1,10 @@
 #include <xen/guest_access.h>
 #include <compat/platform.h>
 
+#ifdef CONFIG_PLATFORM_OP
 #define efi_get_info efi_compat_get_info
 #define xenpf_efi_info compat_pf_efi_info
+#endif
 
 #define efi_runtime_call efi_compat_runtime_call
 #define xenpf_efi_runtime_call compat_pf_efi_runtime_call
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 7e1fce291d92..ab63785397e2 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -227,6 +227,8 @@ const CHAR16 *wmemchr(const CHAR16 *s, CHAR16 c, UINTN n)
 #endif /* COMPAT */
 
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
+
+#ifdef CONFIG_PLATFORM_OP
 int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
 {
     unsigned int i, n;
@@ -325,6 +327,7 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
 
     return 0;
 }
+#endif /* CONFIG_PLATFORM_OP */
 
 static long gwstrlen(XEN_GUEST_HANDLE_PARAM(CHAR16) str)
 {
-- 
2.34.1




 


Rackspace

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