From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH] kvm-s390: userspace access to guest storage keys Date: Tue, 10 May 2011 13:29:56 +0200 Message-ID: <4DC921B4.1060609@de.ibm.com> References: <4DC3CC83.4080405@de.ibm.com> <4DC7A918.6050807@redhat.com> <4DC7CE03.1070008@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Carsten Otte , KVM list , Martin Schwidefsky , Jens Freimann To: Alexander Graf Return-path: Received: from mtagate6.uk.ibm.com ([194.196.100.166]:39752 "EHLO mtagate6.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753428Ab1EJLaV (ORCPT ); Tue, 10 May 2011 07:30:21 -0400 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate6.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p4ABUIBu024349 for ; Tue, 10 May 2011 11:30:18 GMT Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p4ABUIfv1847524 for ; Tue, 10 May 2011 12:30:18 +0100 Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p4ABTtOm010184 for ; Tue, 10 May 2011 05:29:56 -0600 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 09/05/11 13:32, Alexander Graf wrote: > > On 09.05.2011, at 13:20, Avi Kivity wrote: > >> On 05/09/2011 01:11 PM, Alexander Graf wrote: >>>> >>>> And not in main memory, either? >>> >>> Nope - storage keys are only accessible using special instructions. They're not in RAM (visible to a guest) :). >>> >> >> Interesting, so where are they kept? An on-chip memory? That would limit the amount of main >> memory to that indexed by the chip. Extra off-chip memory? > > I'll leave the answer of this question to the real experts :). All I know is that the ISA defines special instructions > to fetch them, so the question on where they are stored is "implementation dependent". In qemu for example, they are > kept in an extra array that's just malloc'ed. Dont know really - the HW folks probably know it better, so I am just guessing. The final location is probably somewhere in the HSA (hardware system area) which is backed by real memory and hidden by the cpu microcode. (there is no way to access this memory directly). But parts of the storage keys are also mirrored by the different cache levels and TLB (e.g. write protection via page tables). Christian