From nobody Tue Feb 10 16:21:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1644175757; cv=none; d=zohomail.com; s=zohoarc; b=Iy6pLOeB91+QYpRLyZA8VKRlF8r0NgUFD1uk1/RLynyw4k8zPSHgJQzx1t1Aee+EMV9b/FugyURtFDT9VBQm3GsErSag72WBxU1ucdMwO/KSfPqpS41QBPq+h4C7bhWn21o0IYtKZ1gAGZkXcnTuXqBZ51XP78NuBVmO/NTMEJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644175757; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dwa+CM0UGV4Uyu3tQxS0S6kaMZiyK2FzF7bR+EHTABc=; b=Uc7+Zvgp9Gw2tZx5sYDIHC+xovfyMllgBYMcRAaz+97rP48Y3NGZDbjncRfvDv12kAiP60nEHboKMwBqA1Wt3lv/kBhaRhOIQ8hjYz7tc35Qmh8av9pAkfsX+lb+nj5Js6BCCB6MWHEQm4uPUuxqMoLr0rKmYyMHbJXa03oQTow= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1644175757363631.0784500432039; Sun, 6 Feb 2022 11:29:17 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.266316.460017 (Exim 4.92) (envelope-from ) id 1nGnDP-0002Lo-V2; Sun, 06 Feb 2022 19:28:51 +0000 Received: by outflank-mailman (output) from mailman id 266316.460017; Sun, 06 Feb 2022 19:28:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nGnDP-0002Lf-Qg; Sun, 06 Feb 2022 19:28:51 +0000 Received: by outflank-mailman (input) for mailman id 266316; Sun, 06 Feb 2022 19:28:50 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nGnDO-0002J7-OM for xen-devel@lists.xenproject.org; Sun, 06 Feb 2022 19:28:50 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nGnDM-0005t8-Ch; Sun, 06 Feb 2022 19:28:48 +0000 Received: from 54-240-197-224.amazon.com ([54.240.197.224] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nGnDM-0007Ok-4h; Sun, 06 Feb 2022 19:28:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=dwa+CM0UGV4Uyu3tQxS0S6kaMZiyK2FzF7bR+EHTABc=; b=ppyd+fukvMObK1Y2M4+VtmDg6w 3E8oAypWDgoe7HSHp252yR2ftQtXhjHOYNlRTy4MoqwvT51uHuVZLl9dB/ukzZCJH1NS+SvloMmQd Ptj9JPP1BFMPwyEdx/+W+vz5LmL8AvDtspb/bndh37q80j1sTFckn+2CWLZiMNoCFwdU=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: ehem+xen@m5p.com, Julien Grall , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Bertrand Marquis , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu 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 Message-Id: <20220206192839.75711-4-julien@xen.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220206192839.75711-1-julien@xen.org> References: <20220206192839.75711-1-julien@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1644175758238100002 Content-Type: text/plain; charset="utf-8" From: Julien Grall 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 ---- 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_hype= rcall.c index 8efac7ee602a..78ad328e2ab8 100644 --- a/xen/arch/arm/platform_hypercall.c +++ b/xen/arch/arm/platform_hypercall.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,20 @@ long do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_= op_t) u_xenpf_op) ret =3D -EINVAL; break; =20 + 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) !=3D + 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 =3D -EFAULT; + break; + } + break; + default: ret =3D -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 { =20 /* 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; --=20 2.32.0