Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2988156pxb; Tue, 24 Aug 2021 12:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHEvr+GnlbP1VbNw+Z7T6QaZuTpZBXi2nv7ZGxJlmTy2cgbwO3F2qtSOI2udY0OIRB5Vh9 X-Received: by 2002:a92:cf08:: with SMTP id c8mr28931059ilo.246.1629832441705; Tue, 24 Aug 2021 12:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629832441; cv=none; d=google.com; s=arc-20160816; b=n9Y+H3bW7Q4rpY9lnhwXUkJXRQ8lfMH5GWQ7ey1FTDphTRTWMeqRNPwwge6SbnTdEz KNr2f+HLfZFZztw/S8Vlsr5xXJkMSaRXWxZkA7MuWuvSINo1W47m4EFSYrThZBpdIIRA ZfD3s+/MK3NM2SmHpk+YZaNpULBBfA3kg/yStcggnlgt8kJh8DTYfXNLS187dw2mZSMv 8G7TnDXW7omzINxc3H4886Hx6C6Il3Gb6ias7/VgcCKKvZwpNni2LM+tBFj9GHYK5lH/ pGGY3DTavcx6VeGAWuMQlJcMPrKXQeiZJz+udRo0bcdfrWJ5jQk9UqjTPC8OuVqfLU/O GcfA== 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; bh=3+1w3bsuPe/ptROWDsufVnNocHvUsawkkiGGKILEOk4=; b=oArS1NHcCqtJdUE0TBCz9Fppn5aLi2AgHkDhgyTxS8TVxRnkNSZ31olGbt62oyRavN iwSbz/rNFrlFoNptxKoCCw9LcieFTAsGZDVk84meqcVyBLP/D2JOWZsAzJU1ccHsK051 HPW13jdn7jzj0pvKeWaBcWK3t+YgHoom4l+s1QN8EgKK9jYp2siUHdXFt2JJxI+6vTsZ 9/AsKZ7LA34b7yoVe4b7ISYBgtA5+k23yUdh3H3GZ/6VYUfLIhn90xOC+WA+VOU5ztJw BBSALJN9BkaBOIFlIvrs9yjTBqWmSfpTJSb/yy8xm86ndC25uQssajvYnLb7wt62/uyk M8CA== 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 r11si23568839ill.21.2021.08.24.12.13.45; Tue, 24 Aug 2021 12:14:01 -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 S234572AbhHXTMo (ORCPT + 99 others); Tue, 24 Aug 2021 15:12:44 -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