Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp439634lqh; Thu, 28 Mar 2024 06:44:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4/Bz7uX+mGLoKt+VbDpC6DyvHZ1IHRNG1fWx9/c6g9Zj2g0I5az8t4wxOiS1pJthJy38DXwzUxKu1+RR6huchkj7Czw7NVa3kgjLW/w== X-Google-Smtp-Source: AGHT+IGj70HIXuH1vKXbzP0OJ0AkPzsTEbsQ3rsk8aMvrR0SsBsabA43Wa+rB9xkKg7kpw3UCbZX X-Received: by 2002:a05:6a20:2455:b0:1a5:7069:ab2d with SMTP id t21-20020a056a20245500b001a57069ab2dmr1796932pzc.12.1711633454918; Thu, 28 Mar 2024 06:44:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711633454; cv=pass; d=google.com; s=arc-20160816; b=Vf1kmI0YylXywSdj7bEDAmuxbZQ/SXcD7SnHTQs00iLIlZeigAUGDuEnDLguWUEBeG 4EsrTMvuHE3PWSBptkDPgURF+FOQnxPqs7BLDjoerS6ilCtR+S292RptvEdGw5ZhvWFe 2E/2eDUMWJkReFDDbwrkOG63xlTWb8fR1PbQHemp8Hs70aYmBOrnHtUKtBw8esMXHVhw 63mz0QNiUYlL+GOjf6TWyYrJGi9XL7KwdghojgoRlrCLQc7kehaytaiO0HtIQlLsT3Vl H6NT+tMJ29/Ht0jtIkd9BGYwXB3dLvSdMpZV0ykAbPxEhkuYwkFa9ATMp2TfFNdXSMpR splA== 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=W93HjW3JrM1y0k7Mv6Ui5mqxj+SzjiQ4F361zTa73MU=; fh=S1zPRPxx7R2/wyp+KmCPw0+2bAb0e/I998VVh3VCDQc=; b=Yk4DkHpHVnCUksYi0dRNS6TQgJPmShu+W3WhCuByiox/w3Q8lGz8NkyJ1Negln1CZ+ +bcQVmaWhWRCoBk4m8fk8+8w9r2AgQUQCOqEd2oa2GXkGe2xv8uF+5Hiny2W/MUIpIIB nqobxUknj+vJnPSDzPi8d4wq1CHlsYmFcN6Dh8E/zjjE4Dzxs5n/kiXv7triPTijMyPy o2f2sgC7WAbZyiM+y8gSiOxrQCo+buPrvl7gm78yUUp+blzVVcyEpIoZsEvlhiKSWkON XQe/t7Zyrl5rMJQYNuEx599MYFp8DVCQFBZmOTITYdATdc6qMPOYkzu6XVbQygpi08rf 7i4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=G0grn7P+; 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-122980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122980-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 lo1-20020a056a003d0100b006eaccc36ce2si1588976pfb.156.2024.03.28.06.44.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 06:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122980-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=G0grn7P+; 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-122980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122980-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 E20A52926F9 for ; Thu, 28 Mar 2024 13:44:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E11380605; Thu, 28 Mar 2024 13:41:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="G0grn7P+" 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 5518E80020; Thu, 28 Mar 2024 13:41:30 +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=1711633294; cv=none; b=m3LhZgXNe8R/HZzVzVntDDwenSjeVvyOFB9DxwzYpEWERWmRIEOft1dv+ROn3vxQB8OZQFMYodxLNhYpxO9XlmyyVt7JCxgn7dPqODa0iUlo6hWkKsgl6NVbQHyFd9tCW+6pQGtQdlqKiy+6W3MupyGTjZ6BSeNQ5OG1wdn9Fmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711633294; c=relaxed/simple; bh=JLro+ytMlRj5SZwocJl85+I0rVqXR5OQKDwZUUf2niM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qPbof3zfRJHi6zuYgKgToTSQ5OYXWIn28INTyRl4D8W0eQjGryT8lacP+XNF6LQQ6pPSerRTb80MAmEHPuInNityLlBKR6DIrHHQPAVnEtTUP1/AY5eTCf/ADetD0bAjLZlH+WmOZ2nTwJuiI5IL2VkVmXOzKUuQYK+rbsxGp/o= 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=G0grn7P+; 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 DE7B840E024C; Thu, 28 Mar 2024 13:41:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.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 4NgxidKtt6Gn; Thu, 28 Mar 2024 13:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1711633284; bh=W93HjW3JrM1y0k7Mv6Ui5mqxj+SzjiQ4F361zTa73MU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G0grn7P+qcyf9p2CWDp19AdgohpG4K0FhaamFZ1iXSN1yMugTViU3fYqIj511UU9D beQdrdWXMu0Svx3oWfKOGzXPdIyYoDLdNtbeaLXwTO9fcSizjrdvCqq6mgeK4KNvNb odtAwiFeNAiis+Xb4FJpDsEmOdd3jv5+UrUgi/t3tOVOOsy2ipD0ZRYrUUGZDTMAm4 Ebiv8KI1q8XVCE5fvF7nUUtmJB5afqJYv6GBqDaoRolrZVOxdaB2F1Xpy5ueP6Xotg 9CofXtbbHSTx2nJEfvgTh/rCEUZbN8Vyk3uFppA0SBW1iexFf2dR/jN8jOaqVmbZjr vAtyDygfOtjahWMqZ+WAkn6SrCJttCcS2iZZnUzvnv7OOgqunPFRuQNbeXNVR6QGBc FIrQiV8kxHRvMoOh4hup/COCvTt2vkgizhxqb69kA2J3no9EGmO3zaUbhM3G64+qpu wztKR/HR95mVDMy5Wiw8o/NzBYvJWwJ1XDI5Wc2Udscg83wPbKZZk/58tetIuV/CpM kWto73/tBB0yDcMv2gca3WyC1xRQB6bb2RUGK/dABm0rjMTd0IzAzGqat1oaZZKCy2 XbHUTVjidW3yfQ6StAgLvPC9/JmUHxuISluPNldrrcPlhwtU1IaGZEzTF6yisMft0I SSftC5zR7syOL3lNYf9nDm+0= Received: from zn.tnic (p5de8ecf7.dip0.t-ipconnect.de [93.232.236.247]) (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 47E9640E016B; Thu, 28 Mar 2024 13:41:16 +0000 (UTC) Date: Thu, 28 Mar 2024 14:41:09 +0100 From: Borislav Petkov To: Jeremi Piotrowski Cc: X86 ML , LKML , KVM , Ashish Kalra , Joerg Roedel , Michael Roth , Tom Lendacky Subject: Re: [PATCH 5/5] x86/CPU/AMD: Track SNP host status with cc_platform_*() Message-ID: <20240328134109.GAZgVzdfQob43XAIr9@fat_crate.local> References: <20240327154317.29909-1-bp@alien8.de> <20240327154317.29909-6-bp@alien8.de> 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, Mar 28, 2024 at 12:51:17PM +0100, Jeremi Piotrowski wrote: > Shouldn't this line be inside the cpu_has(c, X86_FEATURE_SEV_SNP) check? The cc_vendor is not dependent on X86_FEATURE_SEV_SNP. > How about turning this into a more specific check: > > if (!cc_platform_has(CC_ATTR_GUEST_SEV_SNP) && Why? The check is "am I running as a hypervisor on baremetal". -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette