Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp1033912lqh; Fri, 29 Mar 2024 05:27:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4mKqTIWX4QnSpSnbOFeVGb6hA1rjYyX5eKT+TjRwh9e8G7NingFRQs9PRHMW/PfcfO2dAJNyxMkmuKqfPwLqtxyDWDuYkX9qWXUCZ/w== X-Google-Smtp-Source: AGHT+IEJZRLWpJzRz0+3v/2cTSJhJX1c3JAYwfqPRtgjMWyjQ2IuxdvfAFSI8AsC0N5gEL7TVDTf X-Received: by 2002:a17:906:6092:b0:a4e:15f9:f167 with SMTP id t18-20020a170906609200b00a4e15f9f167mr1256045ejj.11.1711715223883; Fri, 29 Mar 2024 05:27:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711715223; cv=pass; d=google.com; s=arc-20160816; b=uBAhKyc96bdsDVoxIeGd8mzaja2dcw/DAMZhP1nC43MGBHhihmSbRNHtCLpAC6Xjk3 TFualEuYbqodiz0hLgKcZtidgcpcrMq0+xvo4g/AL0u93ZoA7RxLscfFL9rHxxiOGuV7 aYtnBiaeE5Hh46vNmPogIWc/CwD7xfeWs4GcDFw0w0t9sQpB9yx0P/uZUXqAyv8qJxWC ze37CJyzC+wWVpSS40hlBYeUIrQNhWO4sJucxv2LTJ0Kfsr5yyXDVbBr6LppQvH4zk+4 0ibfKnC0KUl8/10iP+LwDIuSKmlj35J87KpIY+XK148LeiA0B5GA0UDoIhr84GpRspNX pc9Q== 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=S7UPCBs5/mUTODl8mMm8CEhAymLLpIF0/7NM5hWNJPg=; fh=axVZgUd/khiJrBbFv0Pz79iaKsOdXUjSRKQnB7ejtQ0=; b=r+JEEg1HpUa6rxaJ/kOo8ZBUHBw7DVZ8OzL01ZbpPMtH9yRU46tnOxCrYySXzn/c/0 KS/smiel/dW0Y0u5b3vOM0pnwMAUC+ip1r4W2UXe87UP9jEs9seEFFxLzlFv25aD3AQQ 8l8YxK5c02t01/LOx4vWSYI0KgV6zhFBPrJ32Wx+gSdGyQMfx5x6HUF1Wrbl10g3MulD ZZZ3OwT/bbX/i+gakGCwd8h08Skq6SDGf6rSMiNuZEhETi48njDEEGRZLtmZat6wAJpF bRuCC12hmHRnikaILp7A5uMhsoYuZTyZAQoHb1akHQQvkzoobizrC/6Vfe0TJYQ7MqHA nHAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F2lNdD50; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-124196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124196-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 v11-20020a17090606cb00b00a474a49031esi1747561ejb.316.2024.03.29.05.27.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 05:27:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124196-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=F2lNdD50; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-124196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124196-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 1AF8A1F22F7B for ; Fri, 29 Mar 2024 06:22:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CB523FE44; Fri, 29 Mar 2024 06:22:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="F2lNdD50" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 EB3DB3F9D2; Fri, 29 Mar 2024 06:22:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711693340; cv=none; b=VKb9jZPYFnX7GYTQx6MnR9PhITp0r2RgTMQsnz1mK2LgXqv8rwgk4nhpDYKkRJV0TvCQrSpZ0LvxB/yynlw3Pv9D2YMaiz4T5tO0+7zupd5+erivdQHbKuStMJvJfn7SRgAxhRctM+0TX14450tJKZ451L6MfbXMRTWe8PLiUGw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711693340; c=relaxed/simple; bh=qqijB1DYYP8h60w+Z5syxz5vz3KMKyQUPWPlyBOGC7M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qMM4ksJCE+1xp8AoKp+BZ3ykvbDB7y1YlzsMg//BwRUYSYuO+BLrzrmWd7Oma5YOuJn486HWFH+Ru5c6ryeNNzylIB0KvGsGZxF01SXW4fEtC32XzjVLSWyhOqRApxZwF0MQ3P3Z9U7H4TT6ZgJHmPOTuzTlf8BE3LHV/+0K0nM= 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=F2lNdD50; arc=none smtp.client-ip=192.198.163.12 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=1711693339; x=1743229339; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=qqijB1DYYP8h60w+Z5syxz5vz3KMKyQUPWPlyBOGC7M=; b=F2lNdD50QwHYi43qCM0C0kbLWJ/13EarTAaouT9qJuHox+Ns+r8y16dR YSPBXzgsUxh/Au9s6cAUDjdv9WEKXRpgmXmYVt2KKNtVG75ayrU+YIvv3 dU3+gncj2iPcmc0XDHrvpdkhGUhqndi9rJWmixQf8WsRCus5wt0jN/mA6 EYXpTWiSohVOmDMZDqzpfb39o0tAmmTpMNyxxKpBT88GA1IaVoaYSwiJM 3VqJulB04ZN46igdcecnR6BP8YwPHGzHDMNrpUdXtqJm6D7m1uGYlTj9A oxaOlxJMbZLaQyH5Vk+2clAyn8hh7AhoRxtc7HRmJ7q+LnVKsG0t1nqmS Q==; X-CSE-ConnectionGUID: Rv+gWfS3SB2ns6iTu8rQug== X-CSE-MsgGUID: 3dr3UbaaT5efevOpuARAkQ== X-IronPort-AV: E=McAfee;i="6600,9927,11027"; a="10663142" X-IronPort-AV: E=Sophos;i="6.07,164,1708416000"; d="scan'208";a="10663142" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2024 23:22:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,164,1708416000"; d="scan'208";a="54345229" Received: from binbinwu-mobl.ccr.corp.intel.com (HELO [10.238.10.225]) ([10.238.10.225]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2024 23:22:15 -0700 Message-ID: Date: Fri, 29 Mar 2024 14:22:12 +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 038/130] KVM: TDX: create/destroy VM structure 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, Sean Christopherson , isaku.yamahata@linux.intel.com References: <7a508f88e8c8b5199da85b7a9959882ddf390796.1708933498.git.isaku.yamahata@intel.com> <20240321141709.GK1994522@ls.amr.corp.intel.com> From: Binbin Wu In-Reply-To: <20240321141709.GK1994522@ls.amr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/21/2024 10:17 PM, Isaku Yamahata wrote: > On Wed, Mar 20, 2024 at 01:12:01PM +0800, > Chao Gao wrote: > >>> config KVM_SW_PROTECTED_VM >>> bool "Enable support for KVM software-protected VMs" >>> - depends on EXPERT This change is not needed, right? Since you intended to use KVM_GENERIC_PRIVATE_MEM, not KVM_SW_PROTECTED_VM. >>> depends on KVM && X86_64 >>> select KVM_GENERIC_PRIVATE_MEM >>> help >>> @@ -89,6 +88,8 @@ config KVM_SW_PROTECTED_VM >>> config KVM_INTEL >>> tristate "KVM for Intel (and compatible) processors support" >>> depends on KVM && IA32_FEAT_CTL >>> + select KVM_SW_PROTECTED_VM if INTEL_TDX_HOST >> why does INTEL_TDX_HOST select KVM_SW_PROTECTED_VM? > I wanted KVM_GENERIC_PRIVATE_MEM. Ah, we should do > > select KKVM_GENERIC_PRIVATE_MEM if INTEL_TDX_HOST > > >>> + select KVM_GENERIC_MEMORY_ATTRIBUTES if INTEL_TDX_HOST >>> help >>> .vcpu_precreate = vmx_vcpu_precreate, >>> .vcpu_create = vmx_vcpu_create, >> [...]