Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp591286pxb; Wed, 3 Nov 2021 09:06:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+rcvPHEcWIkj3w8W6F4pm94BOdDP2ea5rVJpfaMvYFZZ5oBIEXMusIpYxQwQuAF0ofCs4 X-Received: by 2002:a05:6602:2d0a:: with SMTP id c10mr19214084iow.186.1635955616696; Wed, 03 Nov 2021 09:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635955616; cv=none; d=google.com; s=arc-20160816; b=y/ivdQXkygcJKV+Sbh/mJsI9yedi0SuJxaDvhibgu3izRXIb+f32etuyUG2csOnD+Y Ra/lPRnLNd1pTXGLz96SE3vxIt/L57vu6l4sXzuvDisd4c+hTMQypqCSI1urW/3eYad8 Kvu/OGenStLrvakHN5L+Z/u24OS1C6t9MF+y6bM/a3oKIIOwfHdKgHZbn8CXx5C1oRhY SsoQAnBArAvXpkrEvO6hkWX6LIQNaga0h4FSeenYWARYVbXY1qfcv6pocW43PNzk+ILM Ygzl0+qUaIBP3GVL5cw9KpP3UbQJHH1UyZBFiV+eXtxsGMURGBCyNFRBcR6+yzyWTTuc YGeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hczvJZzWas23wFyZUVNmvw9Zj8/3CUViJtfJTHijkGQ=; b=IFwiE8pUEHkJso6IvL4B9RB3iW/vC5974rIFrO2YlduL5UVnDprKqDU3dF59h6DeB8 1hRogtaTPm4dpPO48qRWAD2NPCZ0sLzBxSAXBVoMvQrNUTfAzbHKwwMI0P/xUN+rabAM +W6VLRJoM+hEXQvoCvMbi1sFCntC1ZAvBVqA2kyZslCE2RR99xKf+0uLmlygRuEoMk/O 1WYShx99dB72SBGPaWlmhieDs/9IqigzoKpSOUZajmJND0ajulYXc60v0hqg4wybCEYr IZv0o9377mKk3wFPkRJzA9P5r8ZliRH1OirTtP0+X2NptarzfFHlurydvoFlZKc/dvi7 4WRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=WuWqnChJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si4457908jat.27.2021.11.03.09.06.44; Wed, 03 Nov 2021 09:06:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=WuWqnChJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232724AbhKCQHt (ORCPT + 99 others); Wed, 3 Nov 2021 12:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231340AbhKCQHs (ORCPT ); Wed, 3 Nov 2021 12:07:48 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9626C061714; Wed, 3 Nov 2021 09:05:11 -0700 (PDT) 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 Cc: x86@kernel.org, Eric Biederman , kexec@lists.infradead.org, Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , Arvind Sankar , linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org 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-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210913155603.28383-6-joro@8bytes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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