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=-6.6 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 7D6AAC4338F for ; Tue, 24 Aug 2021 19:12:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6464F61151 for ; Tue, 24 Aug 2021 19:12:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234616AbhHXTMp (ORCPT ); Tue, 24 Aug 2021 15:12:45 -0400 Received: from mga01.intel.com ([192.55.52.88]:11632 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234266AbhHXTMn (ORCPT ); Tue, 24 Aug 2021 15:12:43 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10086"; a="239546962" X-IronPort-AV: E=Sophos;i="5.84,347,1620716400"; d="scan'208";a="239546962" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2021 12:11:04 -0700 X-IronPort-AV: E=Sophos;i="5.84,347,1620716400"; d="scan'208";a="597687106" Received: from ydevadig-mobl.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.209.137.104]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2021 12:11:03 -0700 Subject: Re: [PATCH v5 09/12] x86/tdx: Wire up KVM hypercalls To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org References: <20210804181329.2899708-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210804181329.2899708-10-sathyanarayanan.kuppuswamy@linux.intel.com> <8ccbf970-fd4f-b1ea-ac85-98acfe296b00@linux.intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: Date: Tue, 24 Aug 2021 12:11:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: 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 8/24/21 11:29 AM, Borislav Petkov wrote: > On Tue, Aug 24, 2021 at 11:11:43AM -0700, Kuppuswamy, Sathyanarayanan wrote: >> Since TDX code can be used by other hypervisor (non KVM case) we >> want to have a config to differentiate the KVM related calls. > > You need to start explaining yourself better. WTH does "to differentiate > the KVM related calls" even mean? Differentiate for what?! tdx_kvm_hypercall() function and its usage in arch/x86/include/asm/kvm_para.h is only required for KVM hypervisor. static inline long kvm_hypercall0(unsigned int nr) { long ret; + + if (prot_guest_has(PATTR_GUEST_TDX)) + return tdx_kvm_hypercall(nr, 0, 0, 0, 0); If the TDX code is complied for another hypervior, we need some config to disable above the above code. CONFIG_INTEL_TDX_GUEST_KVM is added for this purpose. If you think there is no sufficient reason, I can use defined(CONFIG_KVM_GUEST) && defined(CONFIG_INTEL_TDX_GUEST) to protect the implementation of tdx_kvm_hypercall() > > Our CONFIG space is a huuge mess. Adding another option better be > properly justified. > >> Compiler raised version generation issue for __tdx_hypercall > > -ENOTENOUGHINFO. Following is the error info. WARNING: modpost: EXPORT symbol "__tdx_hypercall" [vmlinux] version generation failed, symbol will not be versioned. So to fix the above issue, added tdx.h in arch/x86/include/asm/asm-prototypes.h > > Try again. > >> Yes. I will fix this in next version. > > And here audit all your patchsets. All exports better be _GPL. Ok. I will check it before my next submission. > -- Sathyanarayanan Kuppuswamy Linux Kernel Developer