x86/platform: Protect XENPF_get_dom0_console if CONFIG_VIDEO not set
PATCH 1/1 x86/platform: Protect XENPF_get_dom0_console if CONFIG_VIDEO not set
A build failure [1] is observed if CONFIG_VGA (and thus CONFIG_VIDEO) is not set. This is because XENPF_get_dom0_console cmd of platform hypercall makes a call to fill_console_start_info, which is defined in video/vga.c and built only if CONFIG_VGA is set.
To fix this issue, protect XENPF_get_dom0_console with CONFIG_VIDEO ifdefery.
[1]:
ld: prelink.o: in function `do_platform_op':
(.text.do_platform_op+0x1a7): undefined reference to `fill_console_start_info'
---
CI job failure:
https://gitlab.com/xen-project/xen/-/jobs/3430825994
--- xen/arch/x86/platform_hypercall.c | 2 ++ 1 file changed, 2 insertions(+)
xen/arch/x86/platform_hypercall.c +2 -0
@@ -839,6 +839,7 @@ ret_t do_platform_op( }break ; +#ifdef CONFIG_VIDEO case XENPF_get_dom0_console:if ( !fill_console_start_info (&op->u.dom0_console) ) {
@@ -849,6 +850,7 @@ ret_t do_platform_op(if (copy_field_to_guest (u_xenpf_op, op, u.dom0_console) ) ret = -EFAULT ;break ; +#endif default : ret = -ENOSYS ;
Signature · 1 line
2.25.1
Quoted 4 lines · Michal Orzel
A build failure [1] is observed if
CONFIG_VGA(and thusCONFIG_VIDEO) is not set. This is becauseXENPF_get_dom0_consolecmd of platform hypercall makes a call tofill_console_start_info, which is defined invideo/vga.cand built only ifCONFIG_VGAis set.
Which means to use ...
xen/arch/x86/platform_hypercall.c ret_t do_platform_op( · line 842
Quoted 7 lines
xen/arch/x86/platform_hypercall.c +1
-0@@ -839,6 +839,7 @@ ret_t do_platform_op( }break ; +#ifdef CONFIG_VIDEO
... CONFIG_VGA here, unless fill_console_start_info() was moved to a file that's built dependent upon CONFIG_VIDEO.
Jan
Hi Jan,
Quoted 16 lines · Jan Beulich
Quoted 4 lines · Michal Orzel
A build failure [1] is observed if
CONFIG_VGA(and thusCONFIG_VIDEO) is not set. This is becauseXENPF_get_dom0_consolecmd of platform hypercall makes a call tofill_console_start_info, which is defined invideo/vga.cand built only ifCONFIG_VGAis set.Which means to use ...
Quoted 6 lines
xen/arch/x86/platform_hypercall.c +0
-0@@ -839,6 +839,7 @@ ret_t do_platform_op( }break ;
Quoted 4 lines
xen/arch/x86/platform_hypercall.c ret_t do_platform_op( · line 842
Quoted 1 line
xen/arch/x86/platform_hypercall.c +1
-0+#ifdef CONFIG_VIDEO ...
CONFIG_VGAhere, unlessfill_console_start_info()was moved to a file that's built dependent uponCONFIG_VIDEO.
The one and only reason of using CONFIG_VIDEO and not CONFIG_VGA is that all the calls in existing codebase to fill_console_start_info are protected by CONFIG_VIDEO and not CONFIG_VGA. That is why I choose to stick to the current behavior.
Quoted 2 lines
Jan
~Michal
Jan Beulich
Acked-byQuoted 19 lines · Michal Orzel
Hi Jan,
Quoted 16 lines · Jan Beulich
Quoted 4 lines · Michal Orzel
A build failure [1] is observed if
CONFIG_VGA(and thusCONFIG_VIDEO) is not set. This is becauseXENPF_get_dom0_consolecmd of platform hypercall makes a call tofill_console_start_info, which is defined invideo/vga.cand built only ifCONFIG_VGAis set.Which means to use ...
Quoted 6 lines
xen/arch/x86/platform_hypercall.c +0
-0@@ -839,6 +839,7 @@ ret_t do_platform_op( }break ;
Quoted 7 lines
Quoted 4 lines
xen/arch/x86/platform_hypercall.c ret_t do_platform_op( · line 842
Quoted 1 line
xen/arch/x86/platform_hypercall.c +1
-0+#ifdef CONFIG_VIDEO ...
CONFIG_VGAhere, unlessfill_console_start_info()was moved to a file that's built dependent uponCONFIG_VIDEO.The one and only reason of using
CONFIG_VIDEOand notCONFIG_VGAis that all the calls in existing codebase tofill_console_start_infoare protected byCONFIG_VIDEOand notCONFIG_VGA. That is why I choose to stick to the current behavior.
"All" is interesting as a statement when there's just one. But yes, I can see that the issue is broader - 2b8a95a2961b ("xen/x86: make VGA support selectable") didn't really get the #ifdef-s right. I guess the change then is okay as is:
and we'll need to touch all of that again (or move code around) if some 2nd way of selecting VIDEO appears.
Jan