From patchwork Mon Nov 7 09:27:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 124025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 68EC0B6F69 for ; Mon, 7 Nov 2011 20:28:15 +1100 (EST) Received: from localhost ([::1]:54746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNLUv-0004s6-Tz for incoming@patchwork.ozlabs.org; Mon, 07 Nov 2011 04:28:09 -0500 Received: from eggs.gnu.org ([140.186.70.92]:46140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNLTz-0001Vj-GT for qemu-devel@nongnu.org; Mon, 07 Nov 2011 04:27:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNLTx-0002CA-Hj for qemu-devel@nongnu.org; Mon, 07 Nov 2011 04:27:11 -0500 Received: from mtagate2.uk.ibm.com ([194.196.100.162]:58996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNLTx-0002Bm-AT for qemu-devel@nongnu.org; Mon, 07 Nov 2011 04:27:09 -0500 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pA79R8iP016173 for ; Mon, 7 Nov 2011 09:27:08 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA79R7QC1937660 for ; Mon, 7 Nov 2011 09:27:08 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA79R7IZ026428 for ; Mon, 7 Nov 2011 02:27:07 -0700 Received: from localhost (dyn-9-174-219-31.manchester-maybrook.uk.ibm.com [9.174.219.31]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pA79R7RU026419; Mon, 7 Nov 2011 02:27:07 -0700 From: Stefan Hajnoczi To: Date: Mon, 7 Nov 2011 09:27:00 +0000 Message-Id: <1320658020-4374-6-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.1 In-Reply-To: <1320658020-4374-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1320658020-4374-1-git-send-email-stefanha@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 194.196.100.162 Cc: Anthony PERARD , Anthony Liguori , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 5/5] xen-platform: Fix IO port read/write functions 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 From: Anthony PERARD Somehow, the read/write functions handle an offset that does not exist anymore. Signed-off-by: Anthony PERARD Signed-off-by: Stefan Hajnoczi --- hw/xen_platform.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/xen_platform.c b/hw/xen_platform.c index 6e3ba8b..5e792f5 100644 --- a/hw/xen_platform.c +++ b/hw/xen_platform.c @@ -113,7 +113,7 @@ static void platform_fixed_ioport_writew(void *opaque, uint32_t addr, uint32_t v { PCIXenPlatformState *s = opaque; - switch (addr - XEN_PLATFORM_IOPORT) { + switch (addr) { case 0: /* Unplug devices. Value is a bitmask of which devices to unplug, with bit 0 the IDE devices, bit 1 the network @@ -152,7 +152,7 @@ static void platform_fixed_ioport_writew(void *opaque, uint32_t addr, uint32_t v static void platform_fixed_ioport_writel(void *opaque, uint32_t addr, uint32_t val) { - switch (addr - XEN_PLATFORM_IOPORT) { + switch (addr) { case 0: /* PV driver version */ break; @@ -163,7 +163,7 @@ static void platform_fixed_ioport_writeb(void *opaque, uint32_t addr, uint32_t v { PCIXenPlatformState *s = opaque; - switch (addr - XEN_PLATFORM_IOPORT) { + switch (addr) { case 0: /* Platform flags */ { hvmmem_type_t mem_type = (val & PFFLAG_ROM_LOCK) ? HVMMEM_ram_ro : HVMMEM_ram_rw; @@ -186,7 +186,7 @@ static uint32_t platform_fixed_ioport_readw(void *opaque, uint32_t addr) { PCIXenPlatformState *s = opaque; - switch (addr - XEN_PLATFORM_IOPORT) { + switch (addr) { case 0: if (s->drivers_blacklisted) { /* The drivers will recognise this magic number and refuse @@ -205,7 +205,7 @@ static uint32_t platform_fixed_ioport_readb(void *opaque, uint32_t addr) { PCIXenPlatformState *s = opaque; - switch (addr - XEN_PLATFORM_IOPORT) { + switch (addr) { case 0: /* Platform flags */ return s->flags; @@ -221,7 +221,7 @@ static void platform_fixed_ioport_reset(void *opaque) { PCIXenPlatformState *s = opaque; - platform_fixed_ioport_writeb(s, XEN_PLATFORM_IOPORT, 0); + platform_fixed_ioport_writeb(s, 0, 0); } const MemoryRegionPortio xen_platform_ioport[] = { @@ -251,7 +251,7 @@ static void platform_fixed_ioport_init(PCIXenPlatformState* s) static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr) { if (addr == 0) { - return platform_fixed_ioport_readb(opaque, XEN_PLATFORM_IOPORT); + return platform_fixed_ioport_readb(opaque, 0); } else { return ~0u; } @@ -263,7 +263,7 @@ static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t val switch (addr) { case 0: /* Platform flags */ - platform_fixed_ioport_writeb(opaque, XEN_PLATFORM_IOPORT, val); + platform_fixed_ioport_writeb(opaque, 0, val); break; case 8: log_writeb(s, val); @@ -321,7 +321,7 @@ static int xen_platform_post_load(void *opaque, int version_id) { PCIXenPlatformState *s = opaque; - platform_fixed_ioport_writeb(s, XEN_PLATFORM_IOPORT, s->flags); + platform_fixed_ioport_writeb(s, 0, s->flags); return 0; }