From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932426AbdJZN4X (ORCPT ); Thu, 26 Oct 2017 09:56:23 -0400 Received: from mail.skyhub.de ([5.9.137.197]:42556 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932234AbdJZN4S (ORCPT ); Thu, 26 Oct 2017 09:56:18 -0400 Date: Thu, 26 Oct 2017 15:56:14 +0200 From: Borislav Petkov To: Brijesh Singh Cc: kvm@vger.kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Herbert Xu , Gary Hook , Tom Lendacky , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Part2 PATCH v6 13/38] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support Message-ID: <20171026135614.GA12359@nazgul.tnic> References: <20171020023413.122280-1-brijesh.singh@amd.com> <20171020023413.122280-14-brijesh.singh@amd.com> <20171023092020.GB19523@nazgul.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 23, 2017 at 02:57:04PM -0500, Brijesh Singh wrote: > Calling PLATFORM_GET_STATUS is not required, we can manage the state through > a simple ref count variable. Issuing PSP commands will always be much more > expensive compare to accessing a protected global variable. What does "protected" mean here? In any case, that variable can be a simple bool as you use it as such. > I would prefer to avoid invoking PSP command if possible. > Additionally, the global semaphore is still needed to serialize > the sev_platform_init() and sev_platform_shutdown() from multiple > processes. e.g If process "A" calls sev_platform_init() and if it gets > preempted due to whatever reason then we don't want another process > to issue the shutdown command while process "A" is in middle of > sev_platform_init(). How? You're holding fw_init_mutex. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --