[PATCH for-4.22] x86/boot: don't blindly mark VGA in graphics mode on MB2 path

Jan Beulich posted 1 patch 4 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/7fbe73a9-08b1-46ff-81fe-ddd6ed52deb6@suse.com
[PATCH for-4.22] x86/boot: don't blindly mark VGA in graphics mode on MB2 path
Posted by Jan Beulich 4 weeks, 1 day ago
Setting ->orig_video_isVGA to the specific marker should be done only when
the VBE tag is present and the FRAMEBUFFER is either absent or indicates
RGB type. Since the "video" variable now starts out non-NULL, this
property was broken when in particular neither of the tags are present. To
move back to at least close to original behavior, add a 2nd check to said
conditional.

Fixes: d5a73cdc6b90 ("x86/boot: Use boot_vid_info variable directly from C code")
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -339,7 +339,7 @@ static multiboot_info_t *mbi2_reloc(uint
  end:
 
 #ifdef CONFIG_VIDEO
-    if ( video )
+    if ( video && video->lfb_size )
         video->orig_video_isVGA = 0x23;
 #endif
 

Re: [PATCH for-4.22] x86/boot: don't blindly mark VGA in graphics mode on MB2 path
Posted by Teddy Astie 4 weeks ago
Le 24/06/2026 à 12:24, Jan Beulich a écrit :
> Setting ->orig_video_isVGA to the specific marker should be done only when
> the VBE tag is present and the FRAMEBUFFER is either absent or indicates
> RGB type. Since the "video" variable now starts out non-NULL, this
> property was broken when in particular neither of the tags are present. To
> move back to at least close to original behavior, add a 2nd check to said
> conditional.
> 
> Fixes: d5a73cdc6b90 ("x86/boot: Use boot_vid_info variable directly from C code")
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> 
> --- a/xen/arch/x86/boot/reloc.c
> +++ b/xen/arch/x86/boot/reloc.c
> @@ -339,7 +339,7 @@ static multiboot_info_t *mbi2_reloc(uint
>    end:
>   
>   #ifdef CONFIG_VIDEO
> -    if ( video )
> +    if ( video && video->lfb_size )
>           video->orig_video_isVGA = 0x23;
>   #endif
>   

Reviewed-by: Teddy Astie <teddy.astie@vates.tech>

Teddy
Re: [PATCH for-4.22] x86/boot: don't blindly mark VGA in graphics mode on MB2 path
Posted by Oleksii Kurochko 4 weeks ago

On 6/24/26 12:24 PM, Jan Beulich wrote:
> Setting ->orig_video_isVGA to the specific marker should be done only when
> the VBE tag is present and the FRAMEBUFFER is either absent or indicates
> RGB type. Since the "video" variable now starts out non-NULL, this
> property was broken when in particular neither of the tags are present. To
> move back to at least close to original behavior, add a 2nd check to said
> conditional.
> 
> Fixes: d5a73cdc6b90 ("x86/boot: Use boot_vid_info variable directly from C code")
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

~ Oleksii

Re: [PATCH for-4.22] x86/boot: don't blindly mark VGA in graphics mode on MB2 path
Posted by Andrew Cooper 4 weeks, 1 day ago
On 24/06/2026 11:24 am, Jan Beulich wrote:
> Setting ->orig_video_isVGA to the specific marker should be done only when
> the VBE tag is present and the FRAMEBUFFER is either absent or indicates
> RGB type. Since the "video" variable now starts out non-NULL, this
> property was broken when in particular neither of the tags are present. To
> move back to at least close to original behavior, add a 2nd check to said
> conditional.
>
> Fixes: d5a73cdc6b90 ("x86/boot: Use boot_vid_info variable directly from C code")
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>