]> xenbits.xensource.com Git - xen.git/commitdiff
x86/vga: fix mapping of the VGA text buffer
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 27 Mar 2025 14:03:20 +0000 (15:03 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 27 Mar 2025 14:03:20 +0000 (15:03 +0100)
The call to ioremap_wc() in video_init() will always fail, because
video_init() is called ahead of vm_init_type(), and so the underlying
__vmap() call will fail to allocate the linear address space.

Fix by reverting to the previous behavior and use __va() for the VGA text
buffer, as it's below the 1MB boundary, and thus always mapped in the
directmap.

Fixes: 81d195c6c0e2 ('x86: introduce ioremap_wc()')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 1ca5f69e35548e5196eadb329e5a3976821dc982
master date: 2025-03-20 17:16:10 +0100

xen/drivers/video/vga.c

index b4d018326128a57c4bc75bfd9e7b463348714d1c..b577b24619423c489106418370fc8f5fb0a1dd8b 100644 (file)
@@ -71,7 +71,7 @@ void __init video_init(void)
     {
     case XEN_VGATYPE_TEXT_MODE_3:
         if ( page_is_ram_type(paddr_to_pfn(0xB8000), RAM_TYPE_CONVENTIONAL) ||
-             ((video = ioremap_wc(0xB8000, 0x8000)) == NULL) )
+             ((video = __va(0xB8000)) == NULL) )
             return;
         outw(0x200a, 0x3d4); /* disable cursor */
         columns = vga_console_info.u.text_mode_3.columns;
@@ -158,7 +158,6 @@ void __init video_endboot(void)
         if ( !vgacon_keep )
         {
             memset(video, 0, columns * lines * 2);
-            iounmap(video);
             video = ZERO_BLOCK_PTR;
         }
         break;