From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39423 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJtU4-0007IF-UD for qemu-devel@nongnu.org; Wed, 02 Jun 2010 15:20:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJtU3-0008Fp-I6 for qemu-devel@nongnu.org; Wed, 02 Jun 2010 15:20:12 -0400 Received: from fg-out-1718.google.com ([72.14.220.156]:19496) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJtU3-0008FL-AZ for qemu-devel@nongnu.org; Wed, 02 Jun 2010 15:20:11 -0400 Received: by fg-out-1718.google.com with SMTP id 16so100126fgg.10 for ; Wed, 02 Jun 2010 12:20:10 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4C0660E6.20703@twiddle.net> References: <20100601200434.5908.19495.stgit@skyserv> <20100601201227.5908.12931.stgit@skyserv> <4C057114.7000308@twiddle.net> <4C0660E6.20703@twiddle.net> Date: Wed, 2 Jun 2010 23:20:10 +0400 Message-ID: Subject: Re: [Qemu-devel] [PATCH 2/8] sparc64: fix missing address masking From: Igor Kovalenko Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org On Wed, Jun 2, 2010 at 5:47 PM, Richard Henderson wrote: > On 06/01/2010 09:29 PM, Igor Kovalenko wrote: >> On Wed, Jun 2, 2010 at 12:44 AM, Richard Henderson wro= te: >>> On 06/01/2010 01:12 PM, Igor V. Kovalenko wrote: >>>> + =A0 =A0if ((env->pstate & PS_AM) && is_translating_asi(asi)) { >>>> + =A0 =A0 =A0 =A0addr &=3D 0xffffffffULL; >>>> + =A0 =A0} >>> >>> I suggest that these be written instead as >>> >>> =A0if (is_translating_asi(asi)) { >>> =A0 =A0addr =3D address_mask(addr); >>> =A0} >>> >>> That should allow you to remove some of the ifdefs. >> >> All address masking is done for sparc64 target only, sparc32 does not >> have the notion of translating asi. > > Of course I know that. > >> I think it's better to do debug printf macro trick ... > > ... with no evidence. =A0The compiler is happy to optimize away > the entire if statement without having to resort to macros. > >> ... then but I see no real benefit at the moment. > > Avoiding ifdefs isn't a benefit? Reading through the code you will have false evidence of possible extra steps taken by hardware we emulate. Looking at sparcv8 docs it is clear that similar steps are done there as well so I'll drop ifdefs at call sites and redo the patch. --=20 Kind regards, Igor V. Kovalenko