From patchwork Fri Aug 19 12:49:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 74239 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp295517qga; Fri, 19 Aug 2016 05:49:42 -0700 (PDT) X-Received: by 10.98.80.220 with SMTP id g89mr13831907pfj.12.1471610982164; Fri, 19 Aug 2016 05:49:42 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id u17si8161134pal.232.2016.08.19.05.49.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 05:49:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B6CAB1A1E11; Fri, 19 Aug 2016 05:49:41 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org 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 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: [edk2] [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: , Cc: Jordan Justen , Ard Biesheuvel Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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=66 Fixes: 94210dc95e9f7c6ff4066a9b35a288e6f1c271bf Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/QemuVideoDxe/Driver.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.9.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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 ( ); if (EFI_ERROR (Status)) { goto Done; } Status = EFI_UNSUPPORTED; + if (!IS_PCI_VGA (&Pci)) { + goto Done; + } Card = QemuVideoDetect(Pci.Hdr.VendorId, Pci.Hdr.DeviceId); if (Card != NULL) { DEBUG ((EFI_D_INFO, "QemuVideo: %s detected\n", Card->Name)); Status = EFI_SUCCESS; }