From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bn1bon0074.outbound.protection.outlook.com ([157.56.111.74]:48784 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752666AbcD0QVI (ORCPT ); Wed, 27 Apr 2016 12:21:08 -0400 Subject: Re: [RFC PATCH v1 03/18] x86: Secure Memory Encryption (SME) support References: <20160426225553.13567.19459.stgit@tlendack-t1.amdoffice.net> <20160426225626.13567.72425.stgit@tlendack-t1.amdoffice.net> <20160322130354.GC16528@xo-6d-61-c0.localdomain> From: Tom Lendacky Message-ID: <5720E6E9.30900@amd.com> Date: Wed, 27 Apr 2016 11:20:57 -0500 MIME-Version: 1.0 In-Reply-To: <20160322130354.GC16528@xo-6d-61-c0.localdomain> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Pavel Machek 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, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , 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 Message-ID: <20160427162057.0qpidL81OlJ9SZQynIUllDSOHjsXa2fkcAJ-94jp_Bo@z> On 03/22/2016 08:03 AM, Pavel Machek wrote: > 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? That particular routine probably doesn't need to be in assembly. But since it was such a simple routine I put it there because a later patch derives the value in this file. Thanks, Tom > >