Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp789538pxj; Wed, 2 Jun 2021 11:27:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJMiYu/OqWPJVFBVN7BO8m5XlHl+kV77ZUnNC0rrMvgOFy4/Oen/Ls4z0/wuxj6+aYgWw4 X-Received: by 2002:a17:906:848:: with SMTP id f8mr10579656ejd.198.1622658425138; Wed, 02 Jun 2021 11:27:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622658425; cv=none; d=google.com; s=arc-20160816; b=y0r1im987qeE/HqeZF7Zm8WKzCYomn6MTPklgaUO2ojvDbn0joDE+sTHpPiIqBDoyU AfC1+I4HB4waGKrWECGnhbsALDaDQ3OKLDsquyp3fZIOig6cQac0HtjtxWaacbK3qCUU Pva8wqrBdjUwafgAANZyKxGtokx7U8TaBwhZL3IjIDoHTKXL/qVF6iuOHwmLQB6LEsu+ GU3bepfssvt5Fc8OJl612KOXjTjWvXKX8F0Z/26InVXmFNX9u680qKeQbtWW7eq/BijD uFihhrN+DXsF5x3dj1yKeqg/+bD5zjGUvhlLyMO1CXRyljZm9XWPObRZWDur+i9yI9MX ePkw== 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:ironport-sdr:ironport-sdr; bh=jHfFS8M5qERj++P+kwyw3JKComLIpMMW+WMwj2TAFXQ=; b=BYHakFPVR1PqiHjH8/K1AFOJBf2N2OcyZxHfm2XLoDabHvGYFqkj1/hxyIdeXo2c5w 3//SYn54Z8QFT3p5+W236duLSnRsyhmTU8+FGnn/XkldLdhvz6tAqAGnXaqemvR7pCHe q3CdbXBjsVgQsjwyjqkpomY1PbPS2oNya1kzy/zEWeOrDj2JpTawboyZEJU4feUy1PJL Mc4ir9/Nh8g1RXedxSDxAbCTWmXwG4nwGW/K4L8Awd57/hHBT6UIRage5RMY2jas+S4K xs2lz5eUsRV3BQM1HIcuiCEYNSPcEMoIbL0iYROTfwr0d3h7GyPhWYSmfeIFUa6Gsx5g HpPA== 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 w9si495529edx.381.2021.06.02.11.26.42; Wed, 02 Jun 2021 11:27:05 -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 S229553AbhFBS1b (ORCPT + 99 others); Wed, 2 Jun 2021 14:27:31 -0400 Received: from mga06.intel.com ([134.134.136.31]:42858 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbhFBS1b (ORCPT ); Wed, 2 Jun 2021 14:27:31 -0400 IronPort-SDR: tVlssgAe9yFKLFLYOXGmAW27oC3D1hOoRGiWhTAWFkPz1ouGl8H7J5rpYM+J2E3uADXCVNdtPq /AmHa13j2gVg== X-IronPort-AV: E=McAfee;i="6200,9189,10003"; a="265037822" X-IronPort-AV: E=Sophos;i="5.83,242,1616482800"; d="scan'208";a="265037822" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 11:25:47 -0700 IronPort-SDR: VVsyhCtSAfniCgZoAi8WEAq1CFWJswCeyVmKtdYKbUkIvJwN79WSKJGVS7LpXvWJ9FeZbBTIdm 3Ka4Iuz7PCww== X-IronPort-AV: E=Sophos;i="5.83,242,1616482800"; d="scan'208";a="416996201" Received: from sboinap-mobl1.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.209.150.149]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 11:25:46 -0700 Subject: Re: [RFC v2-fix-v2 1/1] x86: Introduce generic protected guest abstraction To: Tom Lendacky , Sean Christopherson Cc: Peter Zijlstra , Andy Lutomirski , Dave Hansen , Tony Luck , Borislav Petkov , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Dan Williams , Raj Ashok , linux-kernel@vger.kernel.org References: <20210527042356.3983284-2-sathyanarayanan.kuppuswamy@linux.intel.com> <20210601211417.2177598-1-sathyanarayanan.kuppuswamy@linux.intel.com> <3036a655-9d09-0f04-62a2-7a72ba9af5c7@amd.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: Date: Wed, 2 Jun 2021 11:25:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <3036a655-9d09-0f04-62a2-7a72ba9af5c7@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 6/2/21 11:15 AM, Tom Lendacky wrote: > The original suggestion from Boris, IIRC, was for protected_guest_has() > function (below) to be: > > if (intel) > return intel_protected_guest_has(); Yes. But for Intel, I think currently we can only check for is_tdx_guest() here. if (is_tdx_guest()) return intel_protected_guest_has(); So if we use is_tdx_guest(), it is better to call tdx_protected_guest_has() here. Once we start using protected_guest_has for other Intel technologies, may be we can generalize it. Let me know your comments. > else if (amd) > return amd_protected_guest_has(); > else > return false; > > And then you could check for TDX or SME/SEV in the respective functions. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer