* [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus
@ 2025-09-30 2:23 Andrew Hamilton
2025-09-30 2:23 ` [PATCH v2 1/1] build: Disable building video_bochs/cirrus for EFI x86 Andrew Hamilton
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Andrew Hamilton @ 2025-09-30 2:23 UTC (permalink / raw)
To: grub-devel; +Cc: daniel.kiper, safinaskar, benh, bluca, kibi, Andrew Hamilton
Disable building video_bochs and video_cirrus for EFI x86 platforms (i386_efi
and x86_64_efi). For x86 EFI platforms efi_gop or efi_uga should provide the
video support. Currently, in EFI platforms there is a risk that both the
legacy device is present and the EFI video interface - which can cause
unexpected video corruption when a mix of the two interfaces are used. This
can happen when all_video is loaded for simplicity in a GRUB config.
There is some additional analysis from the Qemu team in this thread:
https://gitlab.com/qemu-project/qemu/-/issues/2562
This is an issue on some major distros such as Debian on EFI
when running under Qemu and potentially other scenarios.
There is some discussion on the Debian side in this thread:
https://salsa.debian.org/kernel-team/linux/-/merge_requests/1453
This relates to this discussion from grub-devel also:
https://lists.gnu.org/archive/html/grub-devel/2025-09/msg00244.html
Following this change, for x86_64_efi the following modules would
be loaded by "all_video": "efi_gop" "efi_uga"
Link to v1 thread:
https://lists.gnu.org/archive/html/grub-devel/2025-09/msg00254.html
Fixes: https://savannah.gnu.org/bugs/index.php?66200
Changes v1 => v2:
Also remove video_cirrus when building for i386 EFI or x86-64 EFI
Andrew Hamilton (1):
build: Disable building video_bochs/cirrus for EFI x86 platforms
grub-core/Makefile.core.def | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--
2.47.3
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v2 1/1] build: Disable building video_bochs/cirrus for EFI x86 2025-09-30 2:23 [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus Andrew Hamilton @ 2025-09-30 2:23 ` Andrew Hamilton 2025-10-01 2:59 ` [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus Askar Safin via Grub-devel 2025-10-14 8:59 ` Askar Safin 2 siblings, 0 replies; 11+ messages in thread From: Andrew Hamilton @ 2025-09-30 2:23 UTC (permalink / raw) To: grub-devel; +Cc: daniel.kiper, safinaskar, benh, bluca, kibi, Andrew Hamilton Disable building video_bochs and video_cirrus for EFI x86 platforms (i386_efi and x86_64_efi). For x86 EFI platforms efi_gop or efi_uga should provide the video support. Currently, in EFI platforms there is a risk that both the legacy device is present and the EFI video interface - which can cause unexpected video corruption when a mix of the two interfaces are used. This can happen when all_video is loaded for simplicity in a GRUB config. Fixes: https://savannah.gnu.org/bugs/index.php?66200 Signed-off-by: Andrew Hamilton <adhamilt@gmail.com> --- grub-core/Makefile.core.def | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 0fcf67f9d..fad15ca4e 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -2163,13 +2163,21 @@ module = { module = { name = video_cirrus; x86 = video/cirrus.c; - enable = x86; + enable = i386_pc; + enable = i386_qemu; + enable = i386_coreboot; + enable = i386_multiboot; + enable = i386_ieee1275; }; module = { name = video_bochs; x86 = video/bochs.c; - enable = x86; + enable = i386_pc; + enable = i386_qemu; + enable = i386_coreboot; + enable = i386_multiboot; + enable = i386_ieee1275; }; module = { -- 2.47.3 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus 2025-09-30 2:23 [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus Andrew Hamilton 2025-09-30 2:23 ` [PATCH v2 1/1] build: Disable building video_bochs/cirrus for EFI x86 Andrew Hamilton @ 2025-10-01 2:59 ` Askar Safin via Grub-devel 2025-10-14 8:59 ` Askar Safin 2 siblings, 0 replies; 11+ messages in thread From: Askar Safin via Grub-devel @ 2025-10-01 2:59 UTC (permalink / raw) To: Andrew Hamilton; +Cc: Askar Safin, grub-devel, daniel.kiper, benh, bluca, kibi ---- On Tue, 30 Sep 2025 06:23:39 +0400 Andrew Hamilton <adhamilt@gmail.com> wrote --- > Disable building video_bochs and video_cirrus for EFI x86 platforms (i386_efi I tested this patch, and it indeed solves the bug. (But I tested on x86_64 only.) Tested-by: Askar Safin <safinaskar@zohomail.com> -- Askar Safin https://types.pl/@safinaskar _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus 2025-09-30 2:23 [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus Andrew Hamilton 2025-09-30 2:23 ` [PATCH v2 1/1] build: Disable building video_bochs/cirrus for EFI x86 Andrew Hamilton 2025-10-01 2:59 ` [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus Askar Safin via Grub-devel @ 2025-10-14 8:59 ` Askar Safin 2025-10-14 15:17 ` Andrew Hamilton 2 siblings, 1 reply; 11+ messages in thread From: Askar Safin @ 2025-10-14 8:59 UTC (permalink / raw) To: adhamilt; +Cc: benh, bluca, daniel.kiper, grub-devel, kibi, safinaskar Andrew Hamilton <adhamilt@gmail.com>: > Disable building video_bochs and video_cirrus for EFI x86 platforms (i386_efi Why this patch is not yet applied? -- Askar Safin _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus 2025-10-14 8:59 ` Askar Safin @ 2025-10-14 15:17 ` Andrew Hamilton 2025-10-15 13:30 ` Daniel Kiper via Grub-devel 0 siblings, 1 reply; 11+ messages in thread From: Andrew Hamilton @ 2025-10-14 15:17 UTC (permalink / raw) To: Askar Safin; +Cc: benh, bluca, daniel.kiper, grub-devel, kibi, safinaskar [-- Attachment #1.1: Type: text/plain, Size: 409 bytes --] Daniel - can you take a look at this one to see if we can get it pulled in to help those affected by this issue? Thanks Andrew On Tue, Oct 14, 2025 at 3:59 AM Askar Safin <safinaskar@gmail.com> wrote: > Andrew Hamilton <adhamilt@gmail.com>: > > Disable building video_bochs and video_cirrus for EFI x86 platforms > (i386_efi > > Why this patch is not yet applied? > > -- > Askar Safin > [-- Attachment #1.2: Type: text/html, Size: 839 bytes --] [-- Attachment #2: Type: text/plain, Size: 141 bytes --] _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus 2025-10-14 15:17 ` Andrew Hamilton @ 2025-10-15 13:30 ` Daniel Kiper via Grub-devel 2025-10-15 15:16 ` Gerd Hoffmann via Grub-devel 0 siblings, 1 reply; 11+ messages in thread From: Daniel Kiper via Grub-devel @ 2025-10-15 13:30 UTC (permalink / raw) To: Andrew Hamilton Cc: Daniel Kiper, Askar Safin, benh, bluca, grub-devel, kibi, safinaskar, phcoder On Tue, Oct 14, 2025 at 10:17:45AM -0500, Andrew Hamilton wrote: > Daniel - can you take a look at this one to see if we can get it pulled in to > help those affected by this issue? I am not entirely sure it [1] is correct. I have pinged and CC-ed Vladimir... Daniel [1] https://lore.kernel.org/grub-devel/20250930022340.146838-1-adhamilt@gmail.com/ _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus 2025-10-15 13:30 ` Daniel Kiper via Grub-devel @ 2025-10-15 15:16 ` Gerd Hoffmann via Grub-devel 2025-10-15 16:49 ` Daniel Kiper via Grub-devel 0 siblings, 1 reply; 11+ messages in thread From: Gerd Hoffmann via Grub-devel @ 2025-10-15 15:16 UTC (permalink / raw) To: The development of GNU GRUB Cc: Gerd Hoffmann, Andrew Hamilton, Daniel Kiper, Askar Safin, benh, bluca, kibi, safinaskar, phcoder On Wed, Oct 15, 2025 at 03:30:53PM +0200, Daniel Kiper via Grub-devel wrote: > On Tue, Oct 14, 2025 at 10:17:45AM -0500, Andrew Hamilton wrote: > > Daniel - can you take a look at this one to see if we can get it pulled in to > > help those affected by this issue? > > I am not entirely sure it [1] is correct. Well. Underlying problem is that there are two drivers active for one piece of hardware. The driver which comes with the EFI firmware, and the grub driver. Which is /never/ a good idea. In this specific case the effect is very visible, with other hardware the problems can be more obscure or with luck not present. The by far easiest way to handle this properly to allow only the efi_* drivers on all EFI platforms. The patch does just that (limited to video drivers). Alternatively you can check for conflicts. Check which physical device backs efi_gop, block that from being used by grub drivers. Same for all other device types. The latter would handle the corner case that there is hardware which is (a) supported by grub, and (b) not supported by the firmware, and (c) essential to boot the system. Not sure how relevant that is in practice, most EFI firmware I've seen recently is pretty complete when it comes to hardware support. NIC drivers are missing sometimes, iPXE to the rescue ;) Note that the same conflict exists for filesystem drivers too, usually both EFI and grub FAT drivers are active. Luckily write access to the ESP is very rare, so this isn't much of a problem in practice. take care, Gerd _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus 2025-10-15 15:16 ` Gerd Hoffmann via Grub-devel @ 2025-10-15 16:49 ` Daniel Kiper via Grub-devel 2025-10-16 7:07 ` Askar Safin 0 siblings, 1 reply; 11+ messages in thread From: Daniel Kiper via Grub-devel @ 2025-10-15 16:49 UTC (permalink / raw) To: Gerd Hoffmann Cc: Daniel Kiper, The development of GNU GRUB, Andrew Hamilton, Askar Safin, benh, bluca, kibi, safinaskar, phcoder On Wed, Oct 15, 2025 at 05:16:05PM +0200, Gerd Hoffmann wrote: > On Wed, Oct 15, 2025 at 03:30:53PM +0200, Daniel Kiper via Grub-devel wrote: > > On Tue, Oct 14, 2025 at 10:17:45AM -0500, Andrew Hamilton wrote: > > > Daniel - can you take a look at this one to see if we can get it pulled in to > > > help those affected by this issue? > > > > I am not entirely sure it [1] is correct. > > Well. Underlying problem is that there are two drivers active for one > piece of hardware. The driver which comes with the EFI firmware, and > the grub driver. Which is /never/ a good idea. In this specific case > the effect is very visible, with other hardware the problems can be more > obscure or with luck not present. > > The by far easiest way to handle this properly to allow only the efi_* > drivers on all EFI platforms. The patch does just that (limited to > video drivers). > > Alternatively you can check for conflicts. Check which physical device > backs efi_gop, block that from being used by grub drivers. Same for > all other device types. > > The latter would handle the corner case that there is hardware which is > (a) supported by grub, and (b) not supported by the firmware, and (c) > essential to boot the system. Not sure how relevant that is in > practice, most EFI firmware I've seen recently is pretty complete when > it comes to hardware support. NIC drivers are missing sometimes, iPXE > to the rescue ;) > > Note that the same conflict exists for filesystem drivers too, usually > both EFI and grub FAT drivers are active. Luckily write access to > the ESP is very rare, so this isn't much of a problem in practice. I am not saying it is not a problem. I rather saying that I do not like the solution. Or even we... I discussed the issue with Vladimir and he agrees with me. Anyway, why cannot you use GRUB_VIDEO_BACKEND config variable? If it is not acceptable please propose a solution without disabling drivers currently build and provided by the GRUB. We are OK with not loading some drivers but we are against disabling them at build. Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus 2025-10-15 16:49 ` Daniel Kiper via Grub-devel @ 2025-10-16 7:07 ` Askar Safin 2025-10-16 10:38 ` Daniel Kiper via Grub-devel 0 siblings, 1 reply; 11+ messages in thread From: Askar Safin @ 2025-10-16 7:07 UTC (permalink / raw) To: Daniel Kiper Cc: Gerd Hoffmann, The development of GNU GRUB, Andrew Hamilton, benh, bluca, kibi, safinaskar, phcoder Fixing this problem is needed for Debian to enable CONFIG_DRM_SIMPLEDRM for its kernels (this is already done by many other distros). (see this thread: https://salsa.debian.org/kernel-team/linux/-/merge_requests/1453#note_603600 ) So I'm asking will GRUB merge at least a partial solution to this problem in reasonable time? On Wed, Oct 15, 2025 at 7:49 PM Daniel Kiper <daniel.kiper@oracle.com> wrote: > Anyway, why cannot you use GRUB_VIDEO_BACKEND config variable? I want GRUB to work by default. :) > If it is not acceptable please propose a solution without disabling > drivers currently build and provided by the GRUB. We are OK with not Then make "all_video" depend on "efi_*" only on efi-x86_64. -- Askar Safin _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus 2025-10-16 7:07 ` Askar Safin @ 2025-10-16 10:38 ` Daniel Kiper via Grub-devel 2025-10-17 11:37 ` Daniel Kiper via Grub-devel 0 siblings, 1 reply; 11+ messages in thread From: Daniel Kiper via Grub-devel @ 2025-10-16 10:38 UTC (permalink / raw) To: Askar Safin Cc: Daniel Kiper, Gerd Hoffmann, The development of GNU GRUB, Andrew Hamilton, benh, bluca, kibi, safinaskar, phcoder On Thu, Oct 16, 2025 at 10:07:36AM +0300, Askar Safin wrote: > Fixing this problem is needed for Debian to enable > CONFIG_DRM_SIMPLEDRM for its kernels (this is already done by many > other distros). > (see this thread: > https://salsa.debian.org/kernel-team/linux/-/merge_requests/1453#note_603600 > ) > So I'm asking will GRUB merge at least a partial solution to > this problem in reasonable time? Propose an acceptable solution and we will take it... > On Wed, Oct 15, 2025 at 7:49 PM Daniel Kiper <daniel.kiper@oracle.com> wrote: > > Anyway, why cannot you use GRUB_VIDEO_BACKEND config variable? > > I want GRUB to work by default. :) > > > If it is not acceptable please propose a solution without disabling > > drivers currently build and provided by the GRUB. We are OK with not > > Then make "all_video" depend on "efi_*" only on efi-x86_64. I think it is much easier and sensible to tweak GRUB shell scripts to make it work. Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus 2025-10-16 10:38 ` Daniel Kiper via Grub-devel @ 2025-10-17 11:37 ` Daniel Kiper via Grub-devel 0 siblings, 0 replies; 11+ messages in thread From: Daniel Kiper via Grub-devel @ 2025-10-17 11:37 UTC (permalink / raw) To: Askar Safin Cc: Daniel Kiper, Gerd Hoffmann, The development of GNU GRUB, Andrew Hamilton, benh, bluca, kibi, safinaskar, phcoder On Thu, Oct 16, 2025 at 12:38:57PM +0200, Daniel Kiper wrote: > On Thu, Oct 16, 2025 at 10:07:36AM +0300, Askar Safin wrote: > > Fixing this problem is needed for Debian to enable > > CONFIG_DRM_SIMPLEDRM for its kernels (this is already done by many > > other distros). > > (see this thread: > > https://salsa.debian.org/kernel-team/linux/-/merge_requests/1453#note_603600 > > ) > > So I'm asking will GRUB merge at least a partial solution to > > this problem in reasonable time? > > Propose an acceptable solution and we will take it... > > > On Wed, Oct 15, 2025 at 7:49 PM Daniel Kiper <daniel.kiper@oracle.com> wrote: > > > Anyway, why cannot you use GRUB_VIDEO_BACKEND config variable? > > > > I want GRUB to work by default. :) > > > > > If it is not acceptable please propose a solution without disabling > > > drivers currently build and provided by the GRUB. We are OK with not > > > > Then make "all_video" depend on "efi_*" only on efi-x86_64. > > I think it is much easier and sensible to tweak GRUB shell scripts to > make it work. To be precise, I am OK with a patch doing it properly. And it would be nice to have a flag to enable original behavior just in case. Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-10-17 11:38 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-09-30 2:23 [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus Andrew Hamilton 2025-09-30 2:23 ` [PATCH v2 1/1] build: Disable building video_bochs/cirrus for EFI x86 Andrew Hamilton 2025-10-01 2:59 ` [PATCH v2 0/1] Correct Video Corruption for EFI Plus Bochs/Cirrus Askar Safin via Grub-devel 2025-10-14 8:59 ` Askar Safin 2025-10-14 15:17 ` Andrew Hamilton 2025-10-15 13:30 ` Daniel Kiper via Grub-devel 2025-10-15 15:16 ` Gerd Hoffmann via Grub-devel 2025-10-15 16:49 ` Daniel Kiper via Grub-devel 2025-10-16 7:07 ` Askar Safin 2025-10-16 10:38 ` Daniel Kiper via Grub-devel 2025-10-17 11:37 ` Daniel Kiper via Grub-devel
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.