From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A16C4C433B4 for ; Thu, 20 May 2021 19:33:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75557611AD for ; Thu, 20 May 2021 19:33:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238322AbhETTe4 (ORCPT ); Thu, 20 May 2021 15:34:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234189AbhETTex (ORCPT ); Thu, 20 May 2021 15:34:53 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AF86C061574 for ; Thu, 20 May 2021 12:33:28 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id ep16-20020a17090ae650b029015d00f578a8so5847817pjb.2 for ; Thu, 20 May 2021 12:33:28 -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=DKaftpjv7H83Jh/uRtII0tq3p9ECwTnXtKKu/Rh05PI=; b=vz5G03Jq3T+zYlANXUXDryLqsRfrAPGj9W2taWRFdoAqGpZb9TiwgFz6Ogsh6l69kb JdPBtixQGnCKuAjOaWr3RFRc37fQZXsY9umWWFIr9btcsZ2H6JvT/yUdwCaPzbadtkk7 N1Ozq3SS/8ad81RVsvUvY0I0pwjvMahpz/+P0lx9rO4DvRc3eowOqndgZyTWno9I4ZXO qm1nnrbXkFkzbI6LM68ZxsFc2B4C8MgChsg4h8eU7hTrpYYrvE6c/6Wo2z76zNKgTbBO E/Y/DGO0KUByry4G6Cp9DKF7jIUQHysttBXkHfXRkQWEOqyqWRD14EtyaLwftyOhAUfL FSPA== 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=DKaftpjv7H83Jh/uRtII0tq3p9ECwTnXtKKu/Rh05PI=; b=mjbqTcFZFAD27BfvIybHzEzHbVRAtPDO910GOCzTPI8YHFMmYU8seOoOksLpEgkFHv nnzE2PykkMk4wdOfdUi4RWm5KTsL28TWf5blCVkUjAC/b3vVJLmDZh8ZDjrRRtjG/IDp vIbz5bQy193sRBoTm3Xelr4m+jwK4sxZkvQAjNhd/32jg8v/g4j10yU/192czLCUGVuD kBe6Jhq0dJibNvisBDmrN2JX697Lv8kEX4hYrP+bHULvyqmLnhlw3oHAuU6QeLOdsVZp y397K/sawPxLyo3cq85LAhtaKF/yfra6rxXiklV9t+plJmyBPGcYnkxekRO7yJD3ODiP DzqQ== X-Gm-Message-State: AOAM5310POLd5MdyrbwRQZ4ulzncMYvMzaRJX4IalJBx3eLSsvXkcfnK 38CH+TFfYYpWQp55f4dcsG10bw== X-Google-Smtp-Source: ABdhPJx2cEANB7DElFy0DEIg4GJXnR9d7vcMndsj8xxQv4VsXHSdZwNwbkTVvozR7t2BFM6ZIHpLeg== X-Received: by 2002:a17:90a:7486:: with SMTP id p6mr6949639pjk.216.1621539207345; Thu, 20 May 2021 12:33:27 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id b17sm2565876pgb.71.2021.05.20.12.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 12:33:26 -0700 (PDT) Date: Thu, 20 May 2021 19:33:22 +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: <0df80c0f-e0da-e86e-0ab8-abc58f0da559@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021, Kuppuswamy, Sathyanarayanan wrote: > Hi Dave, > > On 5/19/21 9:14 AM, Dave Hansen wrote: > > On 4/26/21 11:01 AM, Kuppuswamy Sathyanarayanan wrote: > > > From: "Kirill A. Shutemov" > > > > > > tdx_shared_mask() returns the mask that has to be set in a page > > > table entry to make page shared with VMM. > > > > Here's a rewrite: > > > > Just like MKTME, TDX reassigns bits of the physical address for > > metadata. MKTME used several bits for an encryption KeyID. TDX uses a > > single bit in guests to communicate whether a physical page should be > > protected by TDX as private memory (bit set to 0) or unprotected and > > shared with the VMM (bit set to 1). > > > > Add a helper, tdg_shared_mask() (bad name please fix it) to generate the > > Initially we have used tdx_* prefix for the guest code. But when the code from > host side got merged together, we came across many name conflicts. Whatever the conflicts are, they are by no means an unsolvable problem. I am more than happy to end up with slightly verbose names in KVM if that's what it takes to avoid "tdg". > So to avoid such issues in future, we were asked not to use the "tdx_" prefix > and our alternative choice was "tdg_". Who asked you not to use tdx_? More specifically, did that feedback come from a maintainer (or anyone on-list), or was it an Intel-internal decision? > Also, IMO, "tdg" prefix is more meaningful for guest code (Trusted Domain Guest) > compared to "tdx" (Trusted Domain eXtensions). I know that it gets confusing > when grepping for TDX related changes. But since these functions are only used > inside arch/x86 it should not be too confusing. > > Even if rename is requested, IMO, it is easier to do it in one patch over > making changes in all the patches. So if it is required, we can do it later > once these initial patches were merged. Hell no, we are not merging known bad crud that requires useless churn to get things right.