From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752779AbcD0MoT (ORCPT ); Wed, 27 Apr 2016 08:44:19 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:41325 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbcD0MoR (ORCPT ); Wed, 27 Apr 2016 08:44:17 -0400 Date: Tue, 22 Mar 2016 14:03:54 +0100 From: Pavel Machek To: Tom Lendacky Cc: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov Subject: Re: [RFC PATCH v1 03/18] x86: Secure Memory Encryption (SME) support Message-ID: <20160322130354.GC16528@xo-6d-61-c0.localdomain> References: <20160426225553.13567.19459.stgit@tlendack-t1.amdoffice.net> <20160426225626.13567.72425.stgit@tlendack-t1.amdoffice.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160426225626.13567.72425.stgit@tlendack-t1.amdoffice.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2016-04-26 17:56:26, Tom Lendacky wrote: > Provide support for Secure Memory Encryption (SME). This initial support > defines the memory encryption mask as a variable for quick access and an > accessor for retrieving the number of physical addressing bits lost if > SME is enabled. > > Signed-off-by: Tom Lendacky > --- > arch/x86/include/asm/mem_encrypt.h | 37 ++++++++++++++++++++++++++++++++++++ > arch/x86/kernel/Makefile | 2 ++ > arch/x86/kernel/mem_encrypt.S | 29 ++++++++++++++++++++++++++++ > arch/x86/kernel/x8664_ksyms_64.c | 6 ++++++ > 4 files changed, 74 insertions(+) > create mode 100644 arch/x86/include/asm/mem_encrypt.h > create mode 100644 arch/x86/kernel/mem_encrypt.S > > index 0000000..ef7f325 > --- /dev/null > +++ b/arch/x86/kernel/mem_encrypt.S > @@ -0,0 +1,29 @@ > +/* > + * AMD Memory Encryption Support > + * > + * Copyright (C) 2016 Advanced Micro Devices, Inc. > + * > + * Author: Tom Lendacky > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > + > +#include > + > + .text > + .code64 > +ENTRY(sme_get_me_loss) > + xor %rax, %rax > + mov sme_me_loss(%rip), %al > + ret > +ENDPROC(sme_get_me_loss) Does this really need to be implemented in assembly? -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html 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 379A96B025E for ; Wed, 27 Apr 2016 08:44:16 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id s63so37795944wme.2 for ; Wed, 27 Apr 2016 05:44:16 -0700 (PDT) Received: from atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz. [195.113.26.193]) by mx.google.com with ESMTP id u64si8911464wmd.74.2016.04.27.05.44.15 for ; Wed, 27 Apr 2016 05:44:15 -0700 (PDT) Date: Tue, 22 Mar 2016 14:03:54 +0100 From: Pavel Machek Subject: Re: [RFC PATCH v1 03/18] x86: Secure Memory Encryption (SME) support Message-ID: <20160322130354.GC16528@xo-6d-61-c0.localdomain> References: <20160426225553.13567.19459.stgit@tlendack-t1.amdoffice.net> <20160426225626.13567.72425.stgit@tlendack-t1.amdoffice.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160426225626.13567.72425.stgit@tlendack-t1.amdoffice.net> Sender: owner-linux-mm@kvack.org List-ID: To: Tom Lendacky Cc: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov On Tue 2016-04-26 17:56:26, Tom Lendacky wrote: > Provide support for Secure Memory Encryption (SME). This initial support > defines the memory encryption mask as a variable for quick access and an > accessor for retrieving the number of physical addressing bits lost if > SME is enabled. > > Signed-off-by: Tom Lendacky > --- > arch/x86/include/asm/mem_encrypt.h | 37 ++++++++++++++++++++++++++++++++++++ > arch/x86/kernel/Makefile | 2 ++ > arch/x86/kernel/mem_encrypt.S | 29 ++++++++++++++++++++++++++++ > arch/x86/kernel/x8664_ksyms_64.c | 6 ++++++ > 4 files changed, 74 insertions(+) > create mode 100644 arch/x86/include/asm/mem_encrypt.h > create mode 100644 arch/x86/kernel/mem_encrypt.S > > index 0000000..ef7f325 > --- /dev/null > +++ b/arch/x86/kernel/mem_encrypt.S > @@ -0,0 +1,29 @@ > +/* > + * AMD Memory Encryption Support > + * > + * Copyright (C) 2016 Advanced Micro Devices, Inc. > + * > + * Author: Tom Lendacky > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > + > +#include > + > + .text > + .code64 > +ENTRY(sme_get_me_loss) > + xor %rax, %rax > + mov sme_me_loss(%rip), %al > + ret > +ENDPROC(sme_get_me_loss) Does this really need to be implemented in assembly? -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- 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