Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1327580lqb; Thu, 18 Apr 2024 06:55:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW+nkQq2SBXuZFcMp7enX2JeuD5xm/qAhvvS258E/6zQfcqA3zjHiFlsqokrDT+oqQooTkrVm2j6W8SUdK5hRnl49veK/UsIhXset71Cg== X-Google-Smtp-Source: AGHT+IFYpoi6ebluTBDEL1vxBq5CMerFnEeELXuP4m//6BLKQ/T+/51g8MdUTfio9fCxyO6Y7XaA X-Received: by 2002:a05:6122:169f:b0:4d8:797b:94d5 with SMTP id 31-20020a056122169f00b004d8797b94d5mr3130575vkl.3.1713448530986; Thu, 18 Apr 2024 06:55:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713448530; cv=pass; d=google.com; s=arc-20160816; b=weGqQ6p/tRLcTqmp+BYSiw/o6GCWDoT1o9hGRgyR+hbVLLzu3YioF3OcSm9f9h/vHX gKpXJwfKiLoUp+ZfIK93o0CJ3ARjCR8lX2hpsSmPjrhKRtwb+jMEUYqZcePvy4H/twYV Pd5w570qdHYJFjIYmT8TtT46B4jeehZ0pZGHJoWZ4W8xmOO64SXeWYlPCHbtUg/BM3AH XEjUrQfgay+X0aTpgo/5zM2H8oR70LVssW6f6hxrgX8I1KHy8SEgiDaKPz21kE0HOMn3 Y+rNjQJZL5/PJM7hP3H2CqT0ESD8UxOkRhs5kZ/nZOg147axzQS8ui47UguBNEw95Vwz l/Ug== 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=o/+75QgZV4f0klpWFP4/0bZufOK0370GQgPPVMYOfYQ=; fh=8scsGQn+hJ1HvbMI23kGOdGh/wtWpH4wdCi8Q1zCFc4=; b=1BjnXBXwuHuXJkYEMGmMtxkSOsANYJA2WNbuuwOMnfFCdhL0rcBBBbX1TLlHAxSx8u 4SLio95gd55BSl2cr8QvlY6YFWIjclue8Z+0PpITQxz7O2YQ6/baGYymBwAv8GvRdJLz yetWclqNHfWrVtthzwb9kf5d9fXmPQdRIwUqFpM3UuTdfMqS/9+ZH6Eug1mgSBSqnRC5 xpNoNk4k/wjuaHsXkEQZNME4jwMT4ixzGKEZBXeSoj+acg2gCZQA1ogMH5JNOwwWqV7R vQfIlPisyJ8y2C4eq7aRdO3AwN1AonpVeGdRY7O0m1lmDyCsDpui0kyISXT1sJPBgx29 R0ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dN93vxBl; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-150213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150213-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 oq15-20020a05620a610f00b0078edcb8ce38si1439204qkn.732.2024.04.18.06.55.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 06:55:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150213-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=dN93vxBl; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-150213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150213-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 93DFB1C23160 for ; Thu, 18 Apr 2024 13:55:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2BE3165FC9; Thu, 18 Apr 2024 13:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dN93vxBl" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 C726C165FB6; Thu, 18 Apr 2024 13:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713448493; cv=none; b=eItGK2bO/rBmkC5HPo7lvczvAnvWXgtbTfGWSKpSK5woFAgCKWIJPvf2RjuOEjYFPUfl0c3kYnI3RTFDc7y7FO7YPUkfNlK4eLWfqELs6e5OqUuSAXjbHFYXHep7Y6JSZZotf3s6HeJi02T6Oz1CEpwMx7LMdDdXvYMAs1ATQWw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713448493; c=relaxed/simple; bh=g94a7qkSkn65haHDm+CsriRsABmH8NJg5ir3bpPXwj4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DSH9+adRehAEzG1QEuTQEy7dSqH21my/x0PQaSn7IJ32NkMt2Kem9YDSUQE2yD0TxEEafFY0qbzcpTn4ytarJ+8/VXgPZW6OfysSP7wLpqVEi2ib7MNMfIZnzqOXXNclmly5ycEJYJP85zABZ7Sb5olpLPOkHhcH5cq/iQ9OBCw= 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=dN93vxBl; arc=none smtp.client-ip=198.175.65.10 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=1713448492; x=1744984492; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=g94a7qkSkn65haHDm+CsriRsABmH8NJg5ir3bpPXwj4=; b=dN93vxBlEdrFsDUyYjUE60T8DftfDjo9oLnZQBzhR9tULVbQUGx0fms8 tbvkm+AeP1Wdd/kg7R0T7iXQN3emQQ2P14it4yICCFRgvkmWaMxAv3b0E BvOtlBNeOlwYIsL4JP+4aLt6djQzzSu2SWtATY+uB3T28V//m4Qwx0+r5 D8sVclIczYvrchQrRsE4Fv3qS8fArSksQRj81f5e9QsaMfsF6UEESH7g0 simGfcypCWtUYuMYn5gK6hOxLmobwYhFV+vWmumIjYxg4HN+2LvOwZ+s4 FamFlqLEFmE9o/usclPfo01ukFD1NizJn2Zq4VA5QsIEnSw7oLqeakOCS w==; X-CSE-ConnectionGUID: s/wVNknUSUyvVQtklyQCqg== X-CSE-MsgGUID: mle7J87DTViRTFnwGpchjA== X-IronPort-AV: E=McAfee;i="6600,9927,11047"; a="26453883" X-IronPort-AV: E=Sophos;i="6.07,212,1708416000"; d="scan'208";a="26453883" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2024 06:54:51 -0700 X-CSE-ConnectionGUID: N9VOFXmTRCmiZ4OALNBa7Q== X-CSE-MsgGUID: LE/rr+LnRaaDedMot6OSVA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,212,1708416000"; d="scan'208";a="27428787" Received: from binbinwu-mobl.ccr.corp.intel.com (HELO [10.124.236.140]) ([10.124.236.140]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2024 06:54:42 -0700 Message-ID: Date: Thu, 18 Apr 2024 21:54: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 v19 111/130] KVM: TDX: Implement callbacks for MSR operations for TDX To: isaku.yamahata@intel.com 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 References: <62f8890cb90e49a3e0b0d5946318c0267b80c540.1708933498.git.isaku.yamahata@intel.com> From: Binbin Wu In-Reply-To: <62f8890cb90e49a3e0b0d5946318c0267b80c540.1708933498.git.isaku.yamahata@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/26/2024 4:26 PM, isaku.yamahata@intel.com wrote: > From: Isaku Yamahata > > Implements set_msr/get_msr/has_emulated_msr methods for TDX to handle > hypercall from guest TD for paravirtualized rdmsr and wrmsr. The TDX > module virtualizes MSRs. For some MSRs, it injects #VE to the guest TD > upon RDMSR or WRMSR. The exact list of such MSRs are defined in the spec. > > Upon #VE, the guest TD may execute hypercalls, > TDG.VP.VMCALL and TDG.VP.VMCALL, > which are defined in GHCI (Guest-Host Communication Interface) so that the > host VMM (e.g. KVM) can virtualize the MSRs. > > There are three classes of MSRs virtualization. > - non-configurable: TDX module directly virtualizes it. VMM can't > configure. the value set by KVM_SET_MSR_INDEX_LIST is ignored. There is no KVM_SET_MSR_INDEX_LIST in current kvm code. Do you mean KVM_SET_MSRS? > - configurable: TDX module directly virtualizes it. VMM can configure at > the VM creation time. The value set by KVM_SET_MSR_INDEX_LIST is used. > - #VE case > Guest TD would issue TDG.VP.VMCALL and > VMM handles the MSR hypercall. The value set by KVM_SET_MSR_INDEX_LIST > is used. >