Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp297116pxb; Thu, 2 Sep 2021 04:29:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS1zH5X2wzEW6hEZdua0dV2jkpv4NCOb2Vh1E9/69uK+O+lHOPVVDMQvtHhWwV7vssG/VH X-Received: by 2002:a05:6e02:e03:: with SMTP id a3mr2109002ilk.144.1630582194675; Thu, 02 Sep 2021 04:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630582194; cv=none; d=google.com; s=arc-20160816; b=GN4RQI6czKDyJXX6SMN4Lf9ecgrpRSPT9e173gIY5S+e2Iy0y1OS6Inh9P/cwVt0J3 n2WjvfsEGJYA95+WCkUuTLQrPAzj5UxEEoIr+yTIgyAzHyH7DlyYtxcGHY6UCtTntKol UCr9pjYHwI8IcHUs1oML+9TvZUHdDpSbftCeqkMZe3bnGil/zqOpv+jNa3/QDwR1bnUJ 21Be1qxLtokDIjXGQYWprY/+2f6iZFkDM4EnXSjjTLFCKTScEC5YxTo71ytK0B2X68pc cxLwBh41yDl9df/TFNIOmFiP2pg6HHjRwVdTodgZ51Dc/7spaJOrl0JPyL8Sax8HQLQX sDnw== 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=nZDBbNwW0kzPiqS/jH6ifLFLt5uI+iZ0TLZo07Wo180=; b=AlfzJtD40UAOr/NB2HBVrZBVIMWaF7uzIcr1vVZzAc2sn+evLIR2J6F+j4xxAl8pRh C+69oLrvitwAva0F9OWKQ1EUdTVbYR+K43DdM32HE0lgs6RgEM6M7JQ8d97Rt5E2CkzG px/XE54g16lkOVp1asJtjY+PYvr1h8E1WTijWdBqZVytiaTWe/uuQzxshIrkNnIGY49b liwa24Fs0Jpmf3Zx06uoW3UXrK0mM44aWatUvVvTXhAZlSjtUiB755g61g5Sn2UpFbpr WRcX+DqNusEg5zUo0s4T9KSkClVrAVZObE726JJ+YYIR1dariqFDWQyd78mfh+Y/IwRr DDxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=PVqkwqgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 f7si2018040ila.78.2021.09.02.04.29.36; Thu, 02 Sep 2021 04:29:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=PVqkwqgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S245618AbhIBL1a (ORCPT + 99 others); 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: linux-kernel@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