Received: from eggs.gnu.org ([2001:4830:134:3::10]:60287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxn33-0007Wa-Bb for qemu-devel@nongnu.org; Wed, 27 May 2015 21:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxn30-00014P-4J for qemu-devel@nongnu.org; Wed, 27 May 2015 21:55:53 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46425 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxn2z-00012h-RD for qemu-devel@nongnu.org; Wed, 27 May 2015 21:55:50 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) From: Alexander Graf In-Reply-To: <20150527155748.GA12688@aurel32.net> Date: Thu, 28 May 2015 03:55:46 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <63E8C99F-E402-4929-BF85-3255DB68CA9F@suse.de> References: <1432511251-22515-1-git-send-email-aurelien@aurel32.net> <1432511251-22515-9-git-send-email-aurelien@aurel32.net> <5563AB72.3070601@twiddle.net> <20150526060313.GC29207@aurel32.net> <556498A2.3050601@twiddle.net> <20150526220329.GB12677@aurel32.net> <5565D525.1010608@twiddle.net> <20150527155748.GA12688@aurel32.net> Subject: Re: [Qemu-devel] [PATCH 08/10] target-s390x: implement STFLE instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: "qemu-devel@nongnu.org" , Richard Henderson > Am 27.05.2015 um 17:57 schrieb Aurelien Jarno : >=20 >> On 2015-05-27 07:31, Richard Henderson wrote: >>> On 05/26/2015 03:03 PM, Aurelien Jarno wrote: >>> Ok, I understand now. That said I don't see how implementing STFLE will >>> break that. I think it will actually improve things by enabling more >>> facilities and thus making the kernel happier (but maybe not enough). >>=20 >> Somewhat amusingly, by not implementing STFLE we bypass this check. >=20 > Oh, I see the whole picture now. >=20 >>>> #elif defined(CONFIG_MARCH_Z990) >>>> .long 1, 0xc0002000 >>>=20 >>> For this one we only miss one instruction in the LD facility. I have it >>> on my TODO list, though it might take a few weeks until it goes to the >>> top. >>=20 >> Which one? >=20 > CVBY, but anyway we don't implement CVB and CVBG either... >=20 >=20 >>>> #elif defined(CONFIG_MARCH_Z900) >>>> .long 1, 0xc0000000 >>>=20 >>> This corresponds to the current value we provide. CONFIG_MARCH_Z900 also= >>> correspond to the configuration of the Debian kernel, that's why I am >>> able to boot kernels. >>=20 >> Ah, well that's something. Fedora defaults to z9-109, and I think SuSE d= oes >> the same. >=20 > One strategy would be to enable the bit in STFLE whether the feature is > fully implemented by TCG or not, using the values provided by the CPU > model (IBM patches). So how about we add a "force" parameter to the -cpu command line option to s= uppress masking of the facility bits with what tcg implements? > After all we have plenty of non-implemented basic > instructions (e.g. all the HFP ones). The risk is that the userland > starts to use some optimized libraries due to that. On the other hand > if the kernel is compiled with this option, chances are that the > userland is built with the same instruction set. >=20 > Having a quick look at big sets of missing instructions, it looks like > we are mostly missing HFP (most are in the basic instructions), DFP, > high-word, extended translations, and message-security-assist. high-word > facility should be relatively easy to add, extended translation a bit > more complex. We might want to use libdecnumber like on PPC fro DFP. It > looks like the most problematic are therefore HFP (but that's already > the case anyway) and message-security-assist. >=20 > Then there are plenty of facilities with only a few instructions > missing. They might be tricky to implement though (i.e. transactional > memory). On ppc we just fail every transaction which seems to do the trick. Can we do= the same for s390? >=20 > One other strategy would be to create a "any" CPU for linux-user and > also offer it to the softmmu mode. I think for softmmu we should stick with real world models, either masked wi= th tcg's implemented facilities or not. In fact, how about instead of masking, we just make -cpu fail on creation if= it wants a facility that tcg doesn't implement yet? Then we can hint the us= er to -cpu ec12,force to make it work nevertheless Alex >=20 > --=20 > Aurelien Jarno GPG: 4096R/1DDD8C9B > aurelien@aurel32.net http://www.aurel32.net