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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AECEEC433EF for ; Wed, 3 Nov 2021 16:05:21 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 242C86056B for ; Wed, 3 Nov 2021 16:05:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 242C86056B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D36B760AC1; Wed, 3 Nov 2021 16:05:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6PKIFDlseWrf; Wed, 3 Nov 2021 16:05:17 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 6E92C60AC7; Wed, 3 Nov 2021 16:05:16 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4BAD5C0012; Wed, 3 Nov 2021 16:05:16 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 78FA7C000E for ; Wed, 3 Nov 2021 16:05:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 59CBA60AC9 for ; Wed, 3 Nov 2021 16:05:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fgivgm0n4h1t for ; Wed, 3 Nov 2021 16:05:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by smtp3.osuosl.org (Postfix) with ESMTPS id 69B176085E for ; Wed, 3 Nov 2021 16:05:13 +0000 (UTC) Received: from zn.tnic (p200300ec2f132900b6e7f8d38363ddad.dip0.t-ipconnect.de [IPv6:2003:ec:2f13:2900:b6e7:f8d3:8363:ddad]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 28F7F1EC0521; Wed, 3 Nov 2021 17:05:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1635955510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=hczvJZzWas23wFyZUVNmvw9Zj8/3CUViJtfJTHijkGQ=; b=WuWqnChJtaZfbIdyIaFRlTP9ebA7RI0nBVfGARrUjHnzHhhAdFqR2tPRRtiG8E7t+2syA9 itIB92r5S6cLtEFpG2guTyITWprCY3GkvFvecGQssemG8oGFgu2Jlb8pOLgjKUw2ria9Fd 51DxGVfysKW9auz+L2byXY0CXAmsoXM= Date: Wed, 3 Nov 2021 17:05:04 +0100 From: Borislav Petkov To: Joerg Roedel , Brijesh Singh Subject: Re: [PATCH v2 05/12] x86/sev: Use GHCB protocol version 2 if supported Message-ID: References: <20210913155603.28383-1-joro@8bytes.org> <20210913155603.28383-6-joro@8bytes.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210913155603.28383-6-joro@8bytes.org> Cc: kvm@vger.kernel.org, Peter Zijlstra , Dave Hansen , virtualization@lists.linux-foundation.org, Arvind Sankar , hpa@zytor.com, Jiri Slaby , x86@kernel.org, David Rientjes , Masami Hiramatsu , Martin Radev , Tom Lendacky , Joerg Roedel , Kees Cook , Cfir Cohen , linux-coco@lists.linux.dev, Andy Lutomirski , Dan Williams , Juergen Gross , Mike Stunes , Sean Christopherson , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Eric Biederman , Erdem Aktas X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Mon, Sep 13, 2021 at 05:55:56PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > Check whether the hypervisor supports GHCB version 2 and use it if > available. > > Signed-off-by: Joerg Roedel > --- > arch/x86/boot/compressed/sev.c | 10 ++++++++-- > arch/x86/include/asm/sev.h | 4 ++-- > arch/x86/kernel/sev-shared.c | 17 ++++++++++++++--- > 3 files changed, 24 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c > index 101e08c67296..7f8416f76be7 100644 > --- a/arch/x86/boot/compressed/sev.c > +++ b/arch/x86/boot/compressed/sev.c > @@ -119,16 +119,22 @@ static enum es_result vc_read_mem(struct es_em_ctxt *ctxt, > /* Include code for early handlers */ > #include "../../kernel/sev-shared.c" > > +static unsigned int ghcb_protocol; I guess you need to sync up with Brijesh on what to use: https://lore.kernel.org/r/20211008180453.462291-7-brijesh.singh@amd.com And if ghcb_version there is __ro_after_init I think that's perfectly fine and doesn't need an accessor... Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization