Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1507183rbb; Mon, 26 Feb 2024 11:25:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVHJqzhg2u8EDOnPc+AUncPFDfmKH5QPFlKVdOrCRzWHLRyGimLUkC4o6gu4P+7U8UKmqc3kpWXY0ko9VFEtZf+gfwe3c+NtW4xi+pyPA== X-Google-Smtp-Source: AGHT+IGesV3A/b0znovpT3iwILVJGZJ0KNfCyOhSld6oDnR1a+ZuR+49HJnrcyV0MLCdxI3472N1 X-Received: by 2002:a05:6a21:3182:b0:1a0:5de4:2f53 with SMTP id za2-20020a056a21318200b001a05de42f53mr44273pzb.25.1708975508971; Mon, 26 Feb 2024 11:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708975508; cv=pass; d=google.com; s=arc-20160816; b=CuAFECmdodypAdRLt8LM6AncZvygqVbCyKlvEnAf7Rx9GIUULY9RYGhz+5EZDDBRBE XU7ltYHnfU2cJgiCCZ9IkyrId2k4DwBhL/a/XMoZvTb1UzofyPCARgMIze6amQpZbEXB 6KMpKgMKTYfJyVEXWgc/qElBSWXdtx1lk2xHdBjc6xFO8OfPdTXO7TK5kckdPPSig2Bj zePsS/7iPJQ2Xwvgfea6TNEjnZ6f4c/6jO0jafKWkeUEZWm0g5kf3RXALaHq+teiIKgX XS49cPL6S7vMdYXsgdWZMdviaL4E1o/KcN4tktTFAtL2JgUQD7rFCRm6opn6dvyAr3J0 cZfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=B4QYRIDIkTP9y0GeuekTw7DU8X474jBxJwscVFyVFYs=; fh=P/quV/w7uXmndbL78FtEpLTNkJRPx4LJS51PzREvtL8=; b=OHBYJC3LzFucZs1XBleCnSZWw864iLodhGZhSl5h+rGAD2UjR41LTkjXSvsV2Mag4z meXe9aWEFc2tLFIDQs/8Wxd9dcg3dtZOSOZHEL/9j7FdSOzMy/e6QLFwnof+31M5A5ZU KOZynGXdDRNO0/+Sp2MPmaQt0iIlS/+z+VFIz1kA7E0mt6T2nckZmiKK376rSPqEuktP DOCbIt8CzYvmb5rHDdzI6q1z2PALY9WHBv5c1cwg4mmQYDga6z1jEgXF5rN6fBCXTgzz +oKLt4uRFtMWaeIq2K0QI4gaTFUEc3mDus3iEjebE1Dt57o/yo918EqXVuMNbYr2Cq05 QNYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="THe8MFa/"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82236-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82236-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r12-20020a6560cc000000b005e2b1e8547csi4072381pgv.367.2024.02.26.11.25.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 11:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82236-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="THe8MFa/"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-82236-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82236-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AAF1D298447 for ; Mon, 26 Feb 2024 19:25:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0F4612F5A4; Mon, 26 Feb 2024 19:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="THe8MFa/" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 1859412FF9C; Mon, 26 Feb 2024 19:24:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708975482; cv=none; b=Il/1JbW3pQsjBV1APGvq5fGVcpQaJ1l3vrJ/AOoxnHB692VcY2dpLSesKNmqezYZSGA7GPBO5QDe+XpQ0F/bYSnjavlBIKUDtcPiZr2jtl68BAaGZ/O94GYJzDryjTVdG6ujpWx1dlo+LoXQbJNw1uQVNj53Xxy1+rmu9lYi1CU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708975482; c=relaxed/simple; bh=F+4pOhLAnZ9k3/aMMqmEmpPKb8aYtX5vG0b6hRqOXac=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZNoyzLNWc++rAEYOmGZ4jFDGknvxrA1zRLVzw6pJO75PR0omDG0heL+MUwiiH4FOU7aCyUg41iRxg7+SBphmHprpE5b2MEkwUlCKT0emOAWjGgQpksY/K+9iv+kWgVW17ri/vWu0gdMigumw+1oSGHHYNwb88ggl9FSe1wT9sOw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=THe8MFa/; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708975481; x=1740511481; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=F+4pOhLAnZ9k3/aMMqmEmpPKb8aYtX5vG0b6hRqOXac=; b=THe8MFa/n3CkN2TG52UyKs3ZM7fRsQou6ZozdMwzCzI3y0JglHGXQlyI JpYy+s+J11MG1GJgZkAnyK7x/ETF0gJd+nvPAJ4FlZyUEfyleaApJf40i tjbJwSFCbIMYeiCRXu9Jy5gkjwU8DE3unVVdzehz9xMFgDy6XSF4Rr8MF Aqt9MSWPoXb6C+INpQ74BapC1OkuFlmVLMSo8wPzafCOXFX+raR6ZMzQo VzKu92ZWJGKgwF6H1XRh0YuCBix/LGUNlPuVeu7oAbRyBZgsb/KuBWYMx bDMb7XqQ9uMwKQylUCcSagw2YT4A7ZFL4Vc5trh8q5GVe9wXyUyW4HGyQ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="3131478" X-IronPort-AV: E=Sophos;i="6.06,186,1705392000"; d="scan'208";a="3131478" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 11:24:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,186,1705392000"; d="scan'208";a="11399075" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 11:24:40 -0800 Date: Mon, 26 Feb 2024 11:24:39 -0800 From: Isaku Yamahata To: Binbin Wu Cc: isaku.yamahata@intel.com, 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 Subject: Re: [PATCH v18 071/121] KVM: TDX: restore user ret MSRs Message-ID: <20240226192439.GR177224@ls.amr.corp.intel.com> References: <65e96a61c497c78b41fa670e20fbeb3593f56bfe.1705965635.git.isaku.yamahata@intel.com> <3ac7bcfc-ea22-43b5-b8ba-d87830637d4d@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3ac7bcfc-ea22-43b5-b8ba-d87830637d4d@linux.intel.com> On Tue, Feb 20, 2024 at 05:14:02PM +0800, Binbin Wu wrote: > > @@ -1936,6 +1959,26 @@ int __init tdx_hardware_setup(struct kvm_x86_ops *x86_ops) > > return -EINVAL; > > } > > + for (i = 0; i < ARRAY_SIZE(tdx_uret_msrs); i++) { > > + /* > > + * Here it checks if MSRs (tdx_uret_msrs) can be saved/restored > > + * before returning to user space. > > + * > > + * this_cpu_ptr(user_return_msrs)->registered isn't checked > > + * because the registration is done at vcpu runtime by > > + * kvm_set_user_return_msr(). > > For tdx, it's done by kvm_user_return_update_cache(), right? Right, fixed the comment. -- Isaku Yamahata