From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B5DDC4363A for ; Thu, 29 Oct 2020 02:45:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FBF22076A for ; Thu, 29 Oct 2020 02:45:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730128AbgJ2Cp1 (ORCPT ); Wed, 28 Oct 2020 22:45:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:58232 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbgJ1Vdn (ORCPT ); Wed, 28 Oct 2020 17:33:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2D271AAB2; Wed, 28 Oct 2020 16:55:46 +0000 (UTC) Date: Wed, 28 Oct 2020 17:55:43 +0100 From: Joerg Roedel To: Arvind Sankar Cc: Joerg Roedel , Borislav Petkov , x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Kees Cook , Martin Radev , Tom Lendacky , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/5] x86/boot/compressed/64: Introduce sev_status Message-ID: <20201028165543.GL22179@suse.de> References: <20201021123938.3696-1-joro@8bytes.org> <20201021123938.3696-2-joro@8bytes.org> <20201026182706.GG22116@zn.tnic> <20201028082352.GA18723@8bytes.org> <20201028165007.GB1989568@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201028165007.GB1989568@rani.riverdale.lan> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 28, 2020 at 12:50:07PM -0400, Arvind Sankar wrote: > On Wed, Oct 28, 2020 at 09:23:52AM +0100, Joerg Roedel wrote: > > On Mon, Oct 26, 2020 at 07:27:06PM +0100, Borislav Petkov wrote: > > > A couple of lines above you call get_sev_encryption_bit() which already > > > reads MSR_AMD64_SEV. Why not set sev_status there too instead of reading > > > that MSR again here? > > > > > > It can read that MSR once and use sev_status(%rip) from then on to avoid > > > reading that MSR multiple times... > > > > Right, makes sense. I updated the patch. > > Hang on, get_sev_encryption_bit() is also called from startup_32(), > so it can't contain any 64-bit instructions to set sev_status. Yeah, figured that out too and discussed it with Boris. Decided to leave it as-is and add a comment why the MSR is re-read. Thanks, Joerg