From patchwork Wed May 9 11:26:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 157917 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 E2F82B6FA5 for ; Wed, 9 May 2012 21:26:31 +1000 (EST) Received: from localhost ([::1]:52584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SS52L-0001YW-LT for incoming@patchwork.ozlabs.org; Wed, 09 May 2012 07:26:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SS52B-0001Xd-Vj for qemu-devel@nongnu.org; Wed, 09 May 2012 07:26:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SS522-0001mP-UA for qemu-devel@nongnu.org; Wed, 09 May 2012 07:26:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SS522-0001m8-MU for qemu-devel@nongnu.org; Wed, 09 May 2012 07:26:10 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q49BQ893007531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 May 2012 07:26:08 -0400 Received: from garlic.tlv.redhat.com (spice-ovirt.tlv.redhat.com [10.35.4.71]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q49BQ6aS026562; Wed, 9 May 2012 07:26:07 -0400 From: Alon Levy To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Wed, 9 May 2012 14:26:06 +0300 Message-Id: <1336562766-25682-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [post 1.1 PATCH] hw/qxl: disallow non sync io for revision >= 3 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 The guest drivers should already know how to use async for revision 3. But since it's still possible to have an older driver with revision 3 that doesn't check for the revision, require a new parameter "force_async", which we can later turn to 1 by default. Signed-off-by: Alon Levy --- hw/qxl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hw/qxl.c b/hw/qxl.c index 6c11e70..451e8e5 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1316,6 +1316,23 @@ static void ioport_write(void *opaque, target_phys_addr_t addr, return; } + if (d->force_async && d->revision >= 3) { + switch (io_port) { + case QXL_IO_UPDATE_AREA: + case QXL_IO_MEMSLOT_ADD: + case QXL_IO_CREATE_PRIMARY: + case QXL_IO_DESTROY_PRIMARY: + case QXL_IO_DESTROY_SURFACE_WAIT: + case QXL_IO_DESTROY_ALL_SURFACES: + qxl_guest_bug(d, "sync io %d not supported for revision >= 3", + io_port); + return; + break; + default: + break; + } + } + /* we change the io_port to avoid ifdeffery in the main switch */ orig_io_port = io_port; switch (io_port) { @@ -2036,6 +2053,7 @@ static Property qxl_properties[] = { DEFINE_PROP_UINT32("ram_size_mb", PCIQXLDevice, ram_size_mb, -1), DEFINE_PROP_UINT32("vram_size_mb", PCIQXLDevice, vram32_size_mb, -1), DEFINE_PROP_UINT32("vram64_size_mb", PCIQXLDevice, vram_size_mb, -1), + DEFINE_PROP_UINT32("force_async", PCIQXLDevice, force_async, 0), DEFINE_PROP_END_OF_LIST(), };