From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92D4728368A; Fri, 20 Jun 2025 12:48:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750423727; cv=none; b=YgeObSjTQ5CKokacYB0bdRMjzrPZF+VaX/qgLk29CDJJCxnYSmgGNSj1iQgyr2SjYLGYOHup5C6avNN7ZrOv9Mg8RptKq682EH1qs2dt5FR4p20wFZK0k/S9B3IS7ByquUKvy8MfdUMlbEq0NMZoNEm3iV47x1i4AHw1scB0Nr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750423727; c=relaxed/simple; bh=yVaxpPeFFP3rnQCIorHxvbBAoiiYM3mlDcF3kA5KISI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=A81cWTxvH1YPDFdwyTa7ASDiXAq6BPWZq4bolQp/EDMEUmnLWdLYhy2+AWIb0AGgR+xlKQ3g+Jv+FS2/cGJW56nXu8vwtywlm11LvRUTHP6xEP6TfaLRkcoqZRUwU1lEajufF6Ow+8EWP2GUtIpnNyo8jxYmh0ChqDZlFOEp2Bc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=XGU28bMd; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XGU28bMd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750423726; x=1781959726; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=yVaxpPeFFP3rnQCIorHxvbBAoiiYM3mlDcF3kA5KISI=; b=XGU28bMdhwZA2zwJF+8tgZ7kDn2eei16QzafYMPBxpaERO/XNWa3KNOa mOX2UiMxwTlDKi1qD0XRUIaSz1pew9E4YRGcX2sNWupCoOHdQwhPHAnxw JWaZt9QJ69B8VN48QjcRjOuYAcvbncCSK4xfkMaonrtOsks9NGhXHsocC R0SDfjkaouHzQdxibocvhxjmU+UMm1I50Cf7Gu201Hmiw4r6TUuoN0KGe XX6/N5cMvTCgKyvfajmKMWjYor5xNuxlKfPtT8CNNLNoafvCEbOFswn1I hFvlDzf6ja/HdFi1omOBZMY5RgNTiWaLF7tK8cE2RTmacTfJjZI8Av13T w==; X-CSE-ConnectionGUID: e7rT/RTjTTuVo4xi/uNUfA== X-CSE-MsgGUID: OkciWRStTyWQ0V81T3LQTw== X-IronPort-AV: E=McAfee;i="6800,10657,11469"; a="75216094" X-IronPort-AV: E=Sophos;i="6.16,251,1744095600"; d="scan'208";a="75216094" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2025 05:48:46 -0700 X-CSE-ConnectionGUID: GqSOpAUeQdGVI6bfIkq+Dg== X-CSE-MsgGUID: IXp2ib+DRKaj7ZWXPIsPmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,251,1744095600"; d="scan'208";a="155195275" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.124.247.1]) ([10.124.247.1]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2025 05:48:42 -0700 Message-ID: Date: Fri, 20 Jun 2025 20:48:39 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/3] TDX attestation support and GHCI fixup To: Paolo Bonzini Cc: "Kernel Mailing List, Linux" , kvm , Sean Christopherson , Rick Edgecombe , "Huang, Kai" , Adrian Hunter , reinette.chatre@intel.com, "Lindgren, Tony" , "Yamahata, Isaku" , Yan Zhao , mikko.ylinen@linux.intel.com, "Shutemov, Kirill" , "Yao, Jiewen" , Binbin Wu References: <20250619180159.187358-1-pbonzini@redhat.com> <3133d5e9-18d3-499a-a24d-170be7fb8357@intel.com> Content-Language: en-US From: Xiaoyao Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/20/2025 8:03 PM, Paolo Bonzini wrote: > Il ven 20 giu 2025, 03:30 Xiaoyao Li ha scritto: >> >> On 6/20/2025 2:01 AM, Paolo Bonzini wrote: >>> This is a refresh of Binbin's patches with a change to the userspace >>> API. I am consolidating everything into a single KVM_EXIT_TDX and >>> adding to the contract that userspace is free to ignore it *except* >>> for having to reenter the guest with KVM_RUN. >>> >>> If in the future this does not work, it should be possible to introduce >>> an opt-in interface. Hopefully that will not be necessary. >> >> For exit, I think KVM still needs to report which >> TDVMCALL leaf will exit to userspace, to differentiate between different >> KVMs. > > > The interface I chose is that KVM always exits, but it initializes the > output values such that userspace can leave them untouched for unknown > TDVMCALLs or unknown leaves. So there is no need for this. > > Querying kernel support of other services can be added later, but > unless the GHCI adds more input or output fields to TdVmCallInfo there > is no need to limit the userspace exit to leaf 1. I meant the case where KVM is going to support another optional TDVMCALL leaf in the future, e.g., SetEventNotifyInterrupt. At that time, userspace needs to differentiate between old KVM which only supports and new KVM which supports both and . - If it's old KVM, userspace should only set bit in GetTdVmCallInfo exit. If userspace sets in GetTdVmCallInfo exit and enumerate to TD guest, but it's wrong info since the KVM doesn't support and userspace won't get any chance to handle the guest call of - But if it's new KVM, userspace can bit in GetTdVmCallInfo exit and enumerate to TD guest. Anyway, its the future problem, there should be various options to handle it in the future. This series works for the current need. > > Paolo > >> >> But it's not a must for current since it exits to userspace >> from day 0. So that we can leave the report interface until KVM needs to >> support user exit of another TDVMCALL leaf. >> >>> Paolo >>> >>> Binbin Wu (3): >>> KVM: TDX: Add new TDVMCALL status code for unsupported subfuncs >>> KVM: TDX: Handle TDG.VP.VMCALL >>> KVM: TDX: Exit to userspace for GetTdVmCallInfo >>> >>> Documentation/virt/kvm/api.rst | 62 ++++++++++++++++++++++++- >>> arch/x86/include/asm/shared/tdx.h | 1 + >>> arch/x86/kvm/vmx/tdx.c | 77 ++++++++++++++++++++++++++++--- >>> include/uapi/linux/kvm.h | 22 +++++++++ >>> 4 files changed, 154 insertions(+), 8 deletions(-) >>> >> >