Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2800187lqt; Tue, 23 Apr 2024 01:47:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3gImBcCPrT4BXPl79wSwixSa4EpikZ7kYn17lsDL1Y0Bi0DEmMWn/l2WXEcxLshm4lUKfMxoQoHC3GMInToybC8IKqQQZrSb3//Zh2Q== X-Google-Smtp-Source: AGHT+IFuSD/UNEhk54rJFv7LwwGmBd1V5w1uK2EpEqPbPvNBP93CWgWcgDcSu4jG7axHp31iofHl X-Received: by 2002:a17:902:6f08:b0:1e5:e5fb:709b with SMTP id w8-20020a1709026f0800b001e5e5fb709bmr14759065plk.9.1713862052519; Tue, 23 Apr 2024 01:47:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713862052; cv=pass; d=google.com; s=arc-20160816; b=dIlPrm4u6vzkDTe11yRYBNnMCdIF1ZkYz/KI0EyAA7m2qAD7046j0fMSsZ1F6fcuTT xy/VQ7IaTT59VGn167puYksEXpvAO3PvQgOlcDvw/ol7genTdKMR4PZre4i8wxZ0SrzX BF8NesS7sVHOXJPO8zGt80doqLaM2kqfskM/9f9R91KsDXYZJBMMjlsHTJ1HND9NAmvk kkPK6ISilG4pvRmw4lvTnpHQCETDlfMrSZAoKFDWfhZeQiUJwReVF0U/AJ7uJ//waSVd p7fIn/3IaYcpxi1DxF6JdTv2CQp2Ns9ilicYl/ObSCYl51e/jgoeEC066ujCfpnNM6UB tsSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PuUcTHftX7jcB4ldOFBM0GlZ/jOLTbRSz5LFuMJcDks=; fh=yOXSm0E/8tOfmRnhk0JfE6MKLQieMwDr2DHng9Fw+Y4=; b=Af+5ZaawALzEFRb1eL1749fUlJrM7GEILYFvcvsLifkJP4yjr+cD3kroxyIdyg6Lkt nKKz9WwSyL3O4qapEpLlb0RfjxYHqIkBYLn0B8GtIbTjlLiqSJVtPu+YUOHAX9T3tk7j mYVGcmvAdTDr9obsCtctoPTv3WqAPHJgJhvRW+zHNfxKd0bC4tz6RJfKofeVDC1GXnFu VnEa0QOk/yBCCOqNQ/v5c9tsv/IJ0S9YHVxbrMuSpo2ZW/8hTdiNDRCbsS6dNs7nwN6F d2K5rwzpHMsEVptYKQjxaIqHU8UkwBe0vCdBQDCSyvq5nMo+lqLduuSXs2TSfcFu1263 Ihgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=ihzRIa3E; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-154071-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154071-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s1-20020a170902ea0100b001e215883ff4si9407006plg.516.2024.04.23.01.47.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 01:47:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154071-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=ihzRIa3E; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-154071-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154071-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5A9992833F2 for ; Mon, 22 Apr 2024 22:08:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58A4A1D559; Mon, 22 Apr 2024 22:08:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="ihzRIa3E" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (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 1AF971CD37 for ; Mon, 22 Apr 2024 22:07:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713823681; cv=none; b=RsOH/3+uSYD1Gy2V1Eqkg8rWoUAr8F1I+zPbHEWhyQRcx8yotrAsel0vD5gt1IEArb+Q91MEqQngQpbOVpH5J8hm11EYrbyWOJZEzhjMZNXXABj1EWxyr0LN5FL9fbUIDl8Px2sQbqILHoaaMdUWLyEdYZ3UrLw7TtM1C5pWRM8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713823681; c=relaxed/simple; bh=VJAR6Adkw8djRvjcU/soGfkvQ+qoT3XNdwW1SzaWCpg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Snys9E/LgIk/y8HB2Rw7YrBoTF2DERI7YiHqC56H4HSEtS91YrFsk8fOuVRU7pg1H8ww2q6rgp8s6dtExSdLzkz2RkCdWiASUc9vbkqGlHYQB2eFETg2OO3dR6LqIoa8hkR9T8oW+JB7iGFjDVgB6D3ABQL332uB8YL52mt40D0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=ihzRIa3E; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id A64C640E0240; Mon, 22 Apr 2024 22:07:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 90Pxmrc2SYzD; Mon, 22 Apr 2024 22:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1713823673; bh=PuUcTHftX7jcB4ldOFBM0GlZ/jOLTbRSz5LFuMJcDks=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ihzRIa3EAOUNbAyPMdOoz+u35N3JU4doNKZJGCWvAj+BwLWVswRdIMVFj6FUMtyGa Efm4OprAPNfmYKGrVuwQNj4iqDDiaKOjrIEAM03pibKEGUjCTsuwdyQJCoOe9/Jtc5 eydrOSHxkvJNVU0O4Ur+MYez3KOIPhyVM6k2jFZ9UQSPAfaau6EZAWCKAEQ/RKnOjd 4ysyvIfyLx+1LeWqQcUSAWIPNXTQscUesDsY6mbyRF6q3gzgyFpTpOmrFArrxXBjLn 2ZJ9LuzIvRBzXLc8I3TM49YmTGPq7EwTO8fgMSJIIXQYdl0/K3L8r362d7cCC2YGC3 4jWJr04Y6qr0y3EBwdX0U+yImLaNSQBPP2Y9dr1nRf8eN/6aHUQw0frQPxA9Dl26l4 MBFo++qE/NBGlFacVkLL276Oza+3e2pqzmum1gBPbrAwjiV3TO7Ioz/qWDbVSOIceX RxMONupN89NN6mUQ/fBfGJK/hTMmKjXHAqfeQ3ZvvrvPsXcn0SqR1sTe7lWkxFfoWt N/mW9V42enqR/r2/3HrtyeR5K6f5qO1vEkgjgLBZDRax+8MQyDsp2PFXj9zGP9QH0C 8i8pnlG/D5ssRqat+HCmriMttBhLlebONv5GgqY5vlvmDUN9yIRMEg7HrHyEecWsag V1idnnMPljA+MLbU/YWqzdfg= Received: from zn.tnic (pd953020b.dip0.t-ipconnect.de [217.83.2.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 8BDD840E0249; Mon, 22 Apr 2024 22:07:39 +0000 (UTC) Date: Tue, 23 Apr 2024 00:07:33 +0200 From: Borislav Petkov To: Tom Lendacky Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-coco@lists.linux.dev, svsm-devel@coconut-svsm.dev, Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Dan Williams , Michael Roth , Ashish Kalra Subject: Re: [PATCH v3 03/14] x86/sev: Check for the presence of an SVSM in the SNP Secrets page Message-ID: <20240422220733.GEZibfpQt1QmJa3x6q@fat_crate.local> References: <20240417204030.GIZiAzvuLG6qcFFMyT@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Thu, Apr 18, 2024 at 04:17:36PM -0500, Tom Lendacky wrote: > Do you want it added as a in this patch or in a documentation patch at the > end of the series? Either way's fine. > > Why was that thing ever called "_layout" and not simply > > snp_secrets_page? > > > > Fix it? > > Sure, I can change that as a pre-patch to the series. Ack. > > > > > > + u64 caa; > > > + > > > + BUILD_BUG_ON(sizeof(*secrets_page) != PAGE_SIZE); > > > > Put it in the header under the struct definition I guess. > > It can't stand on it's own in the header file. I'd have to put it in a > #define or an inline function and then use that in some code. So it's > probably best to keep it here. You can always put it in an inline function in the header to move this macro out of the way but ok, one macro is not too nasty yet. :-) > > Uff, duplication. > > > > Let's put them in sev-shared.c pls and avoid that. > > Ok, but it will require moving some functions after the inclusion of > sev-shared.c and then (later) adding some advance function declarations. I guess I'll have to see it. I get the feeling that this sev-shared.c is starting to get problematic and we have to do some dancing to get it all to work nicely. In this particular case, those decompressor and kernel proper variables should probably be passed explicitly to the shared function or returned from it so that there's no "magic" fitting of the shared function touching external variables of the same name and thus those names are kept the same and it all becomes fragile. IOW: svsm_ca = setup_svsm_ca(...); svsm_ca_pa = (unsigned long)svsm_ca; or whatever needs to happen. But you get the idea... Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette