From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH v8 1/2] x86/mm: add .bss..decrypted section to hold shared variables Date: Fri, 14 Sep 2018 16:45:18 +0200 Message-ID: <20180914144518.GB29898@zn.tnic> References: <1536875471-17391-1-git-send-email-brijesh.singh@amd.com> <1536875471-17391-2-git-send-email-brijesh.singh@amd.com> <20180914071056.GA4747@zn.tnic> <3517a0db-2f64-6d09-7100-dced40561d08@amd.com> <20180914141216.GA29898@zn.tnic> <43895f0e-fea7-001e-d727-d962a20f7f6c@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Tom Lendacky , "H. Peter Anvin" , Paolo Bonzini , Sean Christopherson , Radim =?utf-8?B?S3LEjW3DocWZ?= To: Brijesh Singh Return-path: Content-Disposition: inline In-Reply-To: <43895f0e-fea7-001e-d727-d962a20f7f6c@amd.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Fri, Sep 14, 2018 at 09:27:09AM -0500, Brijesh Singh wrote: > The above code will never get executed for the SEV case. > > See if (!sme_active()) check in the start of function. > > If we decide to go on this patch, then we have to do something like > this: > > sme_encrypt_kernel(...) > { > if (!mem_encrypt_active()) > return; > > if (sev_active()) > goto out; > > /* Do kernel and initrd in-place encrypts for SME only case */ > ..... > ..... > > out: > /* Clear the C-bit from .bss..decrypted section */ > ... > ... Or above do: if (sev_active()) { sev_map_bss_decrypted(); return; } which is a separate function you call. So that you not have a label at the end of the function. Whatever tglx prefers. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --