Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1377154pxj; Fri, 21 May 2021 12:41:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeKkaldw/e9kmW6/rGjsqTCrYdeSZL6n/v71pjuOWIANNbHVzT54BghRSFoGUCOi9kLS8b X-Received: by 2002:a05:6e02:1252:: with SMTP id j18mr374304ilq.205.1621626072757; Fri, 21 May 2021 12:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621626072; cv=none; d=google.com; s=arc-20160816; b=wFTbVkzQv2uDlQC3k04mekDQBzDGedeFvMei9C0558BAAP6iSpTdjtqrH/AX/VKrT3 aXcHCOKglOqh2C4Beuso8WLTnV7I8gU9n9OGSc5lxYLzSUPFQ8ABtkYe9MnsLmPg6LuC iz9lfDmMr32CuMi53eT8sw3GlHuxlOP8fVaoI0D3wtbEEg/YYkD8pWc9ISctGPsQKcGL ZT7kXR5eRd2ul2ILI6B48gJm8sNdkHZ0J/eQrtGmCZmIkXsCgUqzZ4Svtlb5slB4s+oW bUtm0WfXlOWYIfHaUWyaeoV7G8nRqWFdWdk7t6EH1Vkq95+wgiHtAXcIX9pQn6PTQbJS O4XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=LvGAJH9rFgXxYVV1pn6qEyiwvEKoRZtWDmFUplz/Jhk=; b=F4BNd8s4snCADF0GM66dhFzEfFubBAzmqLYb9JTiw+8+3PR3EiKMyhdkR84sM9op1s mHPdHgixXygxCcwu/qPDZX5k95fSHBuzfDHfnrRCNVfIg/+GxPjIHCvvuCCzhDA2u7xA pX/hZTNipBBQ82fK8arpZH7khiMKuTBTnSq3GmrLxtprWwtePfi/0EezelLK7v4SftZz Evq/i8YxJBmlw9sLkPe9K/M1w897YC9vja9KhxKy8lMDIkxQjr81BuzCBb0M957cxCto V89D7X6M9fAO/P1q82yNkJpamOysLyWpJHArhz3KzQ6WEmeQT9P9CikIkxIfpXBIvSBx mJgg== 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 w17si6381360ilm.86.2021.05.21.12.40.55; Fri, 21 May 2021 12:41:12 -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 S238513AbhETUcr (ORCPT + 99 others); Thu, 20 May 2021 16:32:47 -0400 Received: from mga06.intel.com ([134.134.136.31]:37433 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235538AbhETUcm (ORCPT ); Thu, 20 May 2021 16:32:42 -0400 IronPort-SDR: dqD6JvrRXuKGjvkp0dWgFxL7OA03mVA3uv8dXBkSA9eXV1wS8mlKE0Z2fJHADugzuSbhI9qX4q fxNfOz8DhWvg== X-IronPort-AV: E=McAfee;i="6200,9189,9990"; a="262553249" X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="262553249" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2021 13:31:20 -0700 IronPort-SDR: EVUx6zJQVeJDjOiLEwOxA8zkizKqjhnPG0Kuf2adK5gWpJjD/yfEPrsfjIE7JEdcfylegkz3db j13lfu1evqiw== X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="475366526" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.212.197.177]) ([10.212.197.177]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2021 13:31:19 -0700 Subject: Re: [RFC v2 27/32] x86/tdx: Exclude Shared bit from __PHYSICAL_MASK To: Sean Christopherson , "Kuppuswamy, Sathyanarayanan" Cc: Dave Hansen , Peter Zijlstra , Andy Lutomirski , Dan Williams , Tony Luck , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , linux-kernel@vger.kernel.org References: <87b31425b79df3cc44d2bdc6a79d6aa36c42d116.1619458733.git.sathyanarayanan.kuppuswamy@linux.intel.com> <3ae38a0b-0676-1543-7015-39a589b2807a@intel.com> <0df80c0f-e0da-e86e-0ab8-abc58f0da559@linux.intel.com> From: Andi Kleen Message-ID: Date: Thu, 20 May 2021 13:31:11 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_. Is it really that hard to adjust your grep patterns? I'm not against changing tdg_, but if it's changed it should be something unique, and also not too long. Today tdg_ fits that criteria nicely. -Andi