Advertisement
Guest User

Untitled

a guest
Feb 6th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
  2. index ec5b082f3de6..9d0d956b7fbb 100644
  3. --- a/arch/arm/xen/enlighten.c
  4. +++ b/arch/arm/xen/enlighten.c
  5. @@ -67,6 +67,52 @@ static __read_mostly phys_addr_t xen_grant_frames;
  6. uint32_t xen_start_flags;
  7. EXPORT_SYMBOL(xen_start_flags);
  8.  
  9. +static void __init xen_init_vga(void)
  10. +{
  11. + struct xen_platform_op op = {
  12. + .cmd = XENPF_firmware_info,
  13. + .interface_version = XENPF_INTERFACE_VERSION,
  14. + .u.firmware_info.type = XEN_FW_VGA_INFO,
  15. + };
  16. + const struct dom0_vga_console_info *info;
  17. +
  18. + if (HYPERVISOR_platform_op(&op) != 0)
  19. + return;
  20. +
  21. + info = &op.u.firmware_info.u.vga;
  22. +
  23. + /* This is drawn from a dump from vgacon:startup in
  24. + * standard Linux. */
  25. + screen_info.orig_video_mode = 3;
  26. + screen_info.orig_video_isVGA = 1;
  27. + screen_info.orig_video_lines = 25;
  28. + screen_info.orig_video_cols = 80;
  29. + screen_info.orig_video_ega_bx = 3;
  30. + screen_info.orig_video_points = 16;
  31. + screen_info.orig_y = screen_info.orig_video_lines - 1;
  32. +
  33. + switch (info->video_type) {
  34. + case XEN_VGATYPE_EFI_LFB:
  35. + screen_info.orig_video_isVGA = VIDEO_TYPE_EFI;
  36. + screen_info.lfb_width = info->u.vesa_lfb.width;
  37. + screen_info.lfb_height = info->u.vesa_lfb.height;
  38. + screen_info.lfb_depth = info->u.vesa_lfb.bits_per_pixel;
  39. + screen_info.lfb_base = info->u.vesa_lfb.lfb_base;
  40. + screen_info.lfb_size = info->u.vesa_lfb.lfb_size;
  41. + screen_info.lfb_linelength = info->u.vesa_lfb.bytes_per_line;
  42. + screen_info.red_size = info->u.vesa_lfb.red_size;
  43. + screen_info.red_pos = info->u.vesa_lfb.red_pos;
  44. + screen_info.green_size = info->u.vesa_lfb.green_size;
  45. + screen_info.green_pos = info->u.vesa_lfb.green_pos;
  46. + screen_info.blue_size = info->u.vesa_lfb.blue_size;
  47. + screen_info.blue_pos = info->u.vesa_lfb.blue_pos;
  48. + screen_info.rsvd_size = info->u.vesa_lfb.rsvd_size;
  49. + screen_info.rsvd_pos = info->u.vesa_lfb.rsvd_pos;
  50. +
  51. + break;
  52. + }
  53. +}
  54. +
  55. int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,
  56. int nr, struct page **pages)
  57. {
  58. @@ -455,6 +501,8 @@ static int __init xen_guest_init(void)
  59. if (efi_enabled(EFI_RUNTIME_SERVICES))
  60. xen_efi_runtime_setup();
  61.  
  62. + xen_init_vga();
  63. +
  64. shared_info_page = (struct shared_info *)get_zeroed_page(GFP_KERNEL);
  65.  
  66. if (!shared_info_page) {
  67. diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
  68. index 655d92e803e1..5f5cef820a21 100644
  69. --- a/include/xen/interface/platform.h
  70. +++ b/include/xen/interface/platform.h
  71. @@ -206,6 +206,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_efi_runtime_call);
  72. #define XEN_FW_VBEDDC_INFO 3 /* from int 10 AX=4f15 */
  73. #define XEN_FW_EFI_INFO 4 /* from EFI */
  74. #define XEN_FW_KBD_SHIFT_FLAGS 5 /* Int16, Fn02: Get keyboard shift flags. */
  75. +#define XEN_FW_VGA_INFO 6
  76.  
  77. struct xenpf_firmware_info {
  78. /* IN variables. */
  79. @@ -259,6 +260,8 @@ struct xenpf_firmware_info {
  80. } efi_info; /* XEN_FW_EFI_INFO */
  81.  
  82. uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */
  83. +
  84. + struct dom0_vga_console_info vga;
  85. } u;
  86. };
  87. DEFINE_GUEST_HANDLE_STRUCT(xenpf_firmware_info_t);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement