Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1506292rbb; Mon, 26 Feb 2024 11:22:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUGbR4JN0jbBvDFG3lGpPVFNFdrw6C1BMpI3mdM2Mxqyy3M6YVCd1XjN8R4MAl3nITCdZ0wF3GisKD1vQ0jVyvtJH/Ggkn2fN26PWvbNA== X-Google-Smtp-Source: AGHT+IEIUTVBht0qVDQ4JY1cZG/o9EOBbKNHFgNhARbz49UEGrzxjWbYwUT8e3OTwuqysVvSQGN2 X-Received: by 2002:a17:906:ac8:b0:a43:9693:e3b2 with SMTP id z8-20020a1709060ac800b00a439693e3b2mr486795ejf.41.1708975376946; Mon, 26 Feb 2024 11:22:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708975376; cv=pass; d=google.com; s=arc-20160816; b=KU9mLuAcsyvlN6+iHyNfdH/rj5dGp0ktcWfIKfzYW5U9eaKcFA95QxCe8FhtGeHajT aZX5LKswUbRZQMU9W20OTQL6/reo3sLfdcHdsDz1uCrDqGPYSaep7wqhs9g8eE4jHFVY jae0VT959WHP+rAmKLMGbjM0grHJebo31bzc097KYXjPqXGbiOeiJrKB9+9NOsgR1/gu U7KfagKatQDFCx4MOA+BbZd4iodoOM66besEdsepQz5V5HGcygPSljtgkk34ZSOPur5Q DtU90saq8DzthustX46HGhvfnZjX1H7LBnHB7V91NLeGCvchPDlZyeoMN+eNjGm0ksZQ e32w== 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=OCL4jj2baA3TAm14Dp7bqa9M5hn6GL4rGWlhpOZLsVU=; fh=P/quV/w7uXmndbL78FtEpLTNkJRPx4LJS51PzREvtL8=; b=rlcwzAb/uHEoQyn/Kz4xiMQdXApz1mz6+7yMoVdaE2c2SSVTVQn3r+OZUNPaiVhwJN U1bJ7bzSXUFVPny37Kckk6Q7uKEbi6UExIU6T1anFcaR2uvdWtfgLM11y8lQQCfapRsV gZWT1G04jzAad+YYsNwdPdqfYps253/paUE65eSDw/66ZTrJA48Nuz3JJ/4YmcmdoypR MIgo8tCfrjyhtr6Yv9MzQz4+p/MnAcegfT+MxsHFtdLrB7QVLSVWMaGnPjf7lPIziwyy 5jIgo0nBPpbENHhlgI631xZFzrj8mW+2X/qpvZoZ1OaokYvoU5tq9nIvWS4C1ElUBFFS 9d7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XDXGrffo; 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-82232-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82232-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c10-20020a170906528a00b00a3f10675a85si37295ejm.97.2024.02.26.11.22.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 11:22:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82232-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XDXGrffo; 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-82232-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82232-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 AE9F51F251AD for ; Mon, 26 Feb 2024 19:22:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA16912FB0A; Mon, 26 Feb 2024 19:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XDXGrffo" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 5A53612F586; Mon, 26 Feb 2024 19:22:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708975353; cv=none; b=EzMuPpklCaCGp0ouEc7TT8ZxBi7N1NzDxL9e0GCiKE3hpk1OBBSNLm/m9HqEia8MFnJ4Va19I7BSQeuvPrUyYoRJ+XmTXy2B8oZaV3PcBdh1uSh1nmqOSIX8gOD34/s4rjB5ml03NBcPFvY00z9m7KzyU25Cvh8rLBnqpJw7XNw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708975353; c=relaxed/simple; bh=FqFNb4x/x8qbqyzr7+3dDomy9topMozI5OvKyn3dnFg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=As7R28CjDofQouy3yn7Sukdg1hf4oVmeYNnTJ3NrZl/7w+I71MHUGt4klqyapNWiOwVvOcWOST55a93IkeHIEindjaLkSgxHug5bRkuwFXGnmve0DV3fCOJTL/UDM6htVteu3IlzNFNDx6F/rdTS8fDg40a0H2LyC5h9WbfRGqQ= 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=XDXGrffo; arc=none smtp.client-ip=198.175.65.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=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=1708975352; x=1740511352; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=FqFNb4x/x8qbqyzr7+3dDomy9topMozI5OvKyn3dnFg=; b=XDXGrffox5NmD0a0frbMlImf5lOCLusfq2JscRxcZp8jJdmitUFJQxFK YGnVWjcEWkT8CUlWpdQV0krCHdjYFeBXjV9pFz/HA0+IpHN5Pk+KtjGkL aoW5Aztyvusm/qNkrRIC/aeG+fMlga8sASRRLAvZN8HaAMyquDoeOhKc8 XnUCpLMBMvJ8p5e1VfADKfUwfYUQKwAEQE4FICU40nS5ivtvgQlyVcQMP wjn7wmolyJevW2BSGwAY+IklAtyS5ssnjXB1ke0gLEIHDpGj/b9hPTQup nmCxzxGhwTLd3rB8P0wObTsjKfWxW+sI0bhwmdOA2dCx05XsIkgbO5adz g==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="14723327" X-IronPort-AV: E=Sophos;i="6.06,186,1705392000"; d="scan'208";a="14723327" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 11:22:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,186,1705392000"; d="scan'208";a="6715471" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 11:22:28 -0800 Date: Mon, 26 Feb 2024 11:22:24 -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 061/121] KVM: TDX: MTRR: implement get_mt_mask() for TDX Message-ID: <20240226192224.GQ177224@ls.amr.corp.intel.com> References: <83048a3bba898a4a81215f3c62489b03e307d180.1705965635.git.isaku.yamahata@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: On Mon, Feb 19, 2024 at 01:20:58PM +0800, Binbin Wu wrote: > > > On 1/23/2024 7:53 AM, isaku.yamahata@intel.com wrote: > > From: Isaku Yamahata > > > > Because TDX virtualize cpuid[0x1].EDX[MTRR: bit 12] to fixed 1, guest TD > > thinks MTRR is supported. Although TDX supports only WB for private GPA, > > it's desirable to support MTRR for shared GPA. As guest access to MTRR > > MSRs causes #VE and KVM/x86 tracks the values of MTRR MSRs, the remining > > s/remining/remaining > > > part is to implement get_mt_mask method for TDX for shared GPA. > > > > Pass around shared bit from kvm fault handler to get_mt_mask method so that > > it can determine if the gfn is shared or private. Implement get_mt_mask() > > following vmx case for shared GPA and return WB for private GPA. > > But the shared bit is not consumed in get_mt_mask()? This paragraph became stale. I eliminated this paragraph. -- Isaku Yamahata