Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp41584pxj; Wed, 9 Jun 2021 15:59:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtL3MmnfmhEzlDI9bc4s5VO1iO1Bs9O3mL9OnfQjjnk5I6ZhaljR9VbLGvT74cKCqy+bTS X-Received: by 2002:a17:906:3411:: with SMTP id c17mr1853458ejb.480.1623279539859; Wed, 09 Jun 2021 15:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623279539; cv=none; d=google.com; s=arc-20160816; b=vqPDqOUOf5mvlDSMsOCh2KziXmDJYg3RvDltnzPBTulj5b49nvEHmj6G1NnuAe8iAg ryK0GoRNM5IsLOcLUXwkezL2Eu9OYBnaYjXCpubkPoe7o6pxwMZNnTATbwZjWMCS3xSO WPCnfIzn1kQZk7LfwgoC3PI/gMxm033PimnYmO5mu3y9m62awKJf+iZTysVhTn+VwxDw i2Wk4sgNMmV7ZlqXqcxGWJhQAdQkBeag0WUXHkrvdj7B22rvdaPQ9i1TYwgQMDen/MDw mk5jpfnROXr2b+0RyliooXQfjI2ux364/SAPBjvwqlYu1PNgjYlrQVBUuhHuAD4MUBHn bbIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=fZBw4seN/uDk7Yq4vwAfnRw1lvG+8DAJe0IFY4xw8iw=; b=mtDLPWRx6t/FpLnsSdV86Nl47tZt4mETO3NC+ulO0qMpBBLISC1fgzdC6jccZZL/XV 3uy1XP7vEzz8Ze2mN6FtjWwCOaMI06HlHg17EaHlzwWXb0bDmf+JY1ai6p5mXGHwVUsy EnAx5s6V61kTfH3W0882FDZgRV9y7tY5fLLVOLr3G/gNNVfek1VmCWdPjnLMdlJNypqT SjtV8h/FLylydKRB8agHn4uetzY24s1sjgscDN+x80ZUPGbV7B3sDpVFu9OaQbmEqWT2 Z2lBFKEjFJIeoCp6GCUx6F4qfQ/sStZgGJgd1h2+JRMke6OBlrlYs44q1n8iLy5rYTx2 SISQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SNMeNLAW; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q11si822380ejs.90.2021.06.09.15.58.35; Wed, 09 Jun 2021 15:58:59 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SNMeNLAW; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbhFIW5N (ORCPT + 99 others); Wed, 9 Jun 2021 18:57:13 -0400 Received: from mail-yb1-f177.google.com ([209.85.219.177]:45967 "EHLO mail-yb1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbhFIW5K (ORCPT ); Wed, 9 Jun 2021 18:57:10 -0400 Received: by mail-yb1-f177.google.com with SMTP id g38so37796921ybi.12 for ; Wed, 09 Jun 2021 15:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fZBw4seN/uDk7Yq4vwAfnRw1lvG+8DAJe0IFY4xw8iw=; b=SNMeNLAWCy+4o9WJQIdCW6GI6FA/sKubFjkzsRQMl4XIV5T+AJ645WZpDmT+J9VdEm oylkyspzkQPU7zVo8QGOmoJGi/F3XUhZf+17iZWSpquM3NCV+o+XJOt2XWTs+/b9mbgl 8bWQtICXxgeTJ4TbCAPIDgUV4QSOKQ6JIq9hr8PICnvf9cGbHrUQz832UiXR8Q1IEsKQ SQa2+PEZdrLS1Tivk9WMywQAPStx3Q20uKLWsABiDpewtomrjjqX3GjlsjBzY1kYR8xu yD8NWFh567Qh1pv7vbi1CSP1rrofr4fb2u+MF48pHa8YFSdmT9VORFAGtMNuJR8cjMtp OgCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fZBw4seN/uDk7Yq4vwAfnRw1lvG+8DAJe0IFY4xw8iw=; b=mOCiXM9W6rBWMrpazo3jYzV0N85dIMsQwvFCrlDkzVBEDDTKaG8LqWHeb9NmNuY380 xTJpaM+hzOzrAjxnzJEZ/u1uvA3nWcX77mref2EL53cB4AdCZRHJpr/xen74+GbNl5KJ KHcZW7Zy99emenF8cnjMSeqXA4QVmXc2kyyQefX3DIoUpcotPbirPMJ5+1PWojRdozk/ iBtSzJ3tePhQ4vNkLmK2mTmUV+I4vXefVI50Ef5GjmxbjyaJUD1oPfdBYLRsDx1dH0CA WdPqTPHNqoFjUZqVHAIY0XidtvEVepP3vOmr0yNXfU+XUiZ1gArngR2DIdvPBUI2b4iT NeCg== X-Gm-Message-State: AOAM533julgWZEKQ3CC6gVPEIPi5OsxGtRxXK+TcusTU5FPijj/kM9mA 18L8bEANgJLRH+rqafFsjtk1rVJnwRoqxziJsEg= X-Received: by 2002:a25:d008:: with SMTP id h8mr3437465ybg.436.1623279242508; Wed, 09 Jun 2021 15:54:02 -0700 (PDT) MIME-Version: 1.0 References: <20210609194137.1949436-1-sathyanarayanan.kuppuswamy@linux.intel.com> In-Reply-To: <20210609194137.1949436-1-sathyanarayanan.kuppuswamy@linux.intel.com> From: Sathyanarayanan Kuppuswamy Natarajan Date: Wed, 9 Jun 2021 15:53:51 -0700 Message-ID: Subject: Re: [RFC v2-fix-v4 1/1] x86: Introduce generic protected guest abstraction To: Kuppuswamy Sathyanarayanan Cc: Peter Zijlstra , Andy Lutomirski , Dave Hansen , Borislav Petkov , Tony Luck , Andi Kleen , Kirill Shutemov , Dan Williams , Raj Ashok , Sean Christopherson , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, On Wed, Jun 9, 2021 at 12:42 PM Kuppuswamy Sathyanarayanan wrote: > > Add a generic way to check if we run with an encrypted guest, > without requiring x86 specific ifdefs. This can then be used in > non architecture specific code. > > prot_guest_has() is used to check for protected guest feature > flags. > > Originally-by: Andi Kleen > Signed-off-by: Kuppuswamy Sathyanarayanan > --- I have sent a non RFC version of this patch for x86 review. Please use it for further discussion. https://lore.kernel.org/patchwork/patch/1444184/ > Changes since RFC v2-fix-v3: > * Introduced ARCH_HAS_PROTECTED_GUEST and moved arch specific checks to > asm/protected_guest.h > > Changes since RFC v2-fix-v2: > * Renamed protected_guest_has() to prot_guest_has(). > * Changed flag prefix from VM_ to PR_GUEST_ > * Merged Borislav AMD implementation fix. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer