/
0001-x86-platform-introduce-hypercall-to-get-initial-vide.patch
84 lines (77 loc) · 2.8 KB
/
0001-x86-platform-introduce-hypercall-to-get-initial-vide.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From 4dd160583c798d3a5a451ea74633836891d15354 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Date: Tue, 6 Dec 2022 13:53:43 +0100
Subject: [PATCH] x86/platform: introduce hypercall to get initial video
console settings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This is required so PVH dom0 can get the initial video console state
as handled by Xen. PV dom0 will get this as part of the start_info,
but it doesn't seem necessary to place such information in the
HVM start info.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
xen/arch/x86/platform_hypercall.c | 11 +++++++++++
xen/drivers/video/vga.c | 2 +-
xen/include/public/platform.h | 6 ++++++
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index a7341dc3d7..3f0d0389af 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -839,6 +839,17 @@ ret_t do_platform_op(
}
break;
+ case XENPF_get_dom0_console:
+ if ( !fill_console_start_info(&op->u.dom0_console) )
+ {
+ ret = -ENODEV;
+ break;
+ }
+
+ if ( copy_field_to_guest(u_xenpf_op, op, u.dom0_console) )
+ ret = -EFAULT;
+ break;
+
default:
ret = -ENOSYS;
break;
diff --git a/xen/drivers/video/vga.c b/xen/drivers/video/vga.c
index 29a88e8241..0a03508bee 100644
--- a/xen/drivers/video/vga.c
+++ b/xen/drivers/video/vga.c
@@ -205,7 +205,7 @@ static void cf_check vga_text_puts(const char *s, size_t nr)
}
}
-int __init fill_console_start_info(struct dom0_vga_console_info *ci)
+int fill_console_start_info(struct dom0_vga_console_info *ci)
{
memcpy(ci, &vga_console_info, sizeof(*ci));
return 1;
diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index 5e1494fe9a..14784dfa77 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -605,6 +605,11 @@ struct xenpf_symdata {
typedef struct xenpf_symdata xenpf_symdata_t;
DEFINE_XEN_GUEST_HANDLE(xenpf_symdata_t);
+/* Fetch the video console information and mode setup by Xen. */
+#define XENPF_get_dom0_console 64
+typedef struct dom0_vga_console_info xenpf_dom0_console_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_dom0_console_t);
+
/*
* ` enum neg_errnoval
* ` HYPERVISOR_platform_op(const struct xen_platform_op*);
@@ -635,6 +640,7 @@ struct xen_platform_op {
xenpf_core_parking_t core_parking;
xenpf_resource_op_t resource_op;
xenpf_symdata_t symdata;
+ xenpf_dom0_console_t dom0_console;
uint8_t pad[128];
} u;
};
--
2.39.0