From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DEA772 for ; Tue, 10 Aug 2021 11:32:55 +0000 (UTC) Received: from zn.tnic (p200300ec2f0d650032ff4b0dbb793dda.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:6500:32ff:4b0d:bb79:3dda]) (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 124861EC0345; Tue, 10 Aug 2021 13:32:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1628595170; 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=R0Bn+dXKzaBou1+W8ZeOwhmfqcSDNHnGnKGMW8DU+1o=; b=Flm+45n8y3Gtv+plIrS/FRcndJKdE24N1BwdLlt+khb4sM4nPfiJaI8pTzCJCrQgE26phx D+cVO7QxwpUFbuhBxXejG6qZ3AkJlIiTSvMrYvQRzKtD5dDIiK8EbnSKyeoCVsbX6EW2c8 c81rM3/neP7P3s/3IznKD+Dekv/zL8o= Date: Tue, 10 Aug 2021 13:33:34 +0200 From: Borislav Petkov To: Brijesh Singh , Tom Lendacky 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 , "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 05/36] x86/sev: Define the Linux specific guest termination reasons Message-ID: References: <20210707181506.30489-1-brijesh.singh@amd.com> <20210707181506.30489-6-brijesh.singh@amd.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210707181506.30489-6-brijesh.singh@amd.com> On Wed, Jul 07, 2021 at 01:14:35PM -0500, Brijesh Singh wrote: > diff --git a/arch/x86/include/asm/sev-common.h b/arch/x86/include/asm/sev-common.h > index 23929a3010df..e75e29c05f59 100644 > --- a/arch/x86/include/asm/sev-common.h > +++ b/arch/x86/include/asm/sev-common.h > @@ -63,9 +63,17 @@ > (((((u64)reason_set) & GHCB_MSR_TERM_REASON_SET_MASK) << GHCB_MSR_TERM_REASON_SET_POS) | \ > ((((u64)reason_val) & GHCB_MSR_TERM_REASON_MASK) << GHCB_MSR_TERM_REASON_POS)) > > +/* Error code from reason set 0 */ ... Error codes... > +#define SEV_TERM_SET_GEN 0 > #define GHCB_SEV_ES_GEN_REQ 0 > #define GHCB_SEV_ES_PROT_UNSUPPORTED 1 > > #define GHCB_RESP_CODE(v) ((v) & GHCB_MSR_INFO_MASK) > > +/* Linux specific reason codes (used with reason set 1) */ ... Linux-specific ... > +#define SEV_TERM_SET_LINUX 1 GHCB doc says: "This document defines and owns reason code set 0x0" Should it also say, reason code set 1 is allocated for Linux guest use? I don't see why not... Tom? > +#define GHCB_TERM_REGISTER 0 /* GHCB GPA registration failure */ > +#define GHCB_TERM_PSC 1 /* Page State Change failure */ > +#define GHCB_TERM_PVALIDATE 2 /* Pvalidate failure */ > + > #endif -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette