From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L9M83-0003Xu-VS for qemu-devel@nongnu.org; Sun, 07 Dec 2008 11:05:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L9M82-0003X7-GM for qemu-devel@nongnu.org; Sun, 07 Dec 2008 11:05:07 -0500 Received: from [199.232.76.173] (port=47248 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9M82-0003Ww-7X for qemu-devel@nongnu.org; Sun, 07 Dec 2008 11:05:06 -0500 Received: from rv-out-0708.google.com ([209.85.198.247]:15366) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L9M81-000790-K4 for qemu-devel@nongnu.org; Sun, 07 Dec 2008 11:05:05 -0500 Received: by rv-out-0708.google.com with SMTP id f25so759984rvb.22 for ; Sun, 07 Dec 2008 08:05:03 -0800 (PST) Message-ID: Date: Sun, 7 Dec 2008 17:05:03 +0100 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [PATCH] usb-ohci: Add address masking. In-Reply-To: <200812051352.mB5DqhQU026115@smtp11.dti.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812011859.35859.paul@codesourcery.com> <200812051352.mB5DqhQU026115@smtp11.dti.ne.jp> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paul Brook 2008/12/5 : > Hi, > About this >> [1] It's actually the offset from the start of the first page of that region. >> In practice this difference doesn't matter, and makes the implementation a >> lot simpler. > again. > > The patch below adds address mask(0xff) to mmio read/write funcs in usb-ohci. > I know now we are deleting this kind of address mask/subtract things. > But because of the restriction [1] above, we have to add address mask here. > > The mmio change potentially breaks PCI device emulations which has mmio region > smaller than page size, like usb-ohci and rtl8139 (both have 256byte), because > PCI memory regions are configured to be aligned to it size, but to page. I think it's more correct to substract an offset from the address because masking causes the address to wrap and effectively the registers become visible at multiple addresses. On the other hand I don't see why we need the restriction [1]. Looking at exec.c, at least for io regions, it should be acceptable for ->region_offset to be unaligned. > > usb-ohci is really broken now. > rtl8139 is OK because it already has address mask. > Others are not checked. Cheers