All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: ehem+xen@m5p.com, Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Wei Liu <wl@xen.org>
Subject: [PATCH RFC 3/3] xen: Introduce a platform sub-op to retrieve the VGA information
Date: Sun,  6 Feb 2022 19:28:39 +0000	[thread overview]
Message-ID: <20220206192839.75711-4-julien@xen.org> (raw)
In-Reply-To: <20220206192839.75711-1-julien@xen.org>

From: Julien Grall <jgrall@amazon.com>

When using EFI, the VGA information is fetched using the EFI
boot services. However, Xen will have exited the boot services.
Therefore, we need to find a different way to pass the information
to dom0.

For PV dom0, they are part of the start_info. But this is not
something that exists on Arm. So the best way would to be to
use a hypercall.

For now the structure layout is based on dom0_vga_console_info
for convenience. I am open on another proposal.

Signed-off-by: Julien Grall <jgrall@amazon.com>

----

TODO:
    - Check the structure size has not changed (I would like to
      avoid bumping the platform interface).
---
 xen/arch/arm/platform_hypercall.c | 15 +++++++++++++++
 xen/include/public/platform.h     |  2 ++
 2 files changed, 17 insertions(+)

diff --git a/xen/arch/arm/platform_hypercall.c b/xen/arch/arm/platform_hypercall.c
index 8efac7ee602a..78ad328e2ab8 100644
--- a/xen/arch/arm/platform_hypercall.c
+++ b/xen/arch/arm/platform_hypercall.c
@@ -10,6 +10,7 @@
 #include <xen/sched.h>
 #include <xen/guest_access.h>
 #include <xen/spinlock.h>
+#include <xen/vga.h>
 #include <public/platform.h>
 #include <xsm/xsm.h>
 #include <asm/current.h>
@@ -58,6 +59,20 @@ long do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
             ret = -EINVAL;
         break;
 
+    case XENPF_firmware_info:
+        switch ( op->u.firmware_info.type )
+        {
+        case XEN_FW_VGA_INFO:
+            BUILD_BUG_ON(sizeof(op->u.firmware_info.u.vga) !=
+                         sizeof(vga_console_info));
+            memcpy(&op->u.firmware_info.u.vga, &vga_console_info,
+                   sizeof(vga_console_info));
+            if ( __copy_to_guest(u_xenpf_op, op, 1) )
+                ret = -EFAULT;
+            break;
+        }
+        break;
+
     default:
         ret = -ENOSYS;
         break;
diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index a4c0eb62249a..4de42ce6cbc5 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -244,6 +244,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtime_call_t);
 #define  XEN_FW_EFI_PCI_ROM        5
 #define  XEN_FW_EFI_APPLE_PROPERTIES 6
 #define XEN_FW_KBD_SHIFT_FLAGS    5
+#define XEN_FW_VGA_INFO           6
 struct xenpf_firmware_info {
     /* IN variables. */
     uint32_t type;
@@ -311,6 +312,7 @@ struct xenpf_firmware_info {
 
         /* Int16, Fn02: Get keyboard shift flags. */
         uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */
+        struct dom0_vga_console_info vga;
     } u;
 };
 typedef struct xenpf_firmware_info xenpf_firmware_info_t;
-- 
2.32.0



  parent reply	other threads:[~2022-02-06 19:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-06 19:28 [PATCH RFC 0/3] xen/arm: Allow dom0 to use the EFI framebuffer Julien Grall
2022-02-06 19:28 ` [PATCH RFC 1/3] xen/efi: Always query the console information and get GOP Julien Grall
2022-02-07  8:46   ` Jan Beulich
2022-02-07 18:52     ` Julien Grall
2022-02-08 10:22       ` Jan Beulich
2022-02-12  1:33       ` Elliott Mitchell
2022-02-12 13:10         ` Julien Grall
2022-02-12 18:20           ` Elliott Mitchell
2022-02-12 18:54             ` Julien Grall
2022-02-23 18:50     ` Julien Grall
2022-02-06 19:28 ` [PATCH RFC 2/3] xen/arm: efi: Introduce and fill the vga_console_info Julien Grall
2022-02-07  8:53   ` Jan Beulich
2022-02-07 18:55     ` Julien Grall
2022-02-09  2:12   ` Stefano Stabellini
2022-02-06 19:28 ` Julien Grall [this message]
2022-02-07  8:57   ` [PATCH RFC 3/3] xen: Introduce a platform sub-op to retrieve the VGA information Jan Beulich
2022-02-07 11:58     ` Roger Pau Monné
2022-02-07 12:44       ` Jan Beulich
2022-02-07 19:24       ` Julien Grall
2022-02-08  9:50         ` Roger Pau Monné
2022-02-07  8:35 ` [PATCH RFC 0/3] xen/arm: Allow dom0 to use the EFI framebuffer Jan Beulich

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=20220206192839.75711-4-julien@xen.org \
    --to=julien@xen.org \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=ehem+xen@m5p.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgrall@amazon.com \
    --cc=sstabellini@kernel.org \
    --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.