Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp109969lqh; Wed, 27 Mar 2024 16:58:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUb/UFj5gRExVl+uf6IRveWPFT1nnVnf/PopV24p0MzWtxLHi/exWAtadIOb5MnaO9j/c/4scwEordWVcImUE4poXVu3fKLz0X3MAhy0A== X-Google-Smtp-Source: AGHT+IErXXR9ADYUwnzbGf8ETTIRMOWRtFMeU0e1VNpIcEpNEzA5fMS5fYcIbukRSUilPVqaBFdr X-Received: by 2002:a05:6a20:bc8f:b0:1a3:701c:cca9 with SMTP id fx15-20020a056a20bc8f00b001a3701ccca9mr1341494pzb.27.1711583930412; Wed, 27 Mar 2024 16:58:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711583930; cv=pass; d=google.com; s=arc-20160816; b=kLJhjj0oSHxcsvE4K9j+U1X0BL9lb2suU5lr2qMIDglsBs8jyYpfiFfHrHGLzs7fuX k/eij8cfwi/j91pA+67DbzR4LbLoEMrTLUNErY4NNiEvV4jRc4jM7fbCglE3F5jGgEhn KrtsYeYbs1oMCOirLp2tMo2y8isbSR1I5QisrUUhs7xKqjBIezYiWkAZMQeV7k8sUO4L cGQSF8jOEP9ycuGZlZ+1dgitM5NXH+KFgvTzLoWqacur8faDhLjYnoZ6y0iP053C/fUv fLNEcOw6kaAkDqQthJxqVMkxFQ40T4ZeXWP9rOiPd8fezmVhNoYkpqcFZA34vJ7ln7iF hq5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=h7qBVPxei6ZKTkbyVcY3mNJdTroQ/BE3YobdcFHujzs=; fh=LdTwr5YgCOtnlBDEj9OlZ/AQWK8dfFGPSNcsCkTNCv8=; b=LgEuxBv+Viu4YmVS94Rl9x+Q5QqK+EWxhwkCPaCTqZ0T/MmU90fgfjsGhBKWRQ1vNd qDUtCimy4TEBlZXwngzRh2FlUWJxmtzh2BfBtUg7PqqesmDnHu5Nz0UqJlgDyy4vTJAv /tDFKMEr0V6OVqSgKD/uA9OEkJ8AmsPx5Y7ydUzgmwC20sdMLgriS3WiQ7eP9OwD2l+n LLQwGDP2Ob0h5SJBvvrPnaOPjrve41x6EQ7g6o3q0aFcpmAUPfnyLhE7N3cMhRyCaNG7 bb1gR8C8Ca9AT2Gyv7TmPm28ENQKDuXe8/qZ458BABvzsfsQYA4+2HJxetKOaEO88yjw l4ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SjHD06Re; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-122199-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122199-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 p14-20020a170902e74e00b001ddb0108315si195143plf.468.2024.03.27.16.58.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 16:58:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122199-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=SjHD06Re; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-122199-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122199-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 68D0C293DC3 for ; Wed, 27 Mar 2024 23:58:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE0241552F8; Wed, 27 Mar 2024 23:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SjHD06Re" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 1A06922094; Wed, 27 Mar 2024 23:58:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711583917; cv=none; b=Lv44fFfMQ88fIZYv9hlrn/2Jr3WBUhiQRzhHgRf1GC4iiX0b6wJG5rE6yNADQJNGrL3d3YzPQISvgtd5qJJa21H3OgOQG58dbw1suuUVmOYnLlKFLgCehYAwHEHrB5MzDHweFBcH02cLZdqTkxfHbgFFMPkm1hFcjL+Itdxlfzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711583917; c=relaxed/simple; bh=d6jZWl/4ns4obMB2o0aKFjPdoKDJa/8I2PNQXfn+TVE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Hsh7xEzahCRSXKTkqGyO4TmxhcxjkfpuN+IMyMNE1T/ufH60VE+kz/FvVG+YCc6s6aEAimqecWdypqzc1DQX8sSKgJCDC8tInsRZGkL5b4CPSjuegsG8N5KbGZ0+kf90UzQN0doHfgIO6tjU3IVgU2b3A6WiN8fnmG2vEs6a1sA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SjHD06Re; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=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=1711583916; x=1743119916; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=d6jZWl/4ns4obMB2o0aKFjPdoKDJa/8I2PNQXfn+TVE=; b=SjHD06ReJJ3wb7Kx4cldNVo4YJBq8MtlZ6e1gEAYcVCBIwYCmkEuv/AD KPrCMwiQeBPEuG3gtttc/1tM2i7i4niAE63MQMl9kpLVb3d4u30mmZCJ0 jB8fc+z3TXFpKxm6yuvwQZlpsCKCdkU2w1Az/E8MSbQI8XFin6g2TqJC9 hCFPey6Na3xRZC7mxAfwoAXJvBP8fVKjw5bAGoUQqKFRhPf4g/NDDeMom cKGlVYhzfu0iNOp61CnafnbfwLeY5J299nHGHIuvOMCEnQgveBUr/YRKK 2oeZaL5YOQ0uEAYcxNHAHsVBd/+6dM9leWEFEAAOjN5tv+BNRRTzTljJ9 w==; X-CSE-ConnectionGUID: FzRCR88NQJuN8/Qh2Hhtuw== X-CSE-MsgGUID: 5Ya01s2tTSOKa25STcJIgw== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="9677418" X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="9677418" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 16:58:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="16486554" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 16:58:35 -0700 Date: Wed, 27 Mar 2024 16:58:35 -0700 From: Isaku Yamahata To: "Edgecombe, Rick P" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Yamahata, Isaku" , "Zhang, Tina" , "seanjc@google.com" , "Yuan, Hang" , "Huang, Kai" , "Chen, Bo2" , "sagis@google.com" , "isaku.yamahata@gmail.com" , "Aktas, Erdem" , "pbonzini@redhat.com" , "sean.j.christopherson@intel.com" , isaku.yamahata@linux.intel.com Subject: Re: [PATCH v19 052/130] KVM: x86/mmu: Track shadow MMIO value on a per-VM basis Message-ID: <20240327235835.GI2444378@ls.amr.corp.intel.com> References: <34d7a0c8724f4fce4da50fe3028373c31213aa8a.1708933498.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 Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Mar 26, 2024 at 03:31:05AM +0000, "Edgecombe, Rick P" wrote: > On Mon, 2024-02-26 at 00:25 -0800, isaku.yamahata@intel.com wrote: > > From: Isaku Yamahata > > > > TDX will use a different shadow PTE entry value for MMIO from VMX.  Add > > members to kvm_arch and track value for MMIO per-VM instead of global > > variables.  By using the per-VM EPT entry value for MMIO, the existing VMX > > logic is kept working.  Introduce a separate setter function so that guest > > TD can override later. > > > > Also require mmio spte caching for TDX. > > > > Actually this is true case > > because TDX requires EPT and KVM EPT allows mmio spte caching. > > > > I can't understand what this is trying to say. I'll drop this sentence as the logic moved to "069/130 KVM: TDX: Require TDP MMU and mmio caching for TDX". > >  { > > + > > +       kvm->arch.shadow_mmio_value = shadow_mmio_value; > > It could use kvm_mmu_set_mmio_spte_value()? Yes. -- Isaku Yamahata