From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Aneesh Kumar K.V" Subject: Re: [PATCH 2/6] KVM: PPC: BOOK3S: HV: Deny virtual page class key update via h_protect Date: Wed, 02 Jul 2014 17:42:25 +0530 Message-ID: <87tx70m02e.fsf@linux.vnet.ibm.com> References: <1404040655-12076-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1404040655-12076-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <20140702045002.GC16865@drongo> Mime-Version: 1.0 Content-Type: text/plain Cc: agraf@suse.de, benh@kernel.crashing.org, linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Paul Mackerras Return-path: Received: from e28smtp03.in.ibm.com ([122.248.162.3]:48381 "EHLO e28smtp03.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752037AbaGBMMe (ORCPT ); Wed, 2 Jul 2014 08:12:34 -0400 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 Jul 2014 17:42:31 +0530 In-Reply-To: <20140702045002.GC16865@drongo> Sender: kvm-owner@vger.kernel.org List-ID: Paul Mackerras writes: > On Sun, Jun 29, 2014 at 04:47:31PM +0530, Aneesh Kumar K.V wrote: >> This makes it consistent with h_enter where we clear the key >> bits. We also want to use virtual page class key protection mechanism >> for indicating host page fault. For that we will be using key class >> index 30 and 31. So prevent the guest from updating key bits until >> we add proper support for virtual page class protection mechanism for >> the guest. This will not have any impact for PAPR linux guest because >> Linux guest currently don't use virtual page class key protection model > > As things stand, without this patch series, we do actually have > everything we need in the kernel for guests to use virtual page class > keys. Arguably we should have a capability to tell userspace how many > storage keys the guest can use, but that's the only missing piece as > far as I can see. yes. > > If we add such a capability, I can't see any reason why we should need > to disable guest use of storage keys in this patchset. With this patchset, we would need additonal changes to find out whether the key fault happened because of the guest's usage of the key. I was planning to do that as an add-on series to keep the changes in this minimal. Also since linux didn't use keys i was not sure whether guest support of keys is an important item. -aneesh From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e28smtp03.in.ibm.com (e28smtp03.in.ibm.com [122.248.162.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id DB2821A002D for ; Wed, 2 Jul 2014 22:12:34 +1000 (EST) Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 Jul 2014 17:42:32 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 677133940061 for ; Wed, 2 Jul 2014 17:42:27 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s62CCi3w10092860 for ; Wed, 2 Jul 2014 17:42:45 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s62CCQLJ029679 for ; Wed, 2 Jul 2014 17:42:26 +0530 From: "Aneesh Kumar K.V" To: Paul Mackerras Subject: Re: [PATCH 2/6] KVM: PPC: BOOK3S: HV: Deny virtual page class key update via h_protect In-Reply-To: <20140702045002.GC16865@drongo> References: <1404040655-12076-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1404040655-12076-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <20140702045002.GC16865@drongo> Date: Wed, 02 Jul 2014 17:42:25 +0530 Message-ID: <87tx70m02e.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Cc: linuxppc-dev@lists.ozlabs.org, agraf@suse.de, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Paul Mackerras writes: > On Sun, Jun 29, 2014 at 04:47:31PM +0530, Aneesh Kumar K.V wrote: >> This makes it consistent with h_enter where we clear the key >> bits. We also want to use virtual page class key protection mechanism >> for indicating host page fault. For that we will be using key class >> index 30 and 31. So prevent the guest from updating key bits until >> we add proper support for virtual page class protection mechanism for >> the guest. This will not have any impact for PAPR linux guest because >> Linux guest currently don't use virtual page class key protection model > > As things stand, without this patch series, we do actually have > everything we need in the kernel for guests to use virtual page class > keys. Arguably we should have a capability to tell userspace how many > storage keys the guest can use, but that's the only missing piece as > far as I can see. yes. > > If we add such a capability, I can't see any reason why we should need > to disable guest use of storage keys in this patchset. With this patchset, we would need additonal changes to find out whether the key fault happened because of the guest's usage of the key. I was planning to do that as an add-on series to keep the changes in this minimal. Also since linux didn't use keys i was not sure whether guest support of keys is an important item. -aneesh From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Aneesh Kumar K.V" Date: Wed, 02 Jul 2014 12:24:25 +0000 Subject: Re: [PATCH 2/6] KVM: PPC: BOOK3S: HV: Deny virtual page class key update via h_protect Message-Id: <87tx70m02e.fsf@linux.vnet.ibm.com> List-Id: References: <1404040655-12076-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1404040655-12076-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <20140702045002.GC16865@drongo> In-Reply-To: <20140702045002.GC16865@drongo> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paul Mackerras Cc: agraf@suse.de, benh@kernel.crashing.org, linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org Paul Mackerras writes: > On Sun, Jun 29, 2014 at 04:47:31PM +0530, Aneesh Kumar K.V wrote: >> This makes it consistent with h_enter where we clear the key >> bits. We also want to use virtual page class key protection mechanism >> for indicating host page fault. For that we will be using key class >> index 30 and 31. So prevent the guest from updating key bits until >> we add proper support for virtual page class protection mechanism for >> the guest. This will not have any impact for PAPR linux guest because >> Linux guest currently don't use virtual page class key protection model > > As things stand, without this patch series, we do actually have > everything we need in the kernel for guests to use virtual page class > keys. Arguably we should have a capability to tell userspace how many > storage keys the guest can use, but that's the only missing piece as > far as I can see. yes. > > If we add such a capability, I can't see any reason why we should need > to disable guest use of storage keys in this patchset. With this patchset, we would need additonal changes to find out whether the key fault happened because of the guest's usage of the key. I was planning to do that as an add-on series to keep the changes in this minimal. Also since linux didn't use keys i was not sure whether guest support of keys is an important item. -aneesh