From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754406AbcH3O5w (ORCPT ); Tue, 30 Aug 2016 10:57:52 -0400 Received: from mail-ua0-f170.google.com ([209.85.217.170]:33480 "EHLO mail-ua0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753803AbcH3O5r (ORCPT ); Tue, 30 Aug 2016 10:57:47 -0400 MIME-Version: 1.0 In-Reply-To: References: <20160822223529.29880.50884.stgit@tlendack-t1.amdoffice.net> <20160822223610.29880.21739.stgit@tlendack-t1.amdoffice.net> From: Andy Lutomirski Date: Tue, 30 Aug 2016 07:57:25 -0700 Message-ID: Subject: Re: [RFC PATCH v2 04/20] x86: Secure Memory Encryption (SME) support To: Tom Lendacky Cc: kasan-dev , "linux-efi@vger.kernel.org" , linux-arch , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , iommu@lists.linux-foundation.org, "linux-doc@vger.kernel.org" , Jonathan Corbet , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Konrad Rzeszutek Wilk , "linux-mm@kvack.org" , Matt Fleming , Alexander Potapenko , "linux-kernel@vger.kernel.org" , Dmitry Vyukov , Arnd Bergmann , Joerg Roedel , Andrey Ryabinin , "H. Peter Anvin" , X86 ML , kvm list Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Aug 30, 2016 6:34 AM, "Tom Lendacky" wrote: > > On 08/25/2016 08:04 AM, Thomas Gleixner wrote: > > On Mon, 22 Aug 2016, 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. > > > > What is the reason that this needs to live in assembly code? > > In later patches this code is expanded and deals with a lot of page > table manipulation, cpuid/rdmsr instructions, etc. and so I thought it > was best to do it this way. None of that sounds like it needs to be in asm, though. I, at least, have a strong preference for minimizing the amount of asm in the low-level arch code. --Andy From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [RFC PATCH v2 04/20] x86: Secure Memory Encryption (SME) support Date: Tue, 30 Aug 2016 07:57:25 -0700 Message-ID: References: <20160822223529.29880.50884.stgit@tlendack-t1.amdoffice.net> <20160822223610.29880.21739.stgit@tlendack-t1.amdoffice.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Tom Lendacky Cc: kasan-dev , "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , linux-arch , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, "linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Jonathan Corbet , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Konrad Rzeszutek Wilk , "linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org" , Matt Fleming , Alexander Potapenko , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Dmitry Vyukov , Arnd Bergmann , Joerg List-Id: linux-efi@vger.kernel.org On Aug 30, 2016 6:34 AM, "Tom Lendacky" wrote: > > On 08/25/2016 08:04 AM, Thomas Gleixner wrote: > > On Mon, 22 Aug 2016, 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. > > > > What is the reason that this needs to live in assembly code? > > In later patches this code is expanded and deals with a lot of page > table manipulation, cpuid/rdmsr instructions, etc. and so I thought it > was best to do it this way. None of that sounds like it needs to be in asm, though. I, at least, have a strong preference for minimizing the amount of asm in the low-level arch code. --Andy From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua0-f199.google.com (mail-ua0-f199.google.com [209.85.217.199]) by kanga.kvack.org (Postfix) with ESMTP id D721D6B0038 for ; Tue, 30 Aug 2016 10:57:46 -0400 (EDT) Received: by mail-ua0-f199.google.com with SMTP id j4so47838766uaj.2 for ; Tue, 30 Aug 2016 07:57:46 -0700 (PDT) Received: from mail-ua0-x22b.google.com (mail-ua0-x22b.google.com. [2607:f8b0:400c:c08::22b]) by mx.google.com with ESMTPS id 91si3073934uat.193.2016.08.30.07.57.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Aug 2016 07:57:46 -0700 (PDT) Received: by mail-ua0-x22b.google.com with SMTP id m60so37017431uam.3 for ; Tue, 30 Aug 2016 07:57:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20160822223529.29880.50884.stgit@tlendack-t1.amdoffice.net> <20160822223610.29880.21739.stgit@tlendack-t1.amdoffice.net> From: Andy Lutomirski Date: Tue, 30 Aug 2016 07:57:25 -0700 Message-ID: Subject: Re: [RFC PATCH v2 04/20] x86: Secure Memory Encryption (SME) support Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Tom Lendacky Cc: kasan-dev , "linux-efi@vger.kernel.org" , linux-arch , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , iommu@lists.linux-foundation.org, "linux-doc@vger.kernel.org" , Jonathan Corbet , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Konrad Rzeszutek Wilk , "linux-mm@kvack.org" , Matt Fleming , Alexander Potapenko , "linux-kernel@vger.kernel.org" , Dmitry Vyukov , Arnd Bergmann , Joerg Roedel , Andrey Ryabinin , "H. Peter Anvin" , X86 ML , kvm list On Aug 30, 2016 6:34 AM, "Tom Lendacky" wrote: > > On 08/25/2016 08:04 AM, Thomas Gleixner wrote: > > On Mon, 22 Aug 2016, 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. > > > > What is the reason that this needs to live in assembly code? > > In later patches this code is expanded and deals with a lot of page > table manipulation, cpuid/rdmsr instructions, etc. and so I thought it > was best to do it this way. None of that sounds like it needs to be in asm, though. I, at least, have a strong preference for minimizing the amount of asm in the low-level arch code. --Andy -- 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