Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5191036pxj; Wed, 9 Jun 2021 11:15:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd8WPjJJqkAynncvTF3Nxn+m/N87pyxvOi16gn0d9YHTxNLoNP4LC7a9+m8ykhu3ztM4vk X-Received: by 2002:aa7:d288:: with SMTP id w8mr701816edq.276.1623262534898; Wed, 09 Jun 2021 11:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623262534; cv=none; d=google.com; s=arc-20160816; b=UsvCuRXCcYOt9V7+4oLKglSd2GLDo2Ehn8psyEPCPjtqwq2WikA3Qk8F/uPOTKcDju /6fXhuP7Q5I/Z1S0yQq/9p+Zps+sfYKieAhs0n8XVDOo+9nyfMnLxnJFWs+u4q0YdLgX gPRR/NkFauUOHnhQJawHi02zO3H16KKM1ufzEI67jc/9HM6KiYIbzbta2pJI7fCKAfJa tiEbmKqMT7xSdIdZ1k4bgOZ8OnH09uCwQ7xQkz30NgB7atMI0LY6eBS7Z2ko7uViNiiF BthKp02lSTOx02zuaq090xua+tL4SFtY6AYCfv2u3bRP6ir0gMW2Br9f+qDT2uRyzGRu evYw== 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=wSATXOOyGt9i64iSiH+y4PdoutUxKH/Ox+6Sp2p3E6I=; b=n0KajhupZoraCthgse57a+DeD87j6YpJNKRHvOglfMaf4wuopTUb5NbRf8uJFl5a0X ZHlUQxrjQwDForScD3IAAqP0zSWR4l4qOCFPcWBsiiv26FuPJfjlnhDZ15DRm1jbtdAZ ugmdXetprM7OP/GAaKSCgJ6znx0RgC05EMyAIjslzDD39hfO1hZqjdSl+UjwYvMGYCrg O6n5W3hyVEO5vN9hv3rhIHAIt2Ors91Kt59GHltxFIok76J4gSB3uUg+oqGhqVDEn+K/ mT89oKklCJ3Q35G4wpD0+5yw18M3+T3M89/Ykc4byT6MU+olpI+vnZhABFDtvqF1VWZG klSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=OhU591mP; 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 bh4si415709ejb.680.2021.06.09.11.14.48; Wed, 09 Jun 2021 11:15:34 -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=OhU591mP; 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 S231783AbhFIRtA (ORCPT + 99 others); Wed, 9 Jun 2021 13:49:00 -0400 Received: from mail.skyhub.de ([5.9.137.197]:43442 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231670AbhFIRs7 (ORCPT ); Wed, 9 Jun 2021 13:48:59 -0400 Received: from zn.tnic (p200300ec2f0cf6007c78e5fe5429f9b4.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:f600:7c78:e5fe:5429:f9b4]) (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 1E6531EC0570; Wed, 9 Jun 2021 19:47:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1623260823; 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=wSATXOOyGt9i64iSiH+y4PdoutUxKH/Ox+6Sp2p3E6I=; b=OhU591mPW3/AXQerpYOAsiWAncFI3bpSWloN5ZmmzLW/XQj8K6WqVZrg415AJ4V78a3RaH ChWB6TW6rGbokkHZ787rQUOFcjBM6xeABnr82utwiuyzMnpTga0VJe8odXUKUr80pNY/HV pItHvwa38FQL5ylBZ/Rb1GVajBKE8Ds= Date: Wed, 9 Jun 2021 19:47:02 +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 09/22] x86/compressed: Register GHCB memory when SEV-SNP is active Message-ID: References: <20210602140416.23573-1-brijesh.singh@amd.com> <20210602140416.23573-10-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210602140416.23573-10-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jun 02, 2021 at 09:04:03AM -0500, Brijesh Singh wrote: > diff --git a/arch/x86/include/asm/sev-common.h b/arch/x86/include/asm/sev-common.h > index 1424b8ffde0b..ae99a8a756fe 100644 > --- a/arch/x86/include/asm/sev-common.h > +++ b/arch/x86/include/asm/sev-common.h > @@ -75,6 +75,17 @@ > #define GHCB_MSR_PSC_ERROR_POS 32 > #define GHCB_MSR_PSC_RESP_VAL(val) ((val) >> GHCB_MSR_PSC_ERROR_POS) > > +/* GHCB GPA Register */ > +#define GHCB_MSR_GPA_REG_REQ 0x012 > +#define GHCB_MSR_GPA_REG_VALUE_POS 12 > +#define GHCB_MSR_GPA_REG_GFN_MASK GENMASK_ULL(51, 0) > +#define GHCB_MSR_GPA_REQ_GFN_VAL(v) \ > + (((unsigned long)((v) & GHCB_MSR_GPA_REG_GFN_MASK) << GHCB_MSR_GPA_REG_VALUE_POS)| \ > + GHCB_MSR_GPA_REG_REQ) > + > +#define GHCB_MSR_GPA_REG_RESP 0x013 > +#define GHCB_MSR_GPA_REG_RESP_VAL(v) ((v) >> GHCB_MSR_GPA_REG_VALUE_POS) > + Can we pls pay attention to having those REQuests sorted by their number, like in the GHCB spec, for faster finding? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette