From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlQhp-0006Dp-Dv for qemu-devel@nongnu.org; Mon, 25 Jul 2011 15:20:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlQho-0000RX-9Y for qemu-devel@nongnu.org; Mon, 25 Jul 2011 15:20:45 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:55493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlQho-0000RI-6y for qemu-devel@nongnu.org; Mon, 25 Jul 2011 15:20:44 -0400 Received: by gwb19 with SMTP id 19so3313108gwb.4 for ; Mon, 25 Jul 2011 12:20:43 -0700 (PDT) Message-ID: <4E2DC209.9070103@codemonkey.ws> Date: Mon, 25 Jul 2011 14:20:41 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1311602584-23409-1-git-send-email-avi@redhat.com> <1311602584-23409-17-git-send-email-avi@redhat.com> In-Reply-To: <1311602584-23409-17-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 16/23] ioport: register ranges by byte aligned addresses always List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On 07/25/2011 09:02 AM, Avi Kivity wrote: > The I/O port space is byte addressable, even for word and long accesses. > > An example is the VMware svga card, which has long ports on offsets 0, > 1, and 2. > > Signed-off-by: Avi Kivity I've always thought this was odd but didn't know of a specific circumstance where it broke a device. This was a big problem with the old API. Devices don't register their interest in specific sizes. They may ignore certain size accesses but that's a device specific behavior. Reviewed-by: Anthony Liguori Regards, Anthony Liguori > --- > ioport.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ioport.c b/ioport.c > index 0d2611d..a32483b 100644 > --- a/ioport.c > +++ b/ioport.c > @@ -146,7 +146,7 @@ int register_ioport_read(pio_addr_t start, int length, int size, > hw_error("register_ioport_read: invalid size"); > return -1; > } > - for(i = start; i< start + length; i += size) { > + for(i = start; i< start + length; ++i) { > ioport_read_table[bsize][i] = func; > if (ioport_opaque[i] != NULL&& ioport_opaque[i] != opaque) > hw_error("register_ioport_read: invalid opaque for address 0x%x", > @@ -166,7 +166,7 @@ int register_ioport_write(pio_addr_t start, int length, int size, > hw_error("register_ioport_write: invalid size"); > return -1; > } > - for(i = start; i< start + length; i += size) { > + for(i = start; i< start + length; ++i) { > ioport_write_table[bsize][i] = func; > if (ioport_opaque[i] != NULL&& ioport_opaque[i] != opaque) > hw_error("register_ioport_write: invalid opaque for address 0x%x",