Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1375871pxj; Fri, 21 May 2021 12:38:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypkm6+i0GhdapgQouRAON8EWaA3NMRnFbYr3p9DGiaABNSyjHfuLZKs4nez/spZDO8bw7V X-Received: by 2002:a05:6e02:190f:: with SMTP id w15mr422082ilu.13.1621625927373; Fri, 21 May 2021 12:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621625927; cv=none; d=google.com; s=arc-20160816; b=Qr19Oq9/T5o/RNEvtM0c5yE9PqLRxVPaIjyolHUKe+dGJ+fnCDL55DLc9Q9GOjZUpD FCZo4Mq9ocr+OYdVX3MGvFp8x5H0QcLzmYCZszjUhIew+NSojScVs+CigoO3s9RiAEAg kDic4c/oq72q27/YykUYy4Tdi9Jk0M9dHkPzGDi0uqKCBCy5Xt0GsZ2A5/YlWY+natpe SqTSyL6kbqI59b1JRfQCXHWdME63NHWqSMN58dhf904OPkKniphvNlaXtuuXugJYEBVc r0r+W1PrwtW9pm3XvovUAEtQImFbMueNZgURI5O/dU2qw1fs9jNTqlec7fm0/vbIMp5V /xlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=INMyeDv6bEn3F5q6tUUsTxPpOgMMj90uTo+ivTj0jug=; b=TFzEsm0IdRM5qutwZCm8MLus0YVkI2Bqhz9TuU1uXhBkrBvZ+z3QaddFAtkaPQqZsR ayu88lnUdi/ECezoEH4huVXZMcA+/C6WZYXwHpkUCkfFLigidOrCiymdHBgqmQcMwk3W 6kqPzAARYrMFVVYx46i9nYBCmLLiHsXVa2F+vzkezKwuWbBNKNac5pHKEsR3J7s9z1bR 4DsZE0KbE1FE1QfRY+87hdwYPk2Oe8ZMQlQ2CkaVo1S/hmKJGDp1Osgm8uQH+iAASvQT aiuuqB9l2kr2yHviRxBEXQHvnKvCSlXPZJybLwz3ULnD/Y3MzGcBcDLKmV69D/SBQXB6 x5DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=scg4Sz7K; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si1315303ilg.124.2021.05.21.12.38.34; Fri, 21 May 2021 12:38:47 -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=@google.com header.s=20161025 header.b=scg4Sz7K; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238096AbhETUSV (ORCPT + 99 others); Thu, 20 May 2021 16:18:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233159AbhETUSU (ORCPT ); Thu, 20 May 2021 16:18:20 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38EC0C061574 for ; Thu, 20 May 2021 13:16:59 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id b9-20020a17090a9909b029015cf9effaeaso6056231pjp.5 for ; Thu, 20 May 2021 13:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=INMyeDv6bEn3F5q6tUUsTxPpOgMMj90uTo+ivTj0jug=; b=scg4Sz7KckDjkbQzbmob5HLOfhbNb8RD7yL1UAQXpsVMxj4frt3/2DbCZSSVTZRU90 9jFQH3LXEcPsiYPgwYK06biS93xOuMdDVjZNdSLcX+DiokKY1nt6yOMdv+wERylOc9Vf k2Z8v+TrbiMY/KnUmDzUMwWlxv3IuipMQlzuKFnznp6z7YBRIg9DjpmcixpINQbeiDXF qPpSORxOS1FUVtnffAqXH00Fw8nsOb/NoZkOn6enLlz8aP3WQak1YbOckFEArOgQy+Ai rR2Bz9sIG/PTo7d+1UToVFrt4hQvyWDGbGOc//Yt8214EYjrKZsuV5LiSaMIqb5JhlKT 9GSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=INMyeDv6bEn3F5q6tUUsTxPpOgMMj90uTo+ivTj0jug=; b=Gl51bA7JL5XfFpZ1V1FFt+r8Kod1SfGQIoC8xI1kSnmTvEHrP5PvKcMEsLHc7ZqsVS 3mOxLmbxOjzLaDHhh1h69zW/J6WWCeTVQfq0xIK0AfPQjtuv99ukwtpB6fn+FVGIWe8j elCPpt+De13gQcxjLbQ+HzM5zHAe8Yq2tBRBsV+4MF0ATtTDBDBczqzaMVcV3bysbeGw MuFhtbQFTTBoq7xJg5dk1vMaKXIFhlCV3kIo7vdMhqpq/gcRZ87sEAnsjke4BoYI/qrF NnntN08nfFNZtvzj5iKVdYJLixR3gNva3VXJD4XjgeXWIoA4FIgfkhz2ZuJfxSE3qzy2 Phlw== X-Gm-Message-State: AOAM533C7qWIzi3wu9biUF+zP8vIrYwgKK/y+8+0lTc6+j/ACxiL2sIA h9n5AfYNuqxL9YYxJ3JrDuyolw== X-Received: by 2002:a17:90a:bd01:: with SMTP id y1mr6825502pjr.166.1621541818367; Thu, 20 May 2021 13:16:58 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id o134sm2614308pfd.58.2021.05.20.13.16.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 13:16:57 -0700 (PDT) Date: Thu, 20 May 2021 20:16:54 +0000 From: Sean Christopherson To: "Kuppuswamy, Sathyanarayanan" Cc: Dave Hansen , Peter Zijlstra , Andy Lutomirski , Dan Williams , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , linux-kernel@vger.kernel.org Subject: Re: [RFC v2 27/32] x86/tdx: Exclude Shared bit from __PHYSICAL_MASK Message-ID: References: <87b31425b79df3cc44d2bdc6a79d6aa36c42d116.1619458733.git.sathyanarayanan.kuppuswamy@linux.intel.com> <3ae38a0b-0676-1543-7015-39a589b2807a@intel.com> <0df80c0f-e0da-e86e-0ab8-abc58f0da559@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021, Kuppuswamy, Sathyanarayanan wrote: > So what is your proposal? "tdx_guest_" / "tdx_host_" ? 1. Abstract things where appropriate, e.g. I'm guessing there is a clever way to deal with the shared vs. private inversion and avoid tdg_shared_mask altogether. 2. Steal what SEV-ES did for the #VC handlers and use ve_ as the prefix for handlers. 3. Use tdx_ everywhere else and handle the conflicts on a case-by-case basis with a healthy dose of common sense. E.g. there should be no need to worry about "static __cpuidle void tdg_safe_halt(void)" colliding because neither the guest nor KVM should be exposing tdx_safe_halt() outside of its compilation unit.