Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp972969pxb; Fri, 13 Aug 2021 10:22:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyB6aVW1z8+a9zWtLswA5Sz524W5Je5C3NlM110/C4ut1uaCrSviBlft4AXLLDw3milxXy X-Received: by 2002:a17:906:7c46:: with SMTP id g6mr516235ejp.366.1628875328108; Fri, 13 Aug 2021 10:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628875328; cv=none; d=google.com; s=arc-20160816; b=bkUU4q8CCGTxha5FgXvWjnT7tJbYgqVbvkUmLAeuWSnw6eMI5Z1ZM7kzdVIacX3ksa a1PgbhPM7J5ujB2DcSZVyeSAANkFi0HynFz9eujTUMy1Pn/o0NSOOv3EzdiL7jaKERYR 7uSLB1FU8pRQovv8RYCT2eGQ2lZ554gTFV3sSe2wCg1u8TDrUwTq3BwTwEHhIQ3oSiMM SxDtnJ6TMkkADYXqQOnVh+z//NM0VDOSQdzd515Wt9KAY7K/R2JxeXDqjl58nKwJmKNA /LrCPLWa2b37eNyFlfnLeZuTLPcY+xv8UqQSPyF7eR5ptHu/FsXAs7TXzOcjjpaKMpor ZbIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ODsoDH9hJjP03gIDd2KSczxUNdOqX5PVtfuH9nExvB0=; b=MMqtemw0dlt62/VBsgnP6sjzijQ/WZnnPY/G4Dr7SB3Xqumw3Q4Z2BWr/idcy1rgAa Ewvxo0HlZoOqIoUXZUFIAfxF+ULMz95xx1SUQ6CjfINDNxt8Jt9wVsYdlCD62rIzR024 Lx1YltcEjyWp6SdVhTdA+TkF52V8ToRuw2aO2YVhNGq4u37dnJL9pWx23ksviJiIX9VZ wQ5lb1VkF5oXPhBrLGD0SaeBUEBfJyRSvsh9NL6UZyhOslCnMPdsHH8Cqjp9/+hipEaq kiHDrywELl+PKfUfXq26CtZtxYuSzbn6hEql+6kNcSDMlodpoKM5OHH+svbrXP+bc1Kp 6hyA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dz19si2780974edb.116.2021.08.13.10.21.44; Fri, 13 Aug 2021 10:22:08 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232179AbhHMRUU (ORCPT + 99 others); Fri, 13 Aug 2021 13:20:20 -0400 Received: from mga14.intel.com ([192.55.52.115]:28318 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbhHMRUT (ORCPT ); Fri, 13 Aug 2021 13:20:19 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10075"; a="215325872" X-IronPort-AV: E=Sophos;i="5.84,319,1620716400"; d="scan'208";a="215325872" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2021 10:19:52 -0700 X-IronPort-AV: E=Sophos;i="5.84,319,1620716400"; d="scan'208";a="639860653" Received: from amadatha-mobl.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.212.72.8]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2021 10:19:51 -0700 Subject: Re: [PATCH v2 02/12] mm: Introduce a function to check for virtualization protection features To: Tom Lendacky , linux-kernel@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-graphics-maintainer@vmware.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org Cc: Borislav Petkov , Brijesh Singh , Joerg Roedel , Andi Kleen , Tianyu Lan , Joerg Roedel References: <482fe51f1671c1cd081039801b03db7ec0036332.1628873970.git.thomas.lendacky@amd.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: Date: Fri, 13 Aug 2021 10:19:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <482fe51f1671c1cd081039801b03db7ec0036332.1628873970.git.thomas.lendacky@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/13/21 9:59 AM, Tom Lendacky wrote: > In prep for other protected virtualization technologies, introduce a > generic helper function, prot_guest_has(), that can be used to check > for specific protection attributes, like memory encryption. This is > intended to eliminate having to add multiple technology-specific checks > to the code (e.g. if (sev_active() || tdx_active())). > > Reviewed-by: Joerg Roedel > Co-developed-by: Andi Kleen > Signed-off-by: Andi Kleen > Co-developed-by: Kuppuswamy Sathyanarayanan > Signed-off-by: Kuppuswamy Sathyanarayanan > Signed-off-by: Tom Lendacky > --- > arch/Kconfig | 3 +++ > include/linux/protected_guest.h | 35 +++++++++++++++++++++++++++++++++ > 2 files changed, 38 insertions(+) > create mode 100644 include/linux/protected_guest.h Reviewed-by: Kuppuswamy Sathyanarayanan -- Sathyanarayanan Kuppuswamy Linux Kernel Developer