Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1780903lqb; Sun, 26 May 2024 17:57:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrug7HKAIvUgKaXclzRpjHxnkvFhaeKak4vaEYtTmNZkilwIHKbeKdRsVPavjw69LSXF27CM2nCkoj7OblWT6F8Xbl1KYKjnqbd4M0xw== X-Google-Smtp-Source: AGHT+IGDPqwNfxYajkCj4o3JxkLaysjcMyW+i/t4gdf5mwqqRfUmw09dSyKdmo7e16Lv4VGIIbgY X-Received: by 2002:a05:6214:3101:b0:6aa:7bd5:8b8f with SMTP id 6a1803df08f44-6abcd0b505cmr91485476d6.49.1716771466069; Sun, 26 May 2024 17:57:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716771466; cv=pass; d=google.com; s=arc-20160816; b=EnbTSnYV8w6pmp+ddvMbTHKY6J69/UEnSZre9RU8FNe1X1JeXA+2LLgRJaZiwb3GlL RoaiyMkTCy7+/uolIo9BZ+PIw6/6EMMXQ79I122q0eNhYcGI9lGoJZdyA3uKWX4GMdjv PIlE8OjqZQRJjHo/6ygyQ6NkcUU5zf5JOr1CAblKAAcYnlDkpphvnvG9CnSGM1rmIDf7 nzN5yVz9KoYPbU1QWkFcZefuaZjndm7K4iAti3+wzCjsLRsjs4Aq2jTgGVXCIlNvEbTK 2JXfxqVhOo0fvLS+rqZMTk0QONbwY8Qk9SINDG5sRs2H5rxhhPSyukadc0Rg2l1TDwr1 n9cA== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=9TJXQEgXuSIjkwaHea1/fufkzO0BeR6z1u2VnoYzruI=; fh=86UNoklA0wJc5PvtUFXTqJGrF0Ihn4MZ0ZyL43rPdOc=; b=y1PAYJ4La/i3hMJ/01DpLCYjDMyj7lay3Edg9s9Sgh6Q7xmBEQMotdiLJMua35/y3I v/77dpWKzTVNtUbH31woEsNiUAAHn1fsUQRtLL8mouaC5frtQd824PcTmK1qBhxjrj8n it3VLa4KkMieCY2nCeuMY9+J4F0utfLYMt1jwCf2A4mZmbjVyso2a9HoxBChx/w49h0a PRxRFUUYTDMBZIf78icWSrMVQq+ZsoeJXTIiLjD1nlU/WkdpMKCKG49eGBmkwgsqc/NM 7ZzRtVgELMQ+qcnOyomWW+cu7H4sUyWrjE7bTT8vJxTaKDG1KfSv04AuPjj+rwk3S4vx P9tg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nSBEmYo7; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-189922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac06f502f1si71217606d6.18.2024.05.26.17.57.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 17:57:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nSBEmYo7; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-189922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189922-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C64651C20ACD for ; Mon, 27 May 2024 00:57:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F09F52CA9; Mon, 27 May 2024 00:57:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nSBEmYo7" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 2D81E64D; Mon, 27 May 2024 00:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716771457; cv=none; b=bJ1Fxrp6F0lLVmZrBGnAqf/rBYHtiwHs1VqjHmM7g0Aoa5DJpglOVYQBhvxNbF3LjJXYELhOS0dp2XX7DLpStrdwoBhF7ldPZmP7kATVEVKMkmK5mLz5DvDXxFo4rc/RJBFkR06fq2KsEnFzv9PwhD2lbG3LxucoZYg/kLP/JVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716771457; c=relaxed/simple; bh=rsK1IsML/UxFu1xXGLPPqKz0eHkBTwAPomJ3dUFEjqk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Yu3LfPZoI8CDsP74ATuAnhQmTWIwSkaRRDktW5acIhJpQPoRtR4LGQWVXsk9fccjLZHd9zVzxLl2VUhM/NGbysl0H/CR2MLbGEjXxrCmdKUObine4Wyo/M2sySik5lJ9F3xot4RUCLbL5c2KUHarnMhwLPlfP9aB4lz7zU0hJws= 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=nSBEmYo7; arc=none smtp.client-ip=192.198.163.8 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=1716771455; x=1748307455; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=rsK1IsML/UxFu1xXGLPPqKz0eHkBTwAPomJ3dUFEjqk=; b=nSBEmYo7d7zbnXPcgUAUYgto3cMUZrZW8kjLUaRAcqJp32EdNgXksCUg o/8iUmi5raQKl7tHZAmmc8lpn7E1uMXv9YdCqneo+q52KBM8IFnFRE+py XZc7lz0YHyvU8k6+uc2GnWBcjZy++CV6i/1qVJKC724oCowvDINr1CbBi 3rPKZzBkEVc5wivme7wMuImHOGyPhdo+7YU3i1hMLWM+M8nJiZddCCkYv VEnJtEKpGvFFlc85wRZIhLW5eVc4R0hlhHMTUs9UbyqpUpXvFaORgJf// yUdNQ+/cE1vI66Q+ynnan8SCGVEg5cm/BCZECh+dWXajEcHfCEAGRaoNo g==; X-CSE-ConnectionGUID: Lm5m4kXsQ423fiQbQh1/4A== X-CSE-MsgGUID: HUF8mqFGTjq3mnhxW3FI7A== X-IronPort-AV: E=McAfee;i="6600,9927,11084"; a="30598555" X-IronPort-AV: E=Sophos;i="6.08,191,1712646000"; d="scan'208";a="30598555" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2024 17:57:34 -0700 X-CSE-ConnectionGUID: FRvCXjwUSQW/K585oeZSCw== X-CSE-MsgGUID: lYDdnMVtSFGieYRfZHKRzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,191,1712646000"; d="scan'208";a="34503825" Received: from unknown (HELO [10.238.8.173]) ([10.238.8.173]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2024 17:57:30 -0700 Message-ID: <6a7b865f-9513-4dd2-9aff-e8f19dea6d90@linux.intel.com> Date: Mon, 27 May 2024 08:57:28 +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 , Paolo Bonzini , Sean Christopherson Cc: Chao Gao , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, erdemaktas@google.com, 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> <8d489a08-784b-410d-8714-3c0ffc8dfb39@linux.intel.com> <20240417070240.GF3039520@ls.amr.corp.intel.com> Content-Language: en-US From: Binbin Wu In-Reply-To: <20240417070240.GF3039520@ls.amr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/17/2024 3:02 PM, Isaku Yamahata wrote: > On Wed, Apr 17, 2024 at 02:16:57PM +0800, > Binbin Wu wrote: > >> >> 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? > That's right. We should update kvm_vm_ioctl_check_extension() and > kvm_vcpu_ioctl_enable_cap(). I didn't pay attention to them. Currently, QEMU checks the capabilities for Hyper-v/Xen via kvm_check_extension(), which is the global version. Only modifications in KVM can't hide these capabilities. It needs userspace to use VM or vCPU version to check the capabilities for Hyper-v and Xen. Is it a change of ABI when the old global version is still workable, but userspace switches to use VM/vCPU version to check capabilities for Hyper-v and Xen? Are there objections if both QEMU and KVM are modified in order to hide Hyper-v/Xen capabilities for TDX?