Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp882336imm; Fri, 14 Sep 2018 07:45:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZm2NXkhwwD6kQFjiFqs4NszvlK2NXzOPs7f5Pu9cCpnwK1Qr8BRh/F0r/65mNwMKM4TGZK X-Received: by 2002:a17:902:1a9:: with SMTP id b38-v6mr12652503plb.89.1536936349069; Fri, 14 Sep 2018 07:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536936349; cv=none; d=google.com; s=arc-20160816; b=fyR8gGERfZEl+akJdsct8vMGzrawPPzhOxjvLkAdUyyJazqlRwoYj6X3IqDZUBsfTq uSSJ9UQoPQ4l3jUsHSLsEhEkIAfpMg6vGBeHjrVN+JpBKr0w5/X531DDeL856taMEQDK sXxgpy/NP6auPKAnvfnSKwQpkmZSl98KndngrIoJVMRW6pwFqRNprzvtLLRGJBloUl77 XjlF++vY9DZ+/sBlGHbvKHiGGw8GGuedafqQRr3e22+vlK/jN5wu6Dge1zXcFS75fORO kV53PHSr6qMvMmiEKa6UYgJ6nsn7c2qFDnYakZ+TQRk1IjPs/CmLPdbYxj8EsCd6eAE9 rzBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=GM6aV0FynCg2hIWPkSG72mw72wGHSEEpTlezKDMXAY8=; b=RvmapfqPSGmiXwZGhj4zDv69PJztq+JRKsXrCl6dgw03yGGl/HePC65uSdxp3447Nx 70YmA9kfm3AU/H36JeKLKepzzK2aQiLq0VXg5W/e2dSfX03TfKzS3CUMHOaObYNB37jS Vo+BeEEWQrcJsfkt8CLtC/762WhL7ECzMYBMz93Z94TZxj2wKc7h2cxt3mkYfQxFn3gq VYdjAptNipZDlwx2b9eb7tLDoL2pl8p8lAMX8JF5MC/j68t+spaId2CcYCpZMgzEWCrc c5NVBtjAGBxTxEvh4WvYbWB/z1a5EPMteSDySBXGI+9TEVn0c8q1519wvGARTc9CeFfh aOcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce1-v6si8472570plb.391.2018.09.14.07.45.31; Fri, 14 Sep 2018 07:45:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728232AbeINUAQ (ORCPT + 99 others); Fri, 14 Sep 2018 16:00:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:50324 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727749AbeINUAQ (ORCPT ); Fri, 14 Sep 2018 16:00:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DF75FAEB6; Fri, 14 Sep 2018 14:45:24 +0000 (UTC) Date: Fri, 14 Sep 2018 16:45:18 +0200 From: Borislav Petkov To: Brijesh Singh 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?= Subject: Re: [PATCH v8 1/2] x86/mm: add .bss..decrypted section to hold shared variables 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <43895f0e-fea7-001e-d727-d962a20f7f6c@amd.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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) --