From patchwork Thu Aug 11 07:40:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 109560 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 B3F20B6F8E for ; Thu, 11 Aug 2011 17:40:45 +1000 (EST) Received: from localhost ([::1]:46963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrPsf-0008DS-LM for incoming@patchwork.ozlabs.org; Thu, 11 Aug 2011 03:40:41 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrPsX-0008D4-Gy for qemu-devel@nongnu.org; Thu, 11 Aug 2011 03:40:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QrPsW-0005hK-Jq for qemu-devel@nongnu.org; Thu, 11 Aug 2011 03:40:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrPsW-0005h9-4M for qemu-devel@nongnu.org; Thu, 11 Aug 2011 03:40:32 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7B7eTUN009691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Aug 2011 03:40:30 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7B7eSfb013641; Thu, 11 Aug 2011 03:40:28 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 28EFC250B4A; Thu, 11 Aug 2011 10:40:28 +0300 (IDT) From: Avi Kivity To: Anthony Liguori , Gerhard Wiesinger Date: Thu, 11 Aug 2011 10:40:26 +0300 Message-Id: <1313048426-17273-3-git-send-email-avi@redhat.com> In-Reply-To: <1313048426-17273-1-git-send-email-avi@redhat.com> References: <1313048426-17273-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 2/2] memory: crack wide ioport accesses into smaller ones when needed 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 memory API supports cracking wide accesses into narrower ones when needed; but this was no implemented for the pio address space, causing lsi53c895a's IO BAR to malfunction. Fix by correctly cracking wide accesses when needed. Signed-off-by: Avi Kivity --- memory.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/memory.c b/memory.c index 3c18e70..81032b6 100644 --- a/memory.c +++ b/memory.c @@ -400,7 +400,11 @@ static void memory_region_iorange_read(IORange *iorange, } return; } - *data = mr->ops->read(mr->opaque, offset, width); + *data = 0; + access_with_adjusted_size(offset, data, width, + mr->ops->impl.min_access_size, + mr->ops->impl.max_access_size, + memory_region_read_accessor, mr); } static void memory_region_iorange_write(IORange *iorange, @@ -418,7 +422,10 @@ static void memory_region_iorange_write(IORange *iorange, } return; } - mr->ops->write(mr->opaque, offset, data, width); + access_with_adjusted_size(offset, &data, width, + mr->ops->impl.min_access_size, + mr->ops->impl.max_access_size, + memory_region_write_accessor, mr); } static const IORangeOps memory_region_iorange_ops = {