Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp90106lqe; Fri, 5 Apr 2024 13:42:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXi975kn4xTt13nLAjNzOV9L5Fji2mOS9HYl6oZ4u7PmaG4raHUg0c9S7v5W4ZkssT7Y+NGxahRWv5Xwgvr/Bjjo50DRo2IVcPbsRwpeA== X-Google-Smtp-Source: AGHT+IFO8uzVtrY6WUmSV4+jHYrkGAAb7SMp0EhoSz5PgmCxfjBcAOSFZ81F2eVXPq0E/8LDnK6G X-Received: by 2002:a2e:8755:0:b0:2d8:687e:4fef with SMTP id q21-20020a2e8755000000b002d8687e4fefmr1797211ljj.12.1712349738215; Fri, 05 Apr 2024 13:42:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712349738; cv=pass; d=google.com; s=arc-20160816; b=e8BtaXILgDGwpK8yedD3kExQRlePvsJ0sok0W9P8LtxEQr8Rm3lpUsq73UbCZyqV3Z qffScxXnM5PDVN/Zj9X2lSfdLJkEtzuHZGw9ZKD9si9PkCLQcKD3L2qSNAiBrOqWTbCT SnLtIiIkYtOoC8Uypl2SYUIIMzmuhT0XBlwqvrtWK9LBeLeWQpZJe/D5ZoAXiRLGzv4C WM0LZtQ48rUrhBvglMIZNsWWDLX3t/dRZpDrLQg7xUrp6N7+JLfC+PM4gXnRRpIWrGBs 71Wr1coWcIUVi7PozARC5WWZUPuCky3OJtLpDLlcW4ZnSeEAIYzg4nBcAaqU5asIFL8T lg+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=15weNiqhNrE0rJEEjO4DncF0dcJPaJZnwtncR1UZvzQ=; fh=Q3Xn3m8MwQzAMvi5ssmKmW9+qsAgUDqKxQ4bIwprgew=; b=M6jdTA0NLH7ntksrHANgA6UO0nK06BFtNAuXpycUrVdHxkE/YuvQEf2f6GgspmZh0s Ne7IknjF8IGuyjuhs+Z3bFonoNJV94gEw4/ignQsBbV2aC3h1DRgYjPmCW6bxKG+i0+z qW/iQx3kB2r/JrtIAJ9KvwnC3BhRcFJ2gg1c1x+u+1iRR9FSh2fF5h4FEh0eKZV/4fy2 wAS+hyWbWIwqb3XgCyHJ++BVxQx+mAWGy7wa/SaUj5qXYjeXsvqj5i4tCuIBjgcgFpDL VI7PI4mxhL1Cb3Sl+cY9CxSHRUrjSpvRXylIyNhiDN00Ejz2lk+fCcv/PPnA9ejW5K7v 3bMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="L+Z8/UQ2"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-133380-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a29-20020a50c31d000000b0056e02f9a753si1044171edb.203.2024.04.05.13.42.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 13:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133380-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="L+Z8/UQ2"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-133380-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 716E11F22FEC for ; Fri, 5 Apr 2024 17:03:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B280171662; Fri, 5 Apr 2024 17:03:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="L+Z8/UQ2" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 59B6116FF49 for ; Fri, 5 Apr 2024 17:03:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712336598; cv=none; b=HIuS05fb3aqNJuYySUY2d3iK31SlUxCkNuOIGJn5FC18izj9iGWOKop5ktG8DDuszm7OUXXEUqENvLLIvLv2FYKswKTeC6mRGDU9840E1eYvYFkenuo3tZ/eNiq7YZDLI/GFS1JDSVSmIxIbq932/hZAJVCFWXUnzJcz89nqtVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712336598; c=relaxed/simple; bh=A2gJT9MPNiiRXZ3I1nDIIjh5qrMf6fMPCrzE1goQE7g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VUa7PxeO1wTEfu1G4P56hS7pTqSP+SPyjieGUzHirviwdUs5n/xPnuuswvDIfoumxQcm+gdDvXhcUH2FyBXxAg/F0JgKF2l4CXbm1thT4NXLge5OamUpJIQ0jBpnWwwBnf0JVHSmn/tvg16vKmtd6qHPbrM0aszW/kgNzSTkUpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=L+Z8/UQ2; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712336597; x=1743872597; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=A2gJT9MPNiiRXZ3I1nDIIjh5qrMf6fMPCrzE1goQE7g=; b=L+Z8/UQ2QJ3h2s9a0bybRlZrhJKUJ8lppTlamJui3RbGN760oP0ARIDC tfeVRDwSzz3qkm9QCsOyrw18pvR+/EZDO11VnNRhnpj1yyk1Jm8dztghJ r2Eaj4U8CG4IbCc51zuYGObwPR8xMmXcsUE4z4K5llS+IXvbFN75kiFFj xgkNvNK7pzlJaUiefKcjbvCU32UC4EE31Fzx10wdLiH3/TsVohTobiEJi pfOtMlY6ZXOgr0yx8Pj0JYAkOeSo4U24sY1+dA90DmTcBUPO94NwoooyB z5sltL95/Fu7jlz8cvKJ4o06GWI6r4Hep1WKDww5LKAfFkbHaVDYjx9WN A==; X-CSE-ConnectionGUID: beVtw9pnQPq+r/ujRLWHKA== X-CSE-MsgGUID: FTmVuDvhS+SS2uyy4XOcsw== X-IronPort-AV: E=McAfee;i="6600,9927,11035"; a="33075457" X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="33075457" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 10:03:16 -0700 X-CSE-ConnectionGUID: FR0NuFbmTRaj/tKSyh8wNA== X-CSE-MsgGUID: 4MeI8IxHSqy4FTP2KXFNVA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="23941500" Received: from twwright-mobl1.amr.corp.intel.com (HELO [10.209.65.212]) ([10.209.65.212]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 10:03:15 -0700 Message-ID: <9322f040-d2f9-4bdc-a85a-edf0082aea46@linux.intel.com> Date: Fri, 5 Apr 2024 10:03:15 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/4] x86/sev: add sev_es_enabled() function. To: Ashish Kalra , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org Cc: rafael@kernel.org, peterz@infradead.org, adrian.hunter@intel.com, jun.nakajima@intel.com, rick.p.edgecombe@intel.com, thomas.lendacky@amd.com, michael.roth@amd.com, seanjc@google.com, kai.huang@intel.com, bhe@redhat.com, kirill.shutemov@linux.intel.com, bdas@redhat.com, vkuznets@redhat.com, dionnaglaze@google.com, anisinha@redhat.com, jroedel@suse.de, ardb@kernel.org, kexec@lists.infradead.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org References: <20240325103911.2651793-1-kirill.shutemov@linux.intel.com> Content-Language: en-US From: Kuppuswamy Sathyanarayanan In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/4/24 4:11 PM, Ashish Kalra wrote: > From: Ashish Kalra > > Add sev_es_enabled() function to detect if SEV-ES > support is enabled. > > Signed-off-by: Ashish Kalra > --- Looks good to me. Reviewed-by: Kuppuswamy Sathyanarayanan > arch/x86/boot/compressed/sev.c | 5 +++++ > arch/x86/boot/compressed/sev.h | 2 ++ > 2 files changed, 7 insertions(+) > > diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c > index ec71846d28c9..4ae4cc51e6b8 100644 > --- a/arch/x86/boot/compressed/sev.c > +++ b/arch/x86/boot/compressed/sev.c > @@ -134,6 +134,11 @@ bool sev_snp_enabled(void) > return sev_status & MSR_AMD64_SEV_SNP_ENABLED; > } > > +bool sev_es_enabled(void) > +{ > + return sev_status & MSR_AMD64_SEV_ES_ENABLED; > +} > + > static void __page_state_change(unsigned long paddr, enum psc_op op) > { > u64 val; > diff --git a/arch/x86/boot/compressed/sev.h b/arch/x86/boot/compressed/sev.h > index fc725a981b09..5008c80e66e6 100644 > --- a/arch/x86/boot/compressed/sev.h > +++ b/arch/x86/boot/compressed/sev.h > @@ -11,11 +11,13 @@ > #ifdef CONFIG_AMD_MEM_ENCRYPT > > bool sev_snp_enabled(void); > +bool sev_es_enabled(void); > void snp_accept_memory(phys_addr_t start, phys_addr_t end); > > #else > > static inline bool sev_snp_enabled(void) { return false; } > +static inline bool sev_es_enabled(void) { return false; } > static inline void snp_accept_memory(phys_addr_t start, phys_addr_t end) { } > > #endif -- Sathyanarayanan Kuppuswamy Linux Kernel Developer