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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 7CC0DC388F7 for ; Wed, 28 Oct 2020 22:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 325BB20720 for ; Wed, 28 Oct 2020 22:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387915AbgJ1Wbc (ORCPT ); Wed, 28 Oct 2020 18:31:32 -0400 Received: from 8bytes.org ([81.169.241.247]:36978 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387889AbgJ1WbZ (ORCPT ); Wed, 28 Oct 2020 18:31:25 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 091143C3; Wed, 28 Oct 2020 09:23:57 +0100 (CET) Date: Wed, 28 Oct 2020 09:23:52 +0100 From: Joerg Roedel To: Borislav Petkov Cc: x86@kernel.org, Joerg Roedel , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Kees Cook , Arvind Sankar , Martin Radev , Tom Lendacky , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/5] x86/boot/compressed/64: Introduce sev_status Message-ID: <20201028082352.GA18723@8bytes.org> References: <20201021123938.3696-1-joro@8bytes.org> <20201021123938.3696-2-joro@8bytes.org> <20201026182706.GG22116@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026182706.GG22116@zn.tnic> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.