RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1806359 - bochs-display cannot show graphic wihout driver attach
Summary: bochs-display cannot show graphic wihout driver attach
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: edk2
Version: 8.2
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: 8.0
Assignee: Laszlo Ersek
QA Contact: Guo, Zhiyi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-24 02:07 UTC by Guo, Zhiyi
Modified: 2021-09-03 15:16 UTC (History)
13 users (show)

Fixed In Version: edk2-20190829git37eef91017ad-9.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:02:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-37882 0 None None None 2021-09-03 15:16:57 UTC
Red Hat Product Errata RHSA-2020:1712 0 None None None 2020-04-28 16:02:50 UTC
TianoCore 2555 0 None None None 2020-02-24 17:02:31 UTC

Description Guo, Zhiyi 2020-02-24 02:07:29 UTC
Description of problem:
bochs-display cannot show graphic wihout driver attach

Version-Release number of selected component (if applicable):
qemu-kvm-4.2.0-11.module+el8.2.0+5837+4c1442ec.x86_64
edk2-ovmf-20190829git37eef91017ad-8.el8.noarch
seavgabios-bin-1.13.0-1.module+el8.2.0+5520+4e5817f3.noarch

How reproducible:
100%

Steps to Reproduce:
1.Boot rhel 8.2 VM with bochs-display device and ovmf:
...
  <os>
    <type arch='x86_64' machine='pc-q35-rhel8.2.0'>hvm</type>
    <loader readonly='yes' secure='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader>
    <nvram template='/usr/share/edk2/ovmf/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/rhel82_vnc_bochs_VARS.fd</nvram>
    <boot dev='hd'/>
  </os>
...
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='bochs' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
...
2.
3.

Actual results:
bochs-display only show graphic after driver attach, thus user cannot interact with VM grub menu

Expected results:
bochs-display show graphic when no driver attach to device.

Additional info:
Try seabios + bochs-display, bochs-display can show graphic without vm driver:
# /usr/libexec/qemu-kvm -device bochs-display -vnc :66 -monitor stdio -machine q35

This also cause windows VM never get graphic output because of no VM driver provided on windows VM

Comment 1 Guo, Zhiyi 2020-02-24 02:18:24 UTC
Not able to reproduce this issue on 8.1.1 environment with qemu-kvm-4.1.0-23.module+el8.1.1+5748+5fcc84a8.1.x86_64, seavgabios-bin-1.12.0-5.module+el8.1.1+5309+6d656f05.noarch and edk2-ovmf-20190308git89910a39dcfd-6.el8.noarch

Per latest description by Gerd:
https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/

"For UEFI guests it is safe to use the bochs display device instead of the standard VGA device. The firmware will setup a linear framebuffer as GOP anyway and never use any legacy VGA features.", I think basic framebuffer should work with any VM even without driver? Not quite sure..

Set regression base on not reproducible on 8.1.1, please feel free to clear this keyword if this is a expected behavior..

Comment 2 Gerd Hoffmann 2020-02-24 08:39:58 UTC
> driver attach

In uefi shell I assume?

Does downgrading ovmf to 8.1.1 help?

Comment 3 Guo, Zhiyi 2020-02-24 09:00:22 UTC
(In reply to Gerd Hoffmann from comment #2)
> > driver attach
> 
> In uefi shell I assume?
> 
> Does downgrading ovmf to 8.1.1 help?

Yes, downgrade ovmf to edk2-ovmf-20190308git89910a39dcfd-6.el8.noarch(shipped with 8.1.1) will solve the issue

Comment 4 Gerd Hoffmann 2020-02-24 10:00:59 UTC
(In reply to Guo, Zhiyi from comment #3)
> (In reply to Gerd Hoffmann from comment #2)
> > > driver attach
> > 
> > In uefi shell I assume?
> > 
> > Does downgrading ovmf to 8.1.1 help?
> 
> Yes, downgrade ovmf to
> edk2-ovmf-20190308git89910a39dcfd-6.el8.noarch(shipped with 8.1.1) will
> solve the issue

So my first guess would be that ovmf/edk2 doesn't bind to bochs-display by default
because it is pci class display/other not display/vga ...

Laszlo?

Comment 5 Laszlo Ersek 2020-02-24 10:32:30 UTC
Right, the term "driver attach" is quite confusing. From comment 0, it seems that it stands for "native guest OS driver".

Anyway, from comment 3 it seems like a regression in edk2.

Zhiyi, can you please capture OVMF debug logs with both packages:

- edk2-ovmf-20190308git89910a39dcfd-6.el8.noarch (working)
- edk2-ovmf-20190829git37eef91017ad-8.el8.noarch (broken)

(using otherwise identical domain XMLs, of course), and attach them? Thanks!

Comment 6 Laszlo Ersek 2020-02-24 10:39:45 UTC
(In reply to Gerd Hoffmann from comment #4)
> (In reply to Guo, Zhiyi from comment #3)
> > (In reply to Gerd Hoffmann from comment #2)
> > > > driver attach
> > > 
> > > In uefi shell I assume?
> > > 
> > > Does downgrading ovmf to 8.1.1 help?
> > 
> > Yes, downgrade ovmf to
> > edk2-ovmf-20190308git89910a39dcfd-6.el8.noarch(shipped with 8.1.1) will
> > solve the issue
> 
> So my first guess would be that ovmf/edk2 doesn't bind to bochs-display by
> default because it is pci class display/other not display/vga ...

I've never personally tested <model type='bochs'/> (my RHEL7 libvirtd is 4.5-based, and the bochs model gained support in libvirt 5.6 first). I can't tell off-hand if upstream QemuVideoDxe had anything related to PCI class filtering...

$ git log --oneline --reverse  edk2-stable201903..edk2-stable201908 -- OvmfPkg/QemuVideoDxe/ | cat -n
     1  b26f0cf9ee09 OvmfPkg: Replace BSD License with BSD+Patent License
     2  52d229238b2d OvmfPkg/QemuVideoDxe: avoid arithmetic on null pointer
     3  cd5147734cbe OvmfPkg/QemuVideoDxe: Remove dependency on OptionRomPkg
     4  662bd0da7fd7 OvmfPkg/QemuVideoDxe: Shouldn't assume system in VGA alias mode.

Sigh, I think commit 662bd0da7fd7 caused the regression. :(

Comment 7 Laszlo Ersek 2020-02-24 10:45:25 UTC
The message on commit 662bd0da7fd7 is nearly undecipherable, but the associated upstream BZ <https://bugzilla.tianocore.org/show_bug.cgi?id=1880> is more helpful. Basically the idea was to replace the hard-coded EFI_PCI_IO_ATTRIBUTE_VGA_IO in the "EfiPciIoAttributeOperationEnable" operation with EFI_PCI_IO_ATTRIBUTE_VGA_IO or EFI_PCI_IO_ATTRIBUTE_VGA_IO_16, dependent on what the device supported. Hence the new query (EfiPciIoAttributeOperationSupported operation).

However, the following hunk:

+  if (SupportedVgaIo == 0) {
+    Status = EFI_UNSUPPORTED;
+    goto ClosePciIo;
+  }

is bogus -- it prevents QemuVideoDxe from binding devices that have no VGA compat IO stuff at all.

Gerd, can you submit a patch to back out this hunk? I'd feel more comfortable if you were writing the commit message. Otherwise, I can submit the patch later (and then I'll ask you to review).

Thanks.
Laszlo

Comment 10 Gerd Hoffmann 2020-02-24 12:56:22 UTC
> However, the following hunk:
> 
> +  if (SupportedVgaIo == 0) {
> +    Status = EFI_UNSUPPORTED;
> +    goto ClosePciIo;
> +  }
> 
> is bogus -- it prevents QemuVideoDxe from binding devices that have no VGA
> compat IO stuff at all.
> 
> Gerd, can you submit a patch to back out this hunk? I'd feel more
> comfortable if you were writing the commit message. Otherwise, I can submit
> the patch later (and then I'll ask you to review).

Something like this should work (untested, build fails for me somewhere in openssl :( ).

diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
index 6a4a860b3c25..fde94b606f27 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -292,7 +292,7 @@ QemuVideoControllerDriverStart (
   }
 
   SupportedVgaIo &= (UINT64)(EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16);
-  if (SupportedVgaIo == 0) {
+  if (SupportedVgaIo == 0 && Pci.Hdr.ClassCode[1] == PCI_CLASS_DISPLAY_VGA) {^M
     Status = EFI_UNSUPPORTED;
     goto ClosePciIo;
   }

Commit message along the lines of "only require vga io ports if the device actually is vga compatible".
Cc: me if you want a review, I'm not on edk2-devel any more.

Comment 11 Laszlo Ersek 2020-02-24 13:20:05 UTC
(In reply to Gerd Hoffmann from comment #10)
> > However, the following hunk:
> > 
> > +  if (SupportedVgaIo == 0) {
> > +    Status = EFI_UNSUPPORTED;
> > +    goto ClosePciIo;
> > +  }
> > 
> > is bogus -- it prevents QemuVideoDxe from binding devices that have no VGA
> > compat IO stuff at all.
> > 
> > Gerd, can you submit a patch to back out this hunk? I'd feel more
> > comfortable if you were writing the commit message. Otherwise, I can submit
> > the patch later (and then I'll ask you to review).
> 
> Something like this should work (untested, build fails for me somewhere in
> openssl :( ).
> 
> diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
> index 6a4a860b3c25..fde94b606f27 100644
> --- a/OvmfPkg/QemuVideoDxe/Driver.c
> +++ b/OvmfPkg/QemuVideoDxe/Driver.c
> @@ -292,7 +292,7 @@ QemuVideoControllerDriverStart (
>    }
>  
>    SupportedVgaIo &= (UINT64)(EFI_PCI_IO_ATTRIBUTE_VGA_IO |
> EFI_PCI_IO_ATTRIBUTE_VGA_IO_16);
> -  if (SupportedVgaIo == 0) {
> +  if (SupportedVgaIo == 0 && Pci.Hdr.ClassCode[1] == PCI_CLASS_DISPLAY_VGA)
> {^M
>      Status = EFI_UNSUPPORTED;
>      goto ClosePciIo;
>    }
> 
> Commit message along the lines of "only require vga io ports if the device
> actually is vga compatible".

Thanks, very helpful! This reminds me of commit 4fdb585c69d6 ("OvmfPkg/PlatformBootManagerLib: relax device class requirement for ConOut", 2016-09-01). I.e., I could use the IS_PCI_VGA() macro, perhaps.

I'll send a patch, hopefully soon.

Comment 12 Laszlo Ersek 2020-02-24 17:19:12 UTC
Upstream patch posted:

[edk2-devel] [PATCH edk2-stable202002]
OvmfPkg/QemuVideoDxe: unbreak "secondary-vga" and "bochs-display" support

http://mid.mail-archive.com/20200224171741.7494-1-lersek@redhat.com
https://edk2.groups.io/g/devel/message/54760

Comment 16 Laszlo Ersek 2020-02-26 16:54:27 UTC
(In reply to Laszlo Ersek from comment #12)
> Upstream patch posted:
> 
> [edk2-devel] [PATCH edk2-stable202002]
> OvmfPkg/QemuVideoDxe: unbreak "secondary-vga" and "bochs-display" support
> 
> http://mid.mail-archive.com/20200224171741.7494-1-lersek@redhat.com
> https://edk2.groups.io/g/devel/message/54760

Upstream commit edfe16a6d9f8.

Comment 55 errata-xmlrpc 2020-04-28 16:02:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1712


Note You need to log in before you can comment on or make changes to this bug.