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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 4AFDFC432BE for ; Thu, 2 Sep 2021 11:26:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CDAE61057 for ; Thu, 2 Sep 2021 11:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245611AbhIBL1a (ORCPT ); Thu, 2 Sep 2021 07:27:30 -0400 Received: from mail.skyhub.de ([5.9.137.197]:40846 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233850AbhIBL13 (ORCPT ); Thu, 2 Sep 2021 07:27:29 -0400 Received: from zn.tnic (p200300ec2f0ed1002d220efd52bc539e.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:d100:2d22:efd:52bc:539e]) (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 E179F1EC0528; Thu, 2 Sep 2021 13:26:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1630581986; 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=nZDBbNwW0kzPiqS/jH6ifLFLt5uI+iZ0TLZo07Wo180=; b=PVqkwqgxwkgB67Wb5b6iXPa5pJWSmTjnI/8EkkTlPxlHEXlvZhiVAYvl6uEAVRmlmYHbg3 T4hS6EmZOtkeycXGzbvzamDU6UNpeyViICmVFuIUyYQckxeXgvZ5u9EcMhgOL3iLiEyxcS cHbsR20RNgm2UWY23Pl2ZCMPmOwcMPo= Date: Thu, 2 Sep 2021 13:26:56 +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, 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 , "Kirill A . Shutemov" , Andi Kleen , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH Part1 v5 34/38] x86/sev: Add snp_msg_seqno() helper Message-ID: References: <20210820151933.22401-1-brijesh.singh@amd.com> <20210820151933.22401-35-brijesh.singh@amd.com> <9e0e734d-7d2f-4703-b9ce-8362f0c740f4@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9e0e734d-7d2f-4703-b9ce-8362f0c740f4@amd.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Aug 30, 2021 at 10:07:39AM -0500, Brijesh Singh wrote: > The SNP firmware spec says that counter must begin with the 1. So put that in the comment and explain what 0 is: magic or invalid or whatnot and why is that so and that it is spec-ed this way, etc. Just having it there without a reasoning makes one wonder whether that's some arbitrary limitation or so. > During the GHCB writing the seqno use to be 32-bit value and hence the GHCB > spec choose the 32-bit value but recently the SNP firmware changed it from > the 32 to 64. So, now we are left with the option of limiting the sequence > number to 32-bit. If we go beyond 32-bit then all we can do is fail the > call. If we pass the value of zero then FW will fail the call. That sounds weird again. So make it 64-bit like the FW and fix the spec. > I just choose the smaller name but I have no issues matching with the spec. > Also those keys does not have anything to do with the VMPL level. The > secrets page provides 4 different keys and they are referred as vmpck0..3 > and each of them have a sequence numbers associated with it. > > In GHCB v3 we probably need to rework the structure name. You can point to the spec section so that readers can find the struct layout there. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette