Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFPiA-0006rB-FZ for qemu-devel@nongnu.org; Tue, 01 Dec 2009 05:11:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFPi5-0006pF-7b for qemu-devel@nongnu.org; Tue, 01 Dec 2009 05:11:57 -0500 Received: from [199.232.76.173] (port=42929 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFPi4-0006p2-Sv for qemu-devel@nongnu.org; Tue, 01 Dec 2009 05:11:52 -0500 Received: from cantor2.suse.de ([195.135.220.15]:57782 helo=mx2.suse.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFPi4-0004cv-9x for qemu-devel@nongnu.org; Tue, 01 Dec 2009 05:11:52 -0500 Subject: Re: [Qemu-devel] [PATCH 01/11] S/390 CPU fake emulation Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <4B14E5DD.9080504@de.ibm.com> Date: Tue, 1 Dec 2009 11:11:49 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1259241800-2810-1-git-send-email-agraf@suse.de> <1259241800-2810-2-git-send-email-agraf@suse.de> <20091130181838.GA17595@volta.aurel32.net> <47F0CA71-B478-4E4A-8468-B71137363E78@suse.de> <4B14E5DD.9080504@de.ibm.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Carsten Otte Cc: Carsten Otte , qemu-devel@nongnu.org, Aurelien Jarno On 01.12.2009, at 10:46, Carsten Otte wrote: > Alexander Graf wrote: >>> I don't know what psw.mask represent, but it may be wrong. It should = be >>> a way to identify which TB can be reused, that is they have been >>> generated in the same CPU mode. >> psw.mask is rougly the same as RFLAGS, cr0 and cr4 on x86_64 = combined. So IMHO it looked like a pretty good identifier for TB = uniqueness. > I am not familar with qemu at all here, therefore the following = explanation may not fit here. I assume the translation block refers to = guest virtual to guest physical memory translations. In that case this = is not the right indicator on it's own. The right indicator which = translation the cpu would do would be pretty complex: > Our cpu keeps multiple seperate address spaces open at the same time = (similar to x86 with a bunch of cr0s), defined by address space control = elements in various control registers. Linux uses primary, secondary and = home space to address user space and kernel space. The third one is user = space once again for exec-type access (to implement stack execute = protection). PSW.mask selects which one is to be used for address = translation by _default_. Even worse, the cpu may load instructions and = data from different adddress spaces (secondary space mdoe). Yet more = worse some instructions use "access register mode" where a general = purpose register points to yet another address space. A detailed = documentation can be found here: = http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/dz9zr002/3.0?DT=3D20= 030424140649 >=20 > That said, I think it's best to keep out softmmu for now. It's not = needed for kvm operation and very complex to do right. Ah ok, so we're missing the asce register information for softmmu = uniqueness. Well - I guess I should put a comment there that tells = anyone who feels like implementing a softmmu target that this is a = pitfall. Alex=