From patchwork Wed Jan 16 17:59:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 212903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D6DC22C007A for ; Thu, 17 Jan 2013 04:59:58 +1100 (EST) Received: from localhost ([::1]:44518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvXHJ-0001kV-07 for incoming@patchwork.ozlabs.org; Wed, 16 Jan 2013 12:59:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvXH0-0001bP-QJ for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:59:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvXGz-0008Hd-PE for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:59:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvXGz-0008HZ-ID for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:59:37 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0GHxaOZ024496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 16 Jan 2013 12:59:37 -0500 Received: from garlic.redhat.com (vpn1-5-53.ams2.redhat.com [10.36.5.53]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0GHxVkm013985; Wed, 16 Jan 2013 12:59:35 -0500 From: Alon Levy To: qemu-devel@nongnu.org Date: Wed, 16 Jan 2013 19:59:30 +0200 Message-Id: <1358359170-19271-3-git-send-email-alevy@redhat.com> In-Reply-To: <1358359170-19271-1-git-send-email-alevy@redhat.com> References: <50F5738A.7080904@redhat.com> <1358359170-19271-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kraxel@redhat.com Subject: [Qemu-devel] [PATCH v2 2/2] qxl: change rom size to 8192 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This is a simpler solution to 869981, where migration breaks since qxl's rom bar size has changed. Instead of ignoring fields in QXLRom, which is what has actually changed, we remove some of the modes, a mechanism already accounted for by the guest. Added assert so that rom size will fit the future QXLRom increases via spice-protocol changes. Signed-off-by: Alon Levy --- hw/qxl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 0d81816..0cd854a 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -79,10 +79,7 @@ QXL_MODE(x_res, y_res, 32, orientation) #define QXL_MODE_EX(x_res, y_res) \ - QXL_MODE_16_32(x_res, y_res, 0), \ - QXL_MODE_16_32(y_res, x_res, 1), \ - QXL_MODE_16_32(x_res, y_res, 2), \ - QXL_MODE_16_32(y_res, x_res, 3) + QXL_MODE_16_32(x_res, y_res, 0) static QXLMode qxl_modes[] = { QXL_MODE_EX(640, 480), @@ -306,10 +303,13 @@ static inline uint32_t msb_mask(uint32_t val) static ram_addr_t qxl_rom_size(void) { - uint32_t rom_size = sizeof(QXLRom) + sizeof(QXLModes) + sizeof(qxl_modes); + uint32_t required_rom_size = sizeof(QXLRom) + sizeof(QXLModes) + + sizeof(qxl_modes); + uint32_t rom_size = 8192; /* two pages */ - rom_size = MAX(rom_size, TARGET_PAGE_SIZE); - rom_size = msb_mask(rom_size * 2 - 1); + required_rom_size = MAX(required_rom_size, TARGET_PAGE_SIZE); + required_rom_size = msb_mask(required_rom_size * 2 - 1); + assert(required_rom_size <= rom_size); return rom_size; }