From patchwork Wed Nov 17 11:06:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 71545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 15CA8B7183 for ; Wed, 17 Nov 2010 22:08:19 +1100 (EST) Received: from localhost ([127.0.0.1]:48361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIfs8-0004rK-2q for incoming@patchwork.ozlabs.org; Wed, 17 Nov 2010 06:08:16 -0500 Received: from [140.186.70.92] (port=37830 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIfql-0004px-FC for qemu-devel@nongnu.org; Wed, 17 Nov 2010 06:06:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PIfqi-00063D-AH for qemu-devel@nongnu.org; Wed, 17 Nov 2010 06:06:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PIfqi-000634-0J for qemu-devel@nongnu.org; Wed, 17 Nov 2010 06:06:48 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAHB6kLa017748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Nov 2010 06:06:47 -0500 Received: from rincewind.home.kraxel.org (vpn2-10-218.ams2.redhat.com [10.36.10.218]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAHB6j9k008047; Wed, 17 Nov 2010 06:06:46 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 7413E458BD; Wed, 17 Nov 2010 12:06:44 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 17 Nov 2010 12:06:44 +0100 Message-Id: <1289992004-6291-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann , avi@redhat.com Subject: [Qemu-devel] [PATCH] vgabios update: handle compatibility with older qemu versions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As pointed out by avi the vgabios update is guest-visible and thus has migration implications. One change is that the vga has a valid pci rom bar now. We already have a pci bus property to enable/disable the rom bar and we'll load the bios via fw_cfg as fallback for the no-rom-bar case. So we just have to add compat properties to handle this case. A second change is that the magic bochs lfb @ 0xe0000000 is gone. When live-migrating a guest from a older qemu version it might be using the lfb though, so we have to keep it for the old machine types. The patch enables the bochs lfb in case we don't have the pci rom bar enabled (i.e. we are in 0.13+older compat mode). This patch depends on these patches which add (and use) the pc-0.13 machine type: http://patchwork.ozlabs.org/patch/70797/ http://patchwork.ozlabs.org/patch/70798/ Signed-off-by: Gerd Hoffmann Cc: avi@redhat.com --- hw/pc_piix.c | 16 ++++++++++++++++ hw/vga-pci.c | 5 +++++ hw/vmware_vga.c | 5 +++++ 3 files changed, 26 insertions(+), 0 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index e9752db..a85d58e 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -231,6 +231,14 @@ static QEMUMachine pc_machine_v0_13 = { .driver = "virtio-9p-pci", .property = "vectors", .value = stringify(0), + },{ + .driver = "VGA", + .property = "rombar", + .value = stringify(0), + },{ + .driver = "vmware-svga", + .property = "rombar", + .value = stringify(0), }, { /* end of list */ } }, @@ -250,6 +258,14 @@ static QEMUMachine pc_machine_v0_12 = { .driver = "virtio-serial-pci", .property = "vectors", .value = stringify(0), + },{ + .driver = "VGA", + .property = "rombar", + .value = stringify(0), + },{ + .driver = "vmware-svga", + .property = "rombar", + .value = stringify(0), }, { /* end of list */ } } diff --git a/hw/vga-pci.c b/hw/vga-pci.c index 28b174b..4931eee 100644 --- a/hw/vga-pci.c +++ b/hw/vga-pci.c @@ -96,6 +96,11 @@ static int pci_vga_initfn(PCIDevice *dev) pci_register_bar(&d->dev, 0, VGA_RAM_SIZE, PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map); + if (!dev->rom_bar) { + /* compatibility with pc-0.13 and older */ + vga_init_vbe(s); + } + return 0; } diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c index e96b7db..e852620 100644 --- a/hw/vmware_vga.c +++ b/hw/vmware_vga.c @@ -1305,6 +1305,11 @@ static int pci_vmsvga_initfn(PCIDevice *dev) vmsvga_init(&s->chip, VGA_RAM_SIZE); + if (!dev->rom_bar) { + /* compatibility with pc-0.13 and older */ + vga_init_vbe(&s->chip.vga); + } + return 0; }