Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3414192pxt; Tue, 10 Aug 2021 03:07:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl92ABgSzvI43lIJHt9h4XMLaCn3bHRy6/2P1OD774GV39cNxZLM8I0MyubCjIhKdjrLiw X-Received: by 2002:a92:c10d:: with SMTP id p13mr208718ile.83.1628590064192; Tue, 10 Aug 2021 03:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628590064; cv=none; d=google.com; s=arc-20160816; b=SSri5s98Bmh5IZIE9N4vpu8DSKAj5owpxttuUdPOqVL9/GpEiXuZryLwzfhbqcF9V/ ZBclAWMj3/4c6VQjXGeBnZHdqxWqbzcaG2JRX8SS5q5CQ+lH7s/O6n7NN9tag71ldVdE rlXnvLEZeAlUm0lz1evaFe0mwDR6K4sYimzwTpVED6TcrDct8gJfdo5h5lqozxudQoM+ HH24YMSju6dVxJqiPns+6sTub+MztedX94Z9rALuqVb7HonP6OdqcXLJ2Li/pi/4XJMF 5JsbRNUYwtgJchXuRRVfYL/hpFIiMApmpXgt46B6snKw39pUgvf9r3mn18FNJWP9TPP+ V2MA== 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=7e+HGcOHJ96LFGWVJDME/h9ZcJWYWo7cdlDC8qUJl3Y=; b=TOQcyNM5/AyxjI/vl54i/MAhT1meaCAvU7JAjjbvHaPh0H1pPzl+ui5weri1JLmTmR 5mhNWKPFL5vcgfOTvD2e+hd1bH0fo7w4+oYKTTU2w5b84Dc2kp1HOXvWxtnqB7qz9Pjg 9XBuappOAyW3L19838hkCkXKwApkdMA9SjLfJaUIVsPxiWqDkTLusOTvt08tV+0ko1GP joXuoKM9HAPOj+ejVe2+MggFO3VcSs6wIQYzjY2zjreWgEpGwM2+aau/adf79InF0hRx CcnLAEON7CsyT6C9z01+UgYyY+xDvsFCBb1DZwCNuI6bJnPLmBV0K90LRTHgiofvs9Lz 6cNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Hyiz6S9A; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 s12si20723191ild.148.2021.08.10.03.07.23; Tue, 10 Aug 2021 03:07:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=Hyiz6S9A; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S238785AbhHJJRE (ORCPT + 99 others); Tue, 10 Aug 2021 05:17:04 -0400 Received: from mail.skyhub.de ([5.9.137.197]:51294 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238777AbhHJJQ7 (ORCPT ); Tue, 10 Aug 2021 05:16:59 -0400 Received: from zn.tnic (p200300ec2f0d65002f77173b43e63b63.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:6500:2f77:173b:43e6:3b63]) (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 32D221EC01B7; Tue, 10 Aug 2021 11:16:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1628586988; 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=7e+HGcOHJ96LFGWVJDME/h9ZcJWYWo7cdlDC8qUJl3Y=; b=Hyiz6S9AveiAXpd7wTU8ZQM3+2JzRq/DaHuPlGM6Ou7O3jgv8sL12UwwrJ4VIDwUeR4O4e 8rTFGfeQxlxvrrg48r/pEYoZKC6y5SNfI3wKzdZhG+F/3Q644VAtkWyXNFnTR31GmiYIKZ EGsiOkk1vDviIZy1rZDkLdz0L+2ypxY= Date: Tue, 10 Aug 2021 11:17:07 +0200 From: Borislav Petkov To: Brijesh Singh Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Michael Roth , Vlastimil Babka , tony.luck@intel.com, npmccallum@redhat.com, brijesh.ksingh@gmail.com Subject: Re: [PATCH Part1 RFC v4 02/36] x86/sev: Save the negotiated GHCB version Message-ID: References: <20210707181506.30489-1-brijesh.singh@amd.com> <20210707181506.30489-3-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210707181506.30489-3-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jul 07, 2021 at 01:14:32PM -0500, Brijesh Singh wrote: > diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c > index 114f62fe2529..19c2306ac02d 100644 > --- a/arch/x86/kernel/sev-shared.c > +++ b/arch/x86/kernel/sev-shared.c > @@ -14,6 +14,15 @@ > #define has_cpuflag(f) boot_cpu_has(f) > #endif > > +/* > + * Since feature negotiation related variables are set early in the boot > + * process they must reside in the .data section so as not to be zeroed > + * out when the .bss section is later cleared. > + * > + * GHCB protocol version negotiated with the hypervisor. > + */ > +static u16 ghcb_version __section(".data..ro_after_init"); There's a define for that section specifier: __ro_after_init -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette