From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFPId-0000eJ-Mt for qemu-devel@nongnu.org; Tue, 01 Dec 2009 04:45:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFPIZ-0000d9-OO for qemu-devel@nongnu.org; Tue, 01 Dec 2009 04:45:35 -0500 Received: from [199.232.76.173] (port=57623 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFPIZ-0000d3-In for qemu-devel@nongnu.org; Tue, 01 Dec 2009 04:45:31 -0500 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:56370) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NFPIY-0000xV-J1 for qemu-devel@nongnu.org; Tue, 01 Dec 2009 04:45:31 -0500 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id nB19jSBN019204 for ; Tue, 1 Dec 2009 09:45:28 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nB19jR8h1007690 for ; Tue, 1 Dec 2009 09:45:27 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id nB19jRXl023645 for ; Tue, 1 Dec 2009 09:45:27 GMT Message-ID: <4B14E5DD.9080504@de.ibm.com> Date: Tue, 01 Dec 2009 10:46:05 +0100 From: Carsten Otte MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 01/11] S/390 CPU fake emulation 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> In-Reply-To: <47F0CA71-B478-4E4A-8468-B71137363E78@suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Carsten Otte , qemu-devel@nongnu.org, Aurelien Jarno 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=20030424140649 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.