Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp474023lqb; Wed, 17 Apr 2024 01:46:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7WmZ7pzfv1w8hZ97SrTmj19DFD3srlyuOS6pYeCHW/jaOonFl7WcznB3rHrL/nIhy+CRc9fvZWFXnJrDvRJ1a5cOmMeyzlvMVafnSMA== X-Google-Smtp-Source: AGHT+IEx1i1QViGSLGfxX09EIb1hvz2hCvzfsMfeJvmgKduIK3g64zZseTx+MXQAT26+h2w4Q2w3 X-Received: by 2002:a50:a456:0:b0:570:374:e59e with SMTP id v22-20020a50a456000000b005700374e59emr8568539edb.5.1713343602746; Wed, 17 Apr 2024 01:46:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713343602; cv=pass; d=google.com; s=arc-20160816; b=nWQYZUGD46nGYTTDT6G1+2dNDaq7aMEDImMNHVWd5g3JuyLkBwmeThy2xqTaYlojvp jLIe1tsvnu489103ydCbyqvsht1hM/nrgblH6SiqE4t2z6YM2M+pKqSR2YKSBy1ql2hK sTfkLYt/wcMoVnxBoQNfBxubmTge90KTmR1eXjqPsiCKaG8gWunFQJo7ThDvL63KD9um lnAbEMZb8+CLcFBjD7POzBpzeYQItcK0Pt8hqa7MOIhQ9CS9ZF6U1foV845wjpgbxQDv qgXWb5J5BE71pV5fgoHdCo+pP37svKTJnZVsaUc2pSDKrs5/0gygLzbJPyjUkN7Owu0x WJ1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=WDT/1KjKKcYWYwkV1wG28kUJqDKGddof3lWVK/vwmtA=; fh=hPr9UsQ01gPKCz4S2m0Yg48dRlZVm0Ad7UDt7Xyxfv8=; b=eHjuUkj7VMHpg4Z52+PMHVWRvDK6qv1z0ZFBPlSbSnjyhyrTEBkfR81VfGE2CHuhLB R+lx4ngzm9Su/Wc/bFhZCkQQlh/mAqdKFk839jIIzOE+FQfXac/I5IPY2ycpCk8L1kki sDOqD0O/Qt/jOhrFKrPzPAOQSlHU2C6j1MEacN8YeM0tRwUD9XbshNT3Xswjv4zV1si+ fovxMIALHkDaV7OcNVE1P2OJoEyD9qzP4O/Ww7OyC8BHbqrrgdJ0cv6KMdlF4ZZIS4rp D051YQb2VMGjRRPYqwXcAyKgGNXr0q8NF5wejRyuRRvyKr5b8LtaSaJSN7/ZUgQ2u/Tw GbwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F+xTBtPK; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-147987-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g15-20020a056402320f00b00570c4908beasi87194eda.643.2024.04.17.01.46.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 01:46:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147987-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F+xTBtPK; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-147987-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0D6C61F22501 for ; Wed, 17 Apr 2024 06:17:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80FC664CF6; Wed, 17 Apr 2024 06:17:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="F+xTBtPK" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 C189E53807; Wed, 17 Apr 2024 06:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713334625; cv=none; b=MPAYz4/oKypK9fJI2dEC8J2H+r6siTEZFDFm+UzfV1JdwpXH6RXKgoEAfAbSHdvwcNIltPakgq9eRidp1mPEo8LOl0fNe03D50uhlyEkSak0U+Orzfv/p34yFLzmuVxNp74M6kQaMb/tghlr+uPUjySh4wZcKzhwxD31b86czr0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713334625; c=relaxed/simple; bh=0J1Qe7V2WFO72quDvEDPSDcrlOlYGUy9Qip9dj5vZ0A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MWWKxuSbvqpBdhkILCdabyRHM9Zivr+u62gGr04JMOtyOmPXYVrMC51xtWPGBhOWAKnEElnS58BkcJXQoFWkPbkxWdtkxedCNGe6+BAk0AItVkTZLXnBC80pA5ZbeWTiAc7ES8aBOfNVe0HEfaxQPw5gBskJnNWoXINtQ/tJ2nM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=F+xTBtPK; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713334624; x=1744870624; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=0J1Qe7V2WFO72quDvEDPSDcrlOlYGUy9Qip9dj5vZ0A=; b=F+xTBtPKej9gUIWZBq1uDBphLsSGef1Kz8Ks7nLv/McC/GMjNP39CC/s fwTd4QDV52YmwMpT6X4Y47jY9DjbOlMGqspUD94bXo1vlMnlmH2fpdHX2 6Ua6Xw2iwxrK9m2UgjIfZZQ25FHnQ+do37Jzt90wBTOUX023y7tokxdgG xHc2ZdnuSMLWzSrFx45xfDGf02qfbKZEXtHgAGEKU2pUQmnE79Op9JbPN LAmXJWNG2ZCpgROwbMz8YH8qWgS8mjZb8SpLZLrwwGwBsDLOrDDqI8wiE 57qlJc2sHaeel0KOjfh3PIFBoaFWESW856gkJ90fp8qbQTcvBLJN1xqyV A==; X-CSE-ConnectionGUID: 8QkL/u5VQsujHOhCPkUxQQ== X-CSE-MsgGUID: kL25jsnhTz25lXWnkzGoCg== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="11750832" X-IronPort-AV: E=Sophos;i="6.07,208,1708416000"; d="scan'208";a="11750832" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 23:17:03 -0700 X-CSE-ConnectionGUID: Sw/+0tTkSwORlNrgJa1Iww== X-CSE-MsgGUID: /Xo3zss/RYenwmYmBg/J+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,208,1708416000"; d="scan'208";a="59932999" Received: from unknown (HELO [10.238.13.36]) ([10.238.13.36]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 23:16:59 -0700 Message-ID: <8d489a08-784b-410d-8714-3c0ffc8dfb39@linux.intel.com> Date: Wed, 17 Apr 2024 14:16:57 +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 v19 105/130] KVM: TDX: handle KVM hypercall with TDG.VP.VMCALL To: Isaku Yamahata , Chao Gao Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , Kai Huang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com, isaku.yamahata@linux.intel.com References: <20240404012726.GP2444378@ls.amr.corp.intel.com> From: Binbin Wu In-Reply-To: <20240404012726.GP2444378@ls.amr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/4/2024 9:27 AM, Isaku Yamahata wrote: > On Tue, Apr 02, 2024 at 04:52:46PM +0800, > Chao Gao wrote: > >>> +static int tdx_emulate_vmcall(struct kvm_vcpu *vcpu) >>> +{ >>> + unsigned long nr, a0, a1, a2, a3, ret; >>> + >> do you need to emulate xen/hyper-v hypercalls here? > > No. kvm_emulate_hypercall() handles xen/hyper-v hypercalls, > __kvm_emulate_hypercall() doesn't. So for TDX, kvm doesn't support xen/hyper-v, right? Then, should KVM_CAP_XEN_HVM and KVM_CAP_HYPERV be filtered out for TDX? > >> Nothing tells userspace that xen/hyper-v hypercalls are not supported and >> so userspace may expose related CPUID leafs to TD guests. >>