Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1386969pxj; Fri, 21 May 2021 12:59:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfPL0EhtaVPVcI6qbNQ+9GScvuZ20DWp+UpI7K7PuWhaLZsCEtsnB6wCEW4saqmcVDWWiy X-Received: by 2002:a17:906:814d:: with SMTP id z13mr2969345ejw.195.1621627167112; Fri, 21 May 2021 12:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621627167; cv=none; d=google.com; s=arc-20160816; b=WOtXCBL3sS9Za4Rys1AeT8yWNN+eAv/8x0Rc+YRF32S1RNa6LBET4PaJIUGnqzhAde ySYVHt9Ls9DZu6fGFAat4Bh+9NywDhvTorA3RYQ1WH/KsoA3CZIFFe6YsTIpkM474ap/ KwqaCXPc+NTBJUP8U3lSVeKFvHMBIqtcEjJLMoKlxU1YRT6a+6vNZLXdZib1sD2uqP+3 k4GVliJbzOhREN0zpY0NWDecepCsk30jahIXvTzkuQjRbU3dBTWb8XsyosXd/UK49yMh yeAT0BgN3jlea5APRD0iNm4VvIIW7nXwgNsZae86HkpjMQooOxpWx2tp9yHyjAvdcAcn 6Row== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ccUeVdViKeAHhCwYNh1t4eJp3ekIpRE9ztcvr+pqXc8=; b=tbUFiFybXapqyVymZmi/s78UV7kXcIyPX9k57mDA4tuoVxSDU6PMhGDYI88rnUPPS9 bZn5ZN7x3svgGT2Hoour2jbZGev6Gvz63U4BMsiuNIGamylwj+IivAqollcFNXReCCPv BYKSoYTyd8LFWUhztoZ5Vw7Pd/RNFIApZPEcdyXWA554UgCWCwcyiIXukXNfaldMNLSo 77/vHNL4r6SvCaPsobKJnFOeMwP4u1JSIvFbEECCbNgLzyrKxk/fxOLEPjXJopQNvFLn wIvv/xB+my6NAKRQRRVIiQKA630B4osodRu6BUspPzVK2714Oft1WpVi7/qafyA1I9vT E+oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=wHSWVnXz; 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 ca24si5959122ejb.289.2021.05.21.12.59.03; Fri, 21 May 2021 12:59:27 -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=wHSWVnXz; 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 S230111AbhETVUQ (ORCPT + 99 others); Thu, 20 May 2021 17:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbhETVUO (ORCPT ); Thu, 20 May 2021 17:20:14 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE547C061574 for ; Thu, 20 May 2021 14:18:52 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id x18so9033555pfi.9 for ; Thu, 20 May 2021 14:18:52 -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:content-transfer-encoding:in-reply-to; bh=ccUeVdViKeAHhCwYNh1t4eJp3ekIpRE9ztcvr+pqXc8=; b=wHSWVnXz7FivIq9wwjhEq7H+1ZNnLKgaemEzla6XyLgWEct/MOsvUJymSra75uuhgV 1+gk414c8cimmRpUwYDhVxtZ8Ynp/9ZYSl32/dOXJK3AjijgD7h4oVMLKs+cDSpbtnla 0f6KSQVA/iQebQe5bcCphM5b4J5Bsv00odQTXNj/m4aOdNFJlBt1ikxyUEfe6MqyVqzF WPFC3FbTkma2OxzT2Wq/qsAjqMQ9czWQ8OqvogSFMLBCHk8SXpbd7iSF1R1v8BzaBaBf RWe/sqy3LlO9fcj2q1W5buP4TO7Mc2myjyaGcprt/ZcPZFCBk10g/a8rNBCR3kthPkoY V9cg== 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:content-transfer-encoding :in-reply-to; bh=ccUeVdViKeAHhCwYNh1t4eJp3ekIpRE9ztcvr+pqXc8=; b=j9sYN17QCtaI7yjoD6GCGj8MnPyCvZt0XqY6PSg6a3+mnNS/1+6/ObY/8Ol+QyYl2t xCmDad6xOp4241ZQS2GIHWYkWBJNLZpBfXc66vIUuXemh0oCxBvAs/hINolQ8KMecIKD Wzo7dsWcGft0ia0cUzSxD8L93VKmuQUAS7AkY4tJDBqQLQ34AuW7kNho4SeIn/ho/+LS KjCO5g0YBUzJQHDyD7x6LEsejAp2h3jvYjWD6ncu0sgC8gkVerNErm0K1/0EVQO0H3RR QCQWuh3TFkVptXb03wNETo+EzOBgpVI10iR5Y/GDfdYE1jJOHLa6EuER/j4OI/pbuYC5 Yb0g== X-Gm-Message-State: AOAM533bqwsAgSrgRQ5rI+EGTJl5lBzMAci4kN3ZToZki/VvlrLiy4xs 85uMpbjjAmKT9zQwl9YMiFbHpQ== X-Received: by 2002:a05:6a00:22c1:b029:2dc:edbe:5e9 with SMTP id f1-20020a056a0022c1b02902dcedbe05e9mr6429268pfj.51.1621545532278; Thu, 20 May 2021 14:18:52 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id h8sm2369266pfv.60.2021.05.20.14.18.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 14:18:51 -0700 (PDT) Date: Thu, 20 May 2021 21:18:48 +0000 From: Sean Christopherson To: Andi Kleen Cc: "Kuppuswamy, Sathyanarayanan" , Dave Hansen , Peter Zijlstra , Andy Lutomirski , Dan Williams , Tony Luck , 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021, Andi Kleen wrote: > > On 5/20/2021 1:16 PM, Sean Christopherson wrote: > > 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. > > > Sorry Sean, but your suggestion is against all good code hygiene practices. > Normally we try to pick unique prefixes for every module, and trying to > coordinate with lots of other code that is maintained by other people is > just a long term recipe for annoying merging problems.? Same with > coordinating with SEV-ES for ve_. For ve_? SEV-ES uses vc_... I'd buy that argument if series as a whole was consistent, but there are individual function prototypes that aren't consistent, e.g. +static int __tdg_map_gpa(phys_addr_t gpa, int numpages, + enum tdx_map_type map_type) a number of functions that use tdx_ isntead of tdg_ (I'll give y'all a break on is_tdx_guest()), the files are all tdx.{c,h}, the shortlogs all use x86/tdx, the comments all use TDX, and so on and so forth. I understand the desire to have a unique prefix, but tdg is is _too_ close to tdx. I don't want to spend the next N years wondering if tdg is a typo or intended.