From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [RFC PATCH v2 04/32] KVM: SVM: Add SEV feature definitions to KVM Date: Tue, 7 Mar 2017 01:50:53 +0100 Message-ID: <20170307005053.izjygz6mcebo5hza@pd.tnic> References: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> <148846756856.2349.18360437323368784256.stgit@brijesh-build-machine> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: simon.guinot@sequanux.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, matt@codeblueprint.co.uk, linux-pci@vger.kernel.org, linus.walleij@linaro.org, gary.hook@amd.com, linux-mm@kvack.org, paul.gortmaker@windriver.com, hpa@zytor.com, cl@linux.com, dan.j.williams@intel.com, aarcange@redhat.com, sfr@canb.auug.org.au, andriy.shevchenko@linux.intel.com, herbert@gondor.apana.org.au, bhe@redhat.com, xemul@parallels.com, joro@8bytes.org, x86@kernel.org, peterz@infradead.org, piotr.luc@intel.com, mingo@redhat.com, msalter@redhat.com, ross.zwisler@linux.intel.com, dyoung@redhat.com, thomas.lendacky@amd.com, jroedel@suse.de, keescook@chromium.org, arnd@arndb.de, toshi.kani@hpe.com, mathieu.desnoyers@efficios.com, luto@kernel.org, devel@linuxdriverproject.org, bhelgaas@google.com, tglx@linutronix.de, mchehab@kernel.org, iamjoonsoo.kim@lge.com, labbott@fedo To: Brijesh Singh Return-path: Content-Disposition: inline In-Reply-To: <148846756856.2349.18360437323368784256.stgit@brijesh-build-machine> Sender: owner-linux-mm@kvack.org List-Id: linux-crypto.vger.kernel.org On Thu, Mar 02, 2017 at 10:12:48AM -0500, Brijesh Singh wrote: > From: Tom Lendacky > > Define a new KVM CPU feature for Secure Encrypted Virtualization (SEV). > The kernel will check for the presence of this feature to determine if > it is running with SEV active. > > Define the SEV enable bit for the VMCB control structure. The hypervisor > will use this bit to enable SEV in the guest. > > Signed-off-by: Tom Lendacky > --- > arch/x86/include/asm/svm.h | 1 + > arch/x86/include/uapi/asm/kvm_para.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h > index 2aca535..fba2a7b 100644 > --- a/arch/x86/include/asm/svm.h > +++ b/arch/x86/include/asm/svm.h > @@ -137,6 +137,7 @@ struct __attribute__ ((__packed__)) vmcb_control_area { > #define SVM_VM_CR_SVM_DIS_MASK 0x0010ULL > > #define SVM_NESTED_CTL_NP_ENABLE BIT(0) > +#define SVM_NESTED_CTL_SEV_ENABLE BIT(1) > > struct __attribute__ ((__packed__)) vmcb_seg { > u16 selector; > diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h > index 1421a65..bc2802f 100644 > --- a/arch/x86/include/uapi/asm/kvm_para.h > +++ b/arch/x86/include/uapi/asm/kvm_para.h > @@ -24,6 +24,7 @@ > #define KVM_FEATURE_STEAL_TIME 5 > #define KVM_FEATURE_PV_EOI 6 > #define KVM_FEATURE_PV_UNHALT 7 > +#define KVM_FEATURE_SEV 8 This looks like it needs documenting in Documentation/virtual/kvm/cpuid.txt -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) -- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754648AbdCGAyd (ORCPT ); Mon, 6 Mar 2017 19:54:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:59830 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754055AbdCGAyL (ORCPT ); Mon, 6 Mar 2017 19:54:11 -0500 Date: Tue, 7 Mar 2017 01:50:53 +0100 From: Borislav Petkov To: Brijesh Singh Cc: simon.guinot@sequanux.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, matt@codeblueprint.co.uk, linux-pci@vger.kernel.org, linus.walleij@linaro.org, gary.hook@amd.com, linux-mm@kvack.org, paul.gortmaker@windriver.com, hpa@zytor.com, cl@linux.com, dan.j.williams@intel.com, aarcange@redhat.com, sfr@canb.auug.org.au, andriy.shevchenko@linux.intel.com, herbert@gondor.apana.org.au, bhe@redhat.com, xemul@parallels.com, joro@8bytes.org, x86@kernel.org, peterz@infradead.org, piotr.luc@intel.com, mingo@redhat.com, msalter@redhat.com, ross.zwisler@linux.intel.com, dyoung@redhat.com, thomas.lendacky@amd.com, jroedel@suse.de, keescook@chromium.org, arnd@arndb.de, toshi.kani@hpe.com, mathieu.desnoyers@efficios.com, luto@kernel.org, devel@linuxdriverproject.org, bhelgaas@google.com, tglx@linutronix.de, mchehab@kernel.org, iamjoonsoo.kim@lge.com, labbott@fedoraproject.org, tony.luck@intel.com, alexandre.bounine@idt.com, kuleshovmail@gmail.com, linux-kernel@vger.kernel.org, mcgrof@kernel.org, mst@redhat.com, linux-crypto@vger.kernel.org, tj@kernel.org, pbonzini@redhat.com, akpm@linux-foundation.org, davem@davemloft.net Subject: Re: [RFC PATCH v2 04/32] KVM: SVM: Add SEV feature definitions to KVM Message-ID: <20170307005053.izjygz6mcebo5hza@pd.tnic> References: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> <148846756856.2349.18360437323368784256.stgit@brijesh-build-machine> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <148846756856.2349.18360437323368784256.stgit@brijesh-build-machine> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 02, 2017 at 10:12:48AM -0500, Brijesh Singh wrote: > From: Tom Lendacky > > Define a new KVM CPU feature for Secure Encrypted Virtualization (SEV). > The kernel will check for the presence of this feature to determine if > it is running with SEV active. > > Define the SEV enable bit for the VMCB control structure. The hypervisor > will use this bit to enable SEV in the guest. > > Signed-off-by: Tom Lendacky > --- > arch/x86/include/asm/svm.h | 1 + > arch/x86/include/uapi/asm/kvm_para.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h > index 2aca535..fba2a7b 100644 > --- a/arch/x86/include/asm/svm.h > +++ b/arch/x86/include/asm/svm.h > @@ -137,6 +137,7 @@ struct __attribute__ ((__packed__)) vmcb_control_area { > #define SVM_VM_CR_SVM_DIS_MASK 0x0010ULL > > #define SVM_NESTED_CTL_NP_ENABLE BIT(0) > +#define SVM_NESTED_CTL_SEV_ENABLE BIT(1) > > struct __attribute__ ((__packed__)) vmcb_seg { > u16 selector; > diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h > index 1421a65..bc2802f 100644 > --- a/arch/x86/include/uapi/asm/kvm_para.h > +++ b/arch/x86/include/uapi/asm/kvm_para.h > @@ -24,6 +24,7 @@ > #define KVM_FEATURE_STEAL_TIME 5 > #define KVM_FEATURE_PV_EOI 6 > #define KVM_FEATURE_PV_UNHALT 7 > +#define KVM_FEATURE_SEV 8 This looks like it needs documenting in Documentation/virtual/kvm/cpuid.txt -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) -- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id B1C156B0389 for ; Mon, 6 Mar 2017 19:51:18 -0500 (EST) Received: by mail-wm0-f71.google.com with SMTP id c143so33332048wmd.1 for ; Mon, 06 Mar 2017 16:51:18 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id b203si16570055wme.154.2017.03.06.16.51.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 06 Mar 2017 16:51:17 -0800 (PST) Date: Tue, 7 Mar 2017 01:50:53 +0100 From: Borislav Petkov Subject: Re: [RFC PATCH v2 04/32] KVM: SVM: Add SEV feature definitions to KVM Message-ID: <20170307005053.izjygz6mcebo5hza@pd.tnic> References: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> <148846756856.2349.18360437323368784256.stgit@brijesh-build-machine> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <148846756856.2349.18360437323368784256.stgit@brijesh-build-machine> Sender: owner-linux-mm@kvack.org List-ID: To: Brijesh Singh Cc: simon.guinot@sequanux.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, matt@codeblueprint.co.uk, linux-pci@vger.kernel.org, linus.walleij@linaro.org, gary.hook@amd.com, linux-mm@kvack.org, paul.gortmaker@windriver.com, hpa@zytor.com, cl@linux.com, dan.j.williams@intel.com, aarcange@redhat.com, sfr@canb.auug.org.au, andriy.shevchenko@linux.intel.com, herbert@gondor.apana.org.au, bhe@redhat.com, xemul@parallels.com, joro@8bytes.org, x86@kernel.org, peterz@infradead.org, piotr.luc@intel.com, mingo@redhat.com, msalter@redhat.com, ross.zwisler@linux.intel.com, dyoung@redhat.com, thomas.lendacky@amd.com, jroedel@suse.de, keescook@chromium.org, arnd@arndb.de, toshi.kani@hpe.com, mathieu.desnoyers@efficios.com, luto@kernel.org, devel@linuxdriverproject.org, bhelgaas@google.com, tglx@linutronix.de, mchehab@kernel.org, iamjoonsoo.kim@lge.com, labbott@fedoraproject.org, tony.luck@intel.com, alexandre.bounine@idt.com, kuleshovmail@gmail.com, linux-kernel@vger.kernel.org, mcgrof@kernel.org, mst@redhat.com, linux-crypto@vger.kernel.org, tj@kernel.org, pbonzini@redhat.com, akpm@linux-foundation.org, davem@davemloft.net On Thu, Mar 02, 2017 at 10:12:48AM -0500, Brijesh Singh wrote: > From: Tom Lendacky > > Define a new KVM CPU feature for Secure Encrypted Virtualization (SEV). > The kernel will check for the presence of this feature to determine if > it is running with SEV active. > > Define the SEV enable bit for the VMCB control structure. The hypervisor > will use this bit to enable SEV in the guest. > > Signed-off-by: Tom Lendacky > --- > arch/x86/include/asm/svm.h | 1 + > arch/x86/include/uapi/asm/kvm_para.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h > index 2aca535..fba2a7b 100644 > --- a/arch/x86/include/asm/svm.h > +++ b/arch/x86/include/asm/svm.h > @@ -137,6 +137,7 @@ struct __attribute__ ((__packed__)) vmcb_control_area { > #define SVM_VM_CR_SVM_DIS_MASK 0x0010ULL > > #define SVM_NESTED_CTL_NP_ENABLE BIT(0) > +#define SVM_NESTED_CTL_SEV_ENABLE BIT(1) > > struct __attribute__ ((__packed__)) vmcb_seg { > u16 selector; > diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h > index 1421a65..bc2802f 100644 > --- a/arch/x86/include/uapi/asm/kvm_para.h > +++ b/arch/x86/include/uapi/asm/kvm_para.h > @@ -24,6 +24,7 @@ > #define KVM_FEATURE_STEAL_TIME 5 > #define KVM_FEATURE_PV_EOI 6 > #define KVM_FEATURE_PV_UNHALT 7 > +#define KVM_FEATURE_SEV 8 This looks like it needs documenting in Documentation/virtual/kvm/cpuid.txt -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix ImendA?rffer, Jane Smithard, Graham Norton, HRB 21284 (AG NA 1/4 rnberg) -- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org