Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp711890pxb; Fri, 13 Aug 2021 04:50:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcvwjNAJvJ2Zf3wPdSEAxJUqkHfXN2Tvcw1l3GIXUZ0t4BNFnmCSf0z66SffU2syFz/nvR X-Received: by 2002:a6b:e00c:: with SMTP id z12mr1736992iog.27.1628855407468; Fri, 13 Aug 2021 04:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628855407; cv=none; d=google.com; s=arc-20160816; b=O6wO0eXbMj5owDmdZ9J0cX2/v9XwOKQ4pZ8vfZec57wyqW6HbS5/v7o+GuSibluxl3 Nua/iHUpCPBlLvvhkEi1i893McbeWKzcNvFLMzFTiiNto5IuzODKx9JphlipOFxovF1Y 2zS39RTyKbYguAvGr0XNeYPcjj62z18oLj9H01aVQfSceZpIdlOBgjHz3+/3ypf61EF7 Smxrz0Z7ZTwjlTKfKFENH5XKAQWu+3WFwR+Otw1+ijiWo2ECmtfzCmUfEXsHOKf+T6Ui 9cEJIUOjzwb7NK13WzGtRKiFB/UZhr5wV3eNQt+Bxgq2rKeuDEz57n5wgKC0NDNHBw3T pcTw== 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=XmnLEzAhzOr7go9Tws2WK6fpL+x7aLZgyQqDx6MzxiE=; b=Nzp3YLVGXKdhMyjhC5H1GH6w0ZG1QT7gerbZwy2guRQ2uB70iF0Z/htWL2hLrnRUj4 hYxScLxKAXI95GAasFMx1rVOIqcLiicafaj156/i5893BhmCJJTquDteAt6JlYlQfXmh SgS3Ebd3LFT1KZfWYeqTsBHP66IAgbnWkhqKuOMyCCz8iNcAPqc/MZboRZRF+t6U9G1g m4MZNejzCjt5o0mEVzrY1rAlxjlH5domv6q5tlTgQYtB/O3SAVfHSPjtVKXAKi2WMzAz Oql5tQMy+IabNQxOMQuAh5Idp6Zgmf2wopu+G0ZDJYaNihRaEBiiHE0DkpY/O5qzwOxz rUNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=K7pPLi+l; 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 x26si1214817jai.112.2021.08.13.04.49.54; Fri, 13 Aug 2021 04:50:07 -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=K7pPLi+l; 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 S239891AbhHMKrf (ORCPT + 99 others); Fri, 13 Aug 2021 06:47:35 -0400 Received: from mail.skyhub.de ([5.9.137.197]:35892 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239606AbhHMKrf (ORCPT ); Fri, 13 Aug 2021 06:47:35 -0400 Received: from zn.tnic (p200300ec2f0a0d0079874d21390dee82.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:d00:7987:4d21:390d:ee82]) (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 CB1E81EC0390; Fri, 13 Aug 2021 12:47:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1628851622; 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=XmnLEzAhzOr7go9Tws2WK6fpL+x7aLZgyQqDx6MzxiE=; b=K7pPLi+l6xsBgICUo31Urs0pNH4asQI3bGtJ3ZL06c0vaRJVCEnWEAirmzYhQYnNvpoBmR bC9rrsPLK3gHgK1reXS8f7LGdgNZGiXNBuGJsT8HMbMIG0vRBzPzUijsRpRFIW7P/lbRPP MSBF/r3NSFBWWbXBRI4N672W+nm0UBY= Date: Fri, 13 Aug 2021 12:47:41 +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 10/36] x86/compressed: Register GHCB memory when SEV-SNP is active Message-ID: References: <20210707181506.30489-1-brijesh.singh@amd.com> <20210707181506.30489-11-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210707181506.30489-11-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jul 07, 2021 at 01:14:40PM -0500, Brijesh Singh wrote: > diff --git a/arch/x86/include/asm/sev-common.h b/arch/x86/include/asm/sev-common.h > index aee07d1bb138..b19d8d301f5d 100644 > --- a/arch/x86/include/asm/sev-common.h > +++ b/arch/x86/include/asm/sev-common.h > @@ -45,6 +45,17 @@ > (((unsigned long)reg & GHCB_MSR_CPUID_REG_MASK) << GHCB_MSR_CPUID_REG_POS) | \ > (((unsigned long)fn) << GHCB_MSR_CPUID_FUNC_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) Simplify... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette