Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp753903pxj; Thu, 13 May 2021 16:29:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztq3/tFEhyCZOWAhjtSr+/lZMMSjPGb6+xTvYbYTpealPcbXrzVlBARDhjvOr8Cv1dM5fK X-Received: by 2002:a05:6e02:128a:: with SMTP id y10mr36750542ilq.166.1620948586349; Thu, 13 May 2021 16:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620948586; cv=none; d=google.com; s=arc-20160816; b=BL3QFdmP6yKh7+W79+jnVlWz90u6LGwsXnfOnu+xilApvjiM7JDXT65AKqY2hkjmJ8 JmXVWfNBPCiJeasRwccT3lG1WrDPX1XaRdpQmXRglPl0A4HMA5lRonlta5and/WVGD+s 3M5SkIOOxz5MFMm94cp8KBfr6oMB1u5TY5fIfS3YGEDXoF1s6djF1ofVEE0HhFjaQn6+ Tq+H5caEULmEHFpz+XahzDju3fds+GXeobbUEQvKgjR/8m8t4x+v2FFZZBcg9wzxe0b4 8x5J5LgXqlr35FVu4BCy6907APHdXXpDm9d1nEMsNXGrTPpUmS8we0mEgUYy1oN4DxKV /Fcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=YMO51DbqZS8GSmOL3cMWVmSuPZGjh1CUZuaW/94M7/c=; b=d7GtOkXEHBZ8ZvFY06rL9NWztB7Tq7n0zdMhA7Rq1k+K0o2t+AotfQxT30u2PeATbo 7JDIGAGGOoLnIeG3RMZZVhTstbwD6uz7MPHzxXEUGdcVn1JeWEYcCe+OSPDcwDpmiMh2 tvqwB4UOnv3KZh1g5yUTevG9T1FQ/vZ8gQvyUPPfgIy8a3RI9pZylQmlsuahga1s0iqV sh1fpTw65DWpOmX5iqQLgILtGGxqOAjMG4D+jX3feUhdmNb48FpQj7zQCdl08R1VmjW9 inHPBfhHEIbmBv/H1Ese//7pYeen8BMpBclP+JbukIYjXNznrfhhkGsPfP7BOkch+8xM cacg== 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 n10si6453523ilk.92.2021.05.13.16.29.33; Thu, 13 May 2021 16:29:46 -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 S230415AbhEMTal (ORCPT + 99 others); Thu, 13 May 2021 15:30:41 -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