From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DEDBC432BE for ; Tue, 10 Aug 2021 11:33:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BCD761008 for ; Tue, 10 Aug 2021 11:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbhHJLdU (ORCPT ); Tue, 10 Aug 2021 07:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbhHJLdU (ORCPT ); Tue, 10 Aug 2021 07:33:20 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59FB0C0613D3; Tue, 10 Aug 2021 04:32:58 -0700 (PDT) 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210707181506.30489-6-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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