From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LFymG-0004nW-Vf for qemu-devel@nongnu.org; Thu, 25 Dec 2008 17:34:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LFymE-0004nK-Hw for qemu-devel@nongnu.org; Thu, 25 Dec 2008 17:33:59 -0500 Received: from [199.232.76.173] (port=42458 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFymE-0004nH-9O for qemu-devel@nongnu.org; Thu, 25 Dec 2008 17:33:58 -0500 Received: from rv-out-0708.google.com ([209.85.198.251]:5595) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LFymD-0002GZ-Oo for qemu-devel@nongnu.org; Thu, 25 Dec 2008 17:33:58 -0500 Received: by rv-out-0708.google.com with SMTP id f25so3204381rvb.22 for ; Thu, 25 Dec 2008 14:33:56 -0800 (PST) Message-ID: Date: Thu, 25 Dec 2008 23:33:56 +0100 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] Re: MMIO address changes In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812011859.35859.paul@codesourcery.com> 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 2008/12/11 Vladimir Prus : > Paul Brook wrote: > >> I've just committed a patch that changes the MMIO callback interface for >> devices. Instead of being passed an absolute address these are now passed an >> offset from the start[1] of the memory region that was registered. > ... >> [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. > > This breaks something for me. I have: > > smc91c111_init(&nd_table[0], (0xb4000000 + 0x01800000 + 0x300) & 0x1fffffff, > get_irq(s, 7)); > > and smc91c111_init presently does: > > cpu_register_physical_memory(base, 16, iomemtype); > > and smc emulation promptly dies because an access with address of 0x30e is made, > with 0x300 apparently being the offset from the page start, with 0xe being the desired > offset. What is the cleanest way to address this? Reverting your change to > sms91c111.c works, fwiw. Masking the address with 15 should be acceptable for smc91c111.c I think. The other possibility is reverting the change to keep subtracting the base address, but which would be masked with TARGET_PAGE_MASK. Cheers