Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3297632pxj; Mon, 7 Jun 2021 07:21:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy++rasSOFGLvicT9IbcbZ0z8c/hlfqxtuTaEKgyY9NWyNtW0Knw49jO6sSCK9d3lOlPz4h X-Received: by 2002:a17:906:a203:: with SMTP id r3mr18538526ejy.361.1623075670661; Mon, 07 Jun 2021 07:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623075670; cv=none; d=google.com; s=arc-20160816; b=g8/YMadRPCouqb4zxfHFQ9MrGPcbM2REGZcVm5a6egf9bU3XLMofBhTCy0DuPCqd0R tZ7mucQJb5MxFr9jRL+4dykMseLcZIb7FmcVq/ZAqG1IDbk9K0SQHO18jYdEMM22N3OJ 8M1ZtJm6Op+CINv3ZCMCzVGvsn71oPsCXZ+zdmtVhl8fKu8aqgTRoccz4Y1aOFoxCIDb leWFsfs8h1JeB9dw0Uc4UbeYYdq3y8gLTR3lwBJu9G0GhSUvymyqO+A2oBnNsUalTxsx ckHOmD7vTkIR/rKsvSOv62lH4mW5LU61T7wxxIZ0ZPkp3ffCFQmoXFLaHuV1lB34hwrp UNvA== 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=5TOa8tTbEmXIDseKo1WMd9o3+qoCmHgbWPGnV+1d5GU=; b=D/f9fUFSWslL/p/VCOSl9EeEtRFA3Zn8AwnFk8CDWVvowUfTbW1DhZXCl7YH1HN/wt 38PISsp/2pymEKN+xQa0wYe2DHzTEAXTCd8cc/IbHPjFvQparU50wJD/gsbtFaGg8U4w 7x2dtjKfv9ktX7vnoJjGNuMYn7XXKOoniKw2WA7YYwSkS2N7XhHRl0/Pj+RaScOMTrNT 9GMfGegHrh53pQyCWEclWairqdfO0CROASIkWKHsg0gHUhfOpGTWTQ0Thw1beU2W77Jh 1ieGYalkTlOWOZNa2rMo2Ml5MXYVUlnEosn063ZcOyfhJWrd9y/u8pWmHqN6HzQDoxn1 HZyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=NjlTa0dZ; 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 q1si7441055edh.111.2021.06.07.07.20.37; Mon, 07 Jun 2021 07:21:10 -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=NjlTa0dZ; 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 S230255AbhFGOVZ (ORCPT + 99 others); Mon, 7 Jun 2021 10:21:25 -0400 Received: from mail.skyhub.de ([5.9.137.197]:35712 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230207AbhFGOVZ (ORCPT ); Mon, 7 Jun 2021 10:21:25 -0400 Received: from zn.tnic (p200300ec2f0b4f00688e10502b12273b.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:4f00:688e:1050:2b12:273b]) (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 ED9091EC0489; Mon, 7 Jun 2021 16:19:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1623075572; 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=5TOa8tTbEmXIDseKo1WMd9o3+qoCmHgbWPGnV+1d5GU=; b=NjlTa0dZ0y50eG51qkp+v3j0oFZvigFNu8CDo3PSR+Gs6GrZSDorNmrNCo9sUqrP58FrNq odyBUy92t/Xmg4PU61LzGhliThhDMpkF5NfW81n/WRqEqtK8g+D7By7xHCRJ61fQGNwG6h +tZ1KH6wNLEt1OXRWI/3UsXC7KVr1zo= Date: Mon, 7 Jun 2021 16:19:26 +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 , tony.luck@intel.com, npmccallum@redhat.com Subject: Re: [PATCH Part1 RFC v3 05/22] x86/sev: Add support for hypervisor feature VMGEXIT Message-ID: References: <20210602140416.23573-1-brijesh.singh@amd.com> <20210602140416.23573-6-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210602140416.23573-6-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jun 02, 2021 at 09:03:59AM -0500, Brijesh Singh wrote: > diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c > index 70f181f20d92..94957c5bdb51 100644 > --- a/arch/x86/kernel/sev-shared.c > +++ b/arch/x86/kernel/sev-shared.c I'm guessing this is in sev-shared.c because it is going to be used by both stages? > @@ -20,6 +20,7 @@ > * out when the .bss section is later cleared. > */ > static u16 ghcb_version __section(".data"); State what this is: /* Bitmap of SEV features supported by the hypervisor */ > +static u64 hv_features __section(".data"); Also, I'm assuming that bitmap remains immutable during the guest lifetime so you can do: static u64 hv_features __ro_after_init; instead, which will do: static u64 hv_features __attribute__((__section__(".data..ro_after_init"))); and it'll be in the data section and then also marked read-only after init, after mark_rodata_ro() more specifically. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette