Bug 44810 - efifb in qemu-kvm with ovmf: broken display, memory corruption
efifb in qemu-kvm with ovmf: broken display, memory corruption
Status: CLOSED WONTFIX
Product: UCS
Classification: Unclassified
Component: Virtualization - KVM
UCS 4.2
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-16 19:09 CEST by Philipp Hahn
Modified: 2023-06-28 10:45 CEST (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.171
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Broken screen (73.70 KB, image/png)
2017-06-20 17:02 CEST, Philipp Hahn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2017-06-16 19:09:22 CEST
EFI frame-buffer only shows garbled output:
# cat /proc/fb 
0 EFI VGA
# dmesg
[    0.980927] efifb: probing for efifb
[    0.981656] efifb: framebuffer at 0x80000000, using 1876k, total 1875k
[    0.983030] efifb: mode is 800x600x32, linelength=3200, pages=1
[    0.984293] efifb: scrolling: redraw
[    0.985128] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[    0.988296] Console: switching to colour frame buffer device 100x37
[    0.990700] fb0: EFI VGA frame buffer device

Network driver e1000 is not loaded (automatically):
# depmod 
depmod: ERROR: Found 2 modules in dependency cycles!
depmod: ERROR: Cycle detected: libata -> libata
depmod: ERROR: Cycle detected: libata -> scsi_mod
# md5sum /lib/modules/4.9.0-ucs103-amd64/kernel/drivers/ata/libata.ko 
e88eef61b683a6bc07a0efb6d636e484  /lib/modules/4.9.0-ucs103-amd64/kernel/drivers/ata/libata.ko
# md5sum /lib/modules/4.9.0-ucs103-amd64/kernel/drivers/ata/libata.ko 
1091979eb2aa91b0b3fcab6d1d3e0562  /lib/modules/4.9.0-ucs103-amd64/kernel/drivers/ata/libata.ko

(manual insmod works)

External

# mount -o loop,ro ucs_4.2-0-latest-amd64.iso /mnt
# gzip -dc /mnt/install.amd/initrd.gz | cpio -i --to-stdout lib/modules/4.9.0-ucs103-amd64/kernel/drivers/ata/libata.ko > /tmp/initramfs
# md5sum /tmp/initramfs
233e721f8482c0ab469b1f9715e966eb  /tmp/initramfs
# dpkg -x /mnt/amd64/ata-modules-4.9.0-ucs103-amd64-di_4.9.13-1A~4.2.0.201703091358_amd64.udeb /tmp/udeb
# md5sum /tmp/udeb/lib/modules/4.9.0-ucs103-amd64/kernel/drivers/ata/libata.ko 
233e721f8482c0ab469b1f9715e966eb  /tmp/udeb/lib/modules/4.9.0-ucs103-amd64/kernel/drivers/ata/libata.ko

# find /mnt -name initrd.gz -exec sh -c 'gzip -dc "$0"|cpio -i --quiet --to-stdout lib/modules/4.9.0-ucs103-amd64/kernel/drivers/ata/libata.ko|md5sum' {} \;
233e721f8482c0ab469b1f9715e966eb  -
233e721f8482c0ab469b1f9715e966eb  -
233e721f8482c0ab469b1f9715e966eb  -

od () { local C T="$(mktemp -d)";printf '\000' >"$T/0";printf '\012' >"$T/n";while dd bs=1 count=1 of="$T/F" 2>/dev/null&&[ -s "$T/F" ];do IFS= read -r -n 1 C <"$T/F";if [ -n "$C" ];then C="'$C";elif cmp -s "$T/F" "$T/0";then C=0;elif cmp -s "$T/F" "$T/n";then C=10;else break;fi;printf ' %02x' "$C";done;echo;rm -rf "$T";}
printf '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\377' | od

od </lib/modules/4.9.0-ucs103-amd64/kernel/drivers/ata/libata.ko >/dev/ttyS1

perl -ape '$_=join("",map(chr(hex($_)), @F))' /tmp/uefi.log  > /tmp/uefi.xxx

/tmp/uefi.bin [+]                                   15038,1      Alles /tmp/uefi.ko [+]                                    15038,1      Alles
  003ac00: e801 0000 0000 0000 3c00 0000 1700 0000  ........<.......  |  003ac00: e801 0000 0000 0000 5e8c 0000 1000 f1ff  ........^.......  
  003ac10: 785b 3e8a 0000 0000 3c00 0000 0700 0000  x[>.....<.......  |  003ac10: 785b 3e8a 0000 0000 0000 0000 0000 0000  x[>.............  
  003ac20: 778c 0000 1200 0200 3c00 0000 0700 0000  w.......<.......  |  003ac20: 778c 0000 1200 0200 f018 0000 0000 0000  w...............  
  003ac30: 1e00 0000 0000 0000 3c00 0000 1700 0000  ........<.......  |  003ac30: 1e00 0000 0000 0000 8c8c 0000 1200 0200  ................  
  003ac40: 7007 0000 0000 0000 3c00 0000 0700 0000  p.......<.......  |  003ac40: 7007 0000 0000 0000 1400 0000 0000 0000  p...............  
  003ac50: 9c8c 0000 1200 0200 3c00 0000 0700 0000  ........<.......  |  003ac50: 9c8c 0000 1200 0200 0022 0000 0000 0000  ........."......  
  003ac60: 4000 0000 0000 0000 3c00 0000 1700 0000  @.......<.......  |  003ac60: 4000 0000 0000 0000 ac8c 0000 1000 f1ff  @...............
Comment 1 Philipp Hahn univentionstaff 2017-06-20 17:02:13 CEST
Created attachment 8941 [details]
Broken screen

After updating OVMF to memory corruption seems to be gone.

The frame buffer problem persists.
Interestingly enough the same VGA devices works later after the reboot, when "bochsdrmfb" is used (see Bug #40073).

[  +0,000020] efifb: probing for efifb
[  +0,000012] efifb: framebuffer at 0x80000000, using 1876k, total 1875k
[  +0,000002] efifb: mode is 800x600x32, linelength=3200, pages=1
[  +0,000000] efifb: scrolling: redraw
[  +0,000002] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[  +0,001715] Console: switching to colour frame buffer device 100x37
[  +0,000932] fb0: EFI VGA frame buffer device
...
[  +0,000001] fb: switching to bochsdrmfb from EFI VGA
[  +0,000024] Console: switching to colour dummy device 80x25
[  +0,000361] [drm] Found bochs VGA, ID 0xb0c5.
[  +0,000002] [drm] Framebuffer size 16384 kB @ 0x80000000, mmio @ 0x81029000.
[  +0,000054] [TTM] Zone  kernel: Available graphics memory: 1025212 kiB
[  +0,000002] [TTM] Initializing pool allocator
[  +0,000006] [TTM] Initializing DMA pool allocator
[  +0,001381] fbcon: bochsdrmfb (fb0) is primary device
[  +0,003263] Console: switching to colour frame buffer device 128x48
[  +0,002591] bochs-drm 0000:00:02.0: fb0: bochsdrmfb frame buffer device
[  +0,016726] [drm] Initialized bochs-drm 1.0.0 20130925 for 0000:00:02.0 on minor 0

reading the Linux source code gives me the impression, that "efifb" is only for Apple computers and does not work with standard hardware.
Linux is probably using the frame-buffer as packed pixel (black,blue,green,red), while GRUB seems to have configured a planar framebuffer.
Using "video=efifb:off" disables the EFI framebuffer completely for linux and the screen last displayed by GRUB stays intact.
Maybe we should re-enable CONFIG_DB_SIMPLE and CONFIG_X86_SYSFB again? <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822575#55>
Comment 2 Philipp Hahn univentionstaff 2017-06-21 09:54:32 CEST
(In reply to Philipp Hahn from comment #1)
> The frame buffer problem persists.
> Interestingly enough the same VGA devices works later after the reboot, when
> "bochsdrmfb" is used (see Bug #40073).
> 
> [  +0,000020] efifb: probing for efifb
> [  +0,000012] efifb: framebuffer at 0x80000000, using 1876k, total 1875k
> [  +0,000002] efifb: mode is 800x600x32, linelength=3200, pages=1
> [  +0,000000] efifb: scrolling: redraw
> [  +0,000002] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
> [  +0,001715] Console: switching to colour frame buffer device 100x37
> [  +0,000932] fb0: EFI VGA frame buffer device

Debian-Stretch works (with SecureBoot disabled) and shows the following difference:

[  0.813991] efifb: framebuffer at 0x80000000, using 1408k, total 1408k
[  0.813992] efifb: mode is 800x600x24, linelength=2400, pages=1
[  0.813993] efifb: Truecolor: size=0:8:8:8, shift=0:16:8:0

Otherwise /cdrom/boot/grub/grub.cfg loads the same modules and also used vga=788
Comment 3 Philipp Hahn univentionstaff 2018-08-20 12:52:55 CEST
Switching to vga=qxl worked for me - then a different FB driver is used with works.
Comment 4 Ingo Steuwer univentionstaff 2020-07-03 20:51:01 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.