From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 17E3C1A1E11 for ; Fri, 19 Aug 2016 05:49:40 -0700 (PDT) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E23881F07; Fri, 19 Aug 2016 12:49:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-13.phx2.redhat.com [10.3.116.13]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7JCnaSg011583; Fri, 19 Aug 2016 08:49:38 -0400 From: Laszlo Ersek To: edk2-devel-01 Cc: Ard Biesheuvel , Jordan Justen Date: Fri, 19 Aug 2016 14:49:22 +0200 Message-Id: <20160819124932.29711-2-lersek@redhat.com> In-Reply-To: <20160819124932.29711-1-lersek@redhat.com> References: <20160819124932.29711-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 19 Aug 2016 12:49:39 +0000 (UTC) Subject: [PATCH 01/11] OvmfPkg/QemuVideoDxe: don't incorrectly bind virtio-gpu-pci X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 12:49:40 -0000 Content-Transfer-Encoding: quoted-printable The PCI (Vendor ID, Device ID) pair (0x1af4, 0x1050) stands for both the virtio-vga and the virtio-gpu-pci device models of QEMU. They differ in two things: - the former has a VGA-compatibility linear framebuffer on top of the latter, - the former has PCI_CLASS_DISPLAY_VGA device class, while the latter has PCI_CLASS_DISPLAY_OTHER. In commit 94210dc95e9f ("OvmfPkg: QemuVideoDxe: add virtio-vga support"), we enabled QemuVideoDxe to drive virtio-vga simply by adding its (Vendor ID, Device ID) pair to gQemuVideoCardList. This change inadvertently allowed QemuVideoDxe to bind virtio-gpu-pci, which it cannot drive though. Restrict QemuVideoDxe to PCI_CLASS_DISPLAY_VGA, in order to exclude virtio-gpu-pci. For the other cards that QemuVideoDxe drives, this makes no difference. (Note that OvmfPkg's PlatformBootManagerLib instance has always only added PCI_CLASS_DISPLAY_VGA devices to ConOut; see DetectAndPreparePlatformPciDevicePath().) Cc: Ard Biesheuvel Cc: Jordan Justen Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=3D66 Fixes: 94210dc95e9f7c6ff4066a9b35a288e6f1c271bf Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/QemuVideoDxe/Driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c index 8d962b443898..fc8025ec46de 100644 --- a/OvmfPkg/QemuVideoDxe/Driver.c +++ b/OvmfPkg/QemuVideoDxe/Driver.c @@ -131,12 +131,15 @@ QemuVideoControllerDriverSupported ( );=0D if (EFI_ERROR (Status)) {=0D goto Done;=0D }=0D =0D Status =3D EFI_UNSUPPORTED;=0D + if (!IS_PCI_VGA (&Pci)) {=0D + goto Done;=0D + }=0D Card =3D QemuVideoDetect(Pci.Hdr.VendorId, Pci.Hdr.DeviceId);=0D if (Card !=3D NULL) {=0D DEBUG ((EFI_D_INFO, "QemuVideo: %s detected\n", Card->Name));=0D Status =3D EFI_SUCCESS;=0D }=0D =0D --=20 2.9.2