Received: from [140.186.70.92] (port=37094 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMzGF-0003jp-Cx for qemu-devel@nongnu.org; Fri, 11 Jun 2010 04:06:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMzGD-00061f-Bj for qemu-devel@nongnu.org; Fri, 11 Jun 2010 04:06:43 -0400 Received: from hall.aurel32.net ([88.191.82.174]:48382) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMzGD-00061P-6Q for qemu-devel@nongnu.org; Fri, 11 Jun 2010 04:06:41 -0400 Date: Fri, 11 Jun 2010 10:06:34 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 15/35] tcg-s390: Query instruction extensions that are installed. Message-ID: <20100611080634.GP26968@volta.aurel32.net> References: <1275678883-7082-1-git-send-email-rth@twiddle.net> <1275678883-7082-16-git-send-email-rth@twiddle.net> <20100610102815.GM26968@volta.aurel32.net> <4C1164ED.7020403@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <4C1164ED.7020403@twiddle.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, agraf@suse.de On Thu, Jun 10, 2010 at 03:19:25PM -0700, Richard Henderson wrote: > On 06/10/2010 03:28 AM, Aurelien Jarno wrote: > >> + asm volatile(".word 0xb2b0,0x1000" > >> + : "=r"(r0) : "0"(0), "r"(r1) : "memory", "cc"); > > > > Wouldn't it be possible to use the instruction directly instead of > > dumping the opcode values? Same below > > No, they aren't recognized by older assemblers. For instance, the one shipped > with RHEL 5.5, and possibly even by Debian Lenny (I don't currently have access > to that machine to check). Apparently some of these are quite new insns -- 2008 era. > > That said, all the hardware to which either I or agraf have access are the latest > z10 machines. Frankly I expect that to be true of most if not all machines, since > I think it's just a microcode update which everyone with an active support contract > can get. > FYI, that's the /proc/cpuinfo of s390 machines I have (more or less) access: features : esan3 zarch msa ldisp features : esan3 zarch stfle msa ldisp eimm dfp features : esan3 zarch stfle msa ldisp eimm dfp etf3eh highgprs So that's seems fine. However, looking more in details in the code again, I do wonder about this part: > + /* Test for z/Architecture. Required even in 31-bit mode. */ > + got_sigill = 0; > + /* agr %r0,%r0 */ > + asm volatile(".word 0xb908,0x0000" : "=r"(r0) : : "cc"); > + if (!got_sigill) { > + facilities |= FACILITY_ZARCH | FACILITY_ZARCH_ACTIVE; > + } > + What's the difference between FACILITY_ZARCH and FACILITY_ZARCH_ACTIVE, as both are actually flagged together. My guess is that FACILITY_ZARCH_ACTIVE is needed in 64-bit mode, why FACILITY_ZARCH is only needed for a possible future 32-bit mode. Is it correct? -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net