Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp727405pxb; Thu, 19 Aug 2021 09:46:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8LmjXnIQDtY3jjUXsOpuqf1zHcZlsnEIX3DGdhJ89zSuDgWj/wTSQm6LQQmhFTlIPf0zr X-Received: by 2002:a02:94ae:: with SMTP id x43mr12385405jah.105.1629391608830; Thu, 19 Aug 2021 09:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629391608; cv=none; d=google.com; s=arc-20160816; b=tUtzzYDgl7V53qXgFnmKX0olHwSB72whJX4L05fR5JJytINCRJr479Sv8h3cCQbVYq 45n6ipVIUTYc0OUH6ORuuHISraSjJULxIIGcE6DW2gLZvDYeyneX5aeiiXeP3dqdDuzv bnrjKAV3Tav5OpvBL7z/GwC9I60SmEym6XaC6u53udJUa+vZzzIFDodIpKUkwTn8Gz6T H50EvMMqrr2uTvFJ+8xWp4c9piaG9dgClir4TbgAgVM9ti7MXvpX11839pPsbP3xZex6 gaz1qXF7LiJU3+c7QYVjcrE9c5aoHZiAVdw9xg80QLGO705kH95AvZ+GSefv1dUAR4Kt YtZg== 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=fIwP1+vEtACNuhDJX1089jOgPxnYArbRitc0H03M4jk=; b=pRatTywLMBw+BCFjiC+B0z7LXkFZEKT3z3AYBO40rkRE6fVj7utmQ4erKY7gc46GAT 2CdtynQ4cd4iHEgMwwXcxCwfbVGnRscq/za+zcPiapxb5Uebos7m1USFVHQZN+R1rLlY iedyvaiW930FqrMgJsW3IcHm31epRM08KCXz58BLuCU9fIH5hsnw86LaXdCk2+u17sp0 BAhdJKeu50AdbFf7wbAB9PuFX6QJj07lMI1d0dyCDzRhQhr9BqQHZgMSLLVsU/tgparA zeHJMCPfRQdlfBjuCRYEvmXTgWeQqj5B40SkQjuEc/+TnHtspbXlNfzCc0fE+odnI+u4 swYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=G7FIywfC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 s12si3677789iog.99.2021.08.19.09.46.27; Thu, 19 Aug 2021 09:46:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=G7FIywfC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S229519AbhHSQrB (ORCPT + 99 others); Thu, 19 Aug 2021 12:47:01 -0400 Received: from mail.skyhub.de ([5.9.137.197]:39558 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229474AbhHSQqz (ORCPT ); Thu, 19 Aug 2021 12:46:55 -0400 Received: from zn.tnic (p200300ec2f0f6a00ce256b49be690694.dip0.t-ipconnect.de [IPv6:2003:ec:2f0f:6a00:ce25:6b49:be69:694]) (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 5E6841EC036B; Thu, 19 Aug 2021 18:46:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1629391573; 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=fIwP1+vEtACNuhDJX1089jOgPxnYArbRitc0H03M4jk=; b=G7FIywfCO3FzHcSZo6uJxFKDypgTWl3QpsMOQwYIHr8Aj0u5NhjsPUQYUhbNukPre1B3mJ ZrB9vGLLF2oT1Q9/lYAsLtv6ENPS2Ajr1TI20FVF9VQuMW7i4iKC2Dx+5anOnGhWfvR2oP P/8V4kfLy1Jfr9qisxvNsRJpg/mJ2nU= Date: Thu, 19 Aug 2021 18:46:48 +0200 From: Borislav Petkov To: Michael Roth Cc: Brijesh Singh , 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 , 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 , Vlastimil Babka , tony.luck@intel.com, brijesh.ksingh@gmail.com Subject: Re: [PATCH Part1 RFC v4 22/36] x86/sev: move MSR-based VMGEXITs for CPUID to helper Message-ID: References: <20210707181506.30489-1-brijesh.singh@amd.com> <20210707181506.30489-23-brijesh.singh@amd.com> <20210819153741.h6yloeihz5vl6hvu@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210819153741.h6yloeihz5vl6hvu@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Aug 19, 2021 at 10:37:41AM -0500, Michael Roth wrote: > That makes sense, but I think it helps in making sense of the security > aspects of the code to know that sev_cpuid() would be fetching cpuid > information from the hypervisor. Why is it important for the callers to know where do we fetch the CPUID info from? > "msr_proto" is meant to be an indicator that it will be using the GHCB > MSR protocol to do it, but maybe just "_hyp" is enough to get the idea > across? I use the convention elsewhere in the series as well. > > So sev_cpuid_hyp() maybe? sev_cpuid_hv() pls. We abbreviate the hypervisor as HV usually. > In "enable SEV-SNP-validated CPUID in #VC handler", it does: > > sev_snp_cpuid() -> sev_snp_cpuid_hyp(), > > which will call this with NULL e{a,b,c,d}x arguments in some cases. There > are enough call-sites in sev_snp_cpuid() that it seemed worthwhile to > add the guards so we wouldn't need to declare dummy variables for arguments. Yah, saw that in the later patches. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette