From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-co1nam03on0063.outbound.protection.outlook.com ([104.47.40.63] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dG3RG-0000vX-4H for kexec@lists.infradead.org; Wed, 31 May 2017 13:13:27 +0000 Subject: Re: [PATCH v5 29/32] x86/mm: Add support to encrypt the kernel in-place References: <20170418211612.10190.82788.stgit@tlendack-t1.amdoffice.net> <20170418212149.10190.70894.stgit@tlendack-t1.amdoffice.net> <20170518124626.hqyqqbjpy7hmlpqc@pd.tnic> <7e2ae014-525c-76f2-9fce-2124596db2d2@amd.com> <20170526162522.p7prrqqalx2ivfxl@pd.tnic> <33c075b1-71f6-b5d0-b1fa-d742d0659d38@amd.com> <20170531095148.pba6ju6im4qxbwfg@pd.tnic> From: Tom Lendacky Message-ID: <17394b27-d693-4ff9-9dbd-11b5237fcf6a@amd.com> Date: Wed, 31 May 2017 08:12:56 -0500 MIME-Version: 1.0 In-Reply-To: <20170531095148.pba6ju6im4qxbwfg@pd.tnic> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Borislav Petkov Cc: linux-efi@vger.kernel.org, Brijesh Singh , Toshimitsu Kani , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Matt Fleming , x86@kernel.org, linux-mm@kvack.org, Alexander Potapenko , "H. Peter Anvin" , Larry Woodman , linux-arch@vger.kernel.org, kvm@vger.kernel.org, Jonathan Corbet , Joerg Roedel , linux-doc@vger.kernel.org, kasan-dev@googlegroups.com, Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Andy Lutomirski , Thomas Gleixner , Dmitry Vyukov , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, "Michael S. Tsirkin" , Paolo Bonzini On 5/31/2017 4:51 AM, Borislav Petkov wrote: > On Tue, May 30, 2017 at 11:39:07AM -0500, Tom Lendacky wrote: >> Yes, it's from objtool: >> >> arch/x86/mm/mem_encrypt_boot.o: warning: objtool: .text+0xd2: return >> instruction outside of a callable function > > Oh, well, let's make it a global symbol then. Who knows, we might have > to live-patch it someday :-) Can do. Thanks, Tom > > --- > diff --git a/arch/x86/mm/mem_encrypt_boot.S b/arch/x86/mm/mem_encrypt_boot.S > index fb58f9f953e3..7720b0050840 100644 > --- a/arch/x86/mm/mem_encrypt_boot.S > +++ b/arch/x86/mm/mem_encrypt_boot.S > @@ -47,9 +47,9 @@ ENTRY(sme_encrypt_execute) > movq %rdx, %r12 /* Kernel length */ > > /* Copy encryption routine into the workarea */ > - movq %rax, %rdi /* Workarea encryption routine */ > - leaq .Lenc_start(%rip), %rsi /* Encryption routine */ > - movq $(.Lenc_stop - .Lenc_start), %rcx /* Encryption routine length */ > + movq %rax, %rdi /* Workarea encryption routine */ > + leaq __enc_copy(%rip), %rsi /* Encryption routine */ > + movq $(.L__enc_copy_end - __enc_copy), %rcx /* Encryption routine length */ > rep movsb > > /* Setup registers for call */ > @@ -70,8 +70,7 @@ ENTRY(sme_encrypt_execute) > ret > ENDPROC(sme_encrypt_execute) > > -.Lenc_start: > -ENTRY(sme_enc_routine) > +ENTRY(__enc_copy) > /* > * Routine used to encrypt kernel. > * This routine must be run outside of the kernel proper since > @@ -147,5 +146,5 @@ ENTRY(sme_enc_routine) > wrmsr > > ret > -ENDPROC(sme_enc_routine) > -.Lenc_stop: > +.L__enc_copy_end: > +ENDPROC(__enc_copy) > _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec