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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 A4F71C433B4 for ; Thu, 13 May 2021 19:29:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CC55613F7 for ; Thu, 13 May 2021 19:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbhEMTao (ORCPT ); Thu, 13 May 2021 15:30:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:60114 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbhEMTai (ORCPT ); Thu, 13 May 2021 15:30:38 -0400 IronPort-SDR: +6zhGkO8WijOe8vJL3k6r0H1CAT9dj5jFWHka4rCkcUrbL4nOY42U0hPj6iFBec7YNSCTLKmaR hsg2sMv/oZqA== X-IronPort-AV: E=McAfee;i="6200,9189,9983"; a="200085360" X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="200085360" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 12:29:25 -0700 IronPort-SDR: J9OlAAfkrLiYJtR1vf+1vq6ksQK7DWG3RupnyQwJyGp+BQ3bCYa9fGprJX4K3IElNslnNovNxE fueoPwkSIeyg== X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="437780447" Received: from dleves-mobl1.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.209.146.134]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 12:29:23 -0700 Subject: Re: [RFC v2 10/32] x86/tdx: Wire up KVM hypercalls To: Dave Hansen , "Kirill A. Shutemov" Cc: Peter Zijlstra , Andy Lutomirski , Dan Williams , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , linux-kernel@vger.kernel.org, Isaku Yamahata References: <04de6cd6549eee0b77fe3b0937c4b4b7f0e3ff2e.1619458733.git.sathyanarayanan.kuppuswamy@linux.intel.com> <20210512130004.gxiaxj6wlzcjcem5@box.shutemov.name> <25e248b2-06f7-a450-4c9f-e90e0f0be56e@linux.intel.com> <75e63641-6dea-b339-444e-42bedbd28a1b@intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: Date: Thu, 13 May 2021 12:29:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <75e63641-6dea-b339-444e-42bedbd28a1b@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/12/21 7:29 AM, Dave Hansen wrote: > On 5/12/21 7:10 AM, Kuppuswamy, Sathyanarayanan wrote: >> On 5/12/21 6:00 AM, Kirill A. Shutemov wrote: >>> This has to be compiled only for TDX+KVM. >> >> Got it. So if we want to remove the "C" file include, we will have to >> add #ifdef CONFIG_KVM_GUEST in Makefile. >> >> ifdef CONFIG_KVM_GUEST >> obj-$(CONFIG_INTEL_TDX_GUEST) += tdx-kvm.o >> #endif > > Is there truly no dependency between CONFIG_KVM_GUEST and > CONFIG_INTEL_TDX_GUEST? We want to re-use TDX code with other hypervisors/guests as well. So we can't create direct dependency with CONFIG_KVM_GUEST in Kconfig. > > If there isn't, then the way we do it is adding another (invisible) > Kconfig variable to express the dependency for tdx-kvm.o: > > config INTEL_TDX_GUEST_KVM > bool > depends on KVM_GUEST && INTEL_TDX_GUEST Currently it will only be used for KVM hypercall code. Will it to be overkill to create a new config over #ifdefs for this use case ? But, if this is the preferred approach, I will go with this suggestion. > -- Sathyanarayanan Kuppuswamy Linux Kernel Developer