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 17409C4320E for ; Thu, 2 Sep 2021 11:26:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C837F610D2 for ; Thu, 2 Sep 2021 11:26:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C837F610D2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1AA788D0003; Thu, 2 Sep 2021 07:26:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 15BB18D0001; Thu, 2 Sep 2021 07:26:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 021A08D0003; Thu, 2 Sep 2021 07:26:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0172.hostedemail.com [216.40.44.172]) by kanga.kvack.org (Postfix) with ESMTP id E45FF8D0001 for ; Thu, 2 Sep 2021 07:26:31 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 96D7B274C7 for ; Thu, 2 Sep 2021 11:26:31 +0000 (UTC) X-FDA: 78542405382.13.340D498 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf05.hostedemail.com (Postfix) with ESMTP id 4A09D50420E4 for ; Thu, 2 Sep 2021 11:26:31 +0000 (UTC) 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> X-Rspamd-Queue-Id: 4A09D50420E4 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=PVqkwqgx; dmarc=pass (policy=none) header.from=alien8.de; spf=pass (imf05.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de X-Rspamd-Server: rspam01 X-Stat-Signature: 4bxufyxmxnp7dike8uwo39uux9mfroui X-HE-Tag: 1630581991-70109 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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