Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OB2BM-0007je-Nh for qemu-devel@nongnu.org; Sun, 09 May 2010 04:48:16 -0400 Received: from [140.186.70.92] (port=48590 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OB2BK-0007jV-L9 for qemu-devel@nongnu.org; Sun, 09 May 2010 04:48:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OB2BI-0005NY-Ju for qemu-devel@nongnu.org; Sun, 09 May 2010 04:48:14 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:55468) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OB2BI-0005NN-FM for qemu-devel@nongnu.org; Sun, 09 May 2010 04:48:12 -0400 Received: by pxi19 with SMTP id 19so1126339pxi.4 for ; Sun, 09 May 2010 01:48:11 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1273327815-21408-1-git-send-email-atar4qemu@gmail.com> Date: Sun, 9 May 2010 11:48:11 +0300 Message-ID: From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH 1/2] Pad iommu with an empty slot (necessary for SunOS 4.1.4) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Artyom Tarasenko Cc: qemu-devel@nongnu.org, Artyom Tarasenko On 5/9/10, Artyom Tarasenko wrote: > 2010/5/9 Blue Swirl : > > > On 5/8/10, Artyom Tarasenko wrote: > >> On the real hardware (SS-5, LX) the MMU is not padded, but aliased. > >> Software shouldn't use aliased addresses, neither should it crash > >> when it uses (on the real hardware it wouldn't). Using empty_slot > >> instead of aliasing can help with debugging such accesses. > > > > TurboSPARC Microprocessor User's Manual shows that there are > > additional pages after the main IOMMU for AFX registers. So this is > > not board specific, but depends on CPU/IOMMU versions. > > > I checked it on the real hw: on LX and SS-5 these are aliased MMU address= es. > SS-20 doesn't have any aliasing. But are your machines equipped with TurboSPARC or some other CPU? > At what address the additional AFX registers are located? Here's complete TurboSPARC IOMMU address map: PA[30:0] Register Access 1000_0000 IOMMU Control R/W 1000_0004 IOMMU Base Address R/W 1000_0014 Flush All IOTLB Entries W 1000_0018 Address Flush W 1000_1000 Asynchronous Fault Status R/W 1000_1004 Asynchronous Fault Address R/W 1000_1010 SBus Slot Con=EF=AC=81guration 0 R/W 1000_1014 SBus Slot Con=EF=AC=81guration 1 R/W 1000_1018 SBus Slot Con=EF=AC=81guration 2 R/W 1000_101C SBus Slot Con=EF=AC=81guration 3 R/W 1000_1020 SBus Slot Con=EF=AC=81guration 4 R/W 1000_1050 Memory Fault Status R/W 1000_1054 Memory Fault Address R/W 1000_2000 Module Identi=EF=AC=81cation R/W 1000_3018 Mask Identi=EF=AC=81cation R 1000_4000 AFX Queue Level W 1000_6000 AFX Queue Level R 1000_7000 AFX Queue Status R > > One approach would be that IOMMU_NREGS would be increased to cover > > these registers (with the bump in savevm version field) and > > iommu_init1() should check the version field to see how much MMIO to > > provide. > > > The problem I see here is that we already have too much registers: we > emulate SS-20 IOMMU (I guess), while SS-5 and LX seem to have only > 0x20 registers which are aliased all the way. > > > > But in order to avoid the savevm version change, iommu_init1() could > > just install dummy MMIO (in the TurboSPARC case), if OBP does not care > > if the read back data matches what has been written earlier. Because > > from OBP point of view this is identical to what your patch results > > in, I'd suppose this approach would also work. > > > OBP doesn't seem to care about these addresses at all. It's only the "MUN= IX" > SunOS 4.1.4 kernel who does. The "MUNIX" kernel is the only kernel avail= able > during the installation, so it is currently not possible to install 4.1.= 4. > Surprisingly "GENERIC" kernel which is on the disk after the > installation doesn't > try to access these address ranges either, so a disk image taken from a = live > system works. > > Actually access to the non-connected/aliased addresses may also be a > consequence of phys_page_find bug I mentioned before. When I run > install with -m 64 and -m 256 it tries to access different > non-connected addresses. May also be a SunOS bug of course. 256m used > to be a lot back then. Perhaps with 256MB, memory probing advances blindly from memory to IOMMU registers. Proll (used before OpenBIOS) did that once, with bad results :-). If this is true, 64M, 128M and 192M should show identical results and only with close or equal to 256M the accesses happen.