Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3005487lqp; Mon, 25 Mar 2024 16:35:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUl+80SOgVmjaIT6mnXh+VsSE4SGQHiL6v2GrcK1f6Re0FEL7xpGWA9F/yQB6XPA56qUxenH8tvX5tvAUHBz8GUAMhQEAnXLWDAsM5CeA== X-Google-Smtp-Source: AGHT+IGUG1ya89D8wSnLOfnw/AizYwqWBpohHmBHyrm7puf1E4o1Zz04zcLslxUhCXqjHxDC6JCN X-Received: by 2002:a05:6214:2464:b0:696:72ba:100c with SMTP id im4-20020a056214246400b0069672ba100cmr971218qvb.45.1711409740857; Mon, 25 Mar 2024 16:35:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711409740; cv=pass; d=google.com; s=arc-20160816; b=pJvcyTLs/E35vYtPIMb2rcJRA7JoKxPICJvChCvPr9WwHmYwfQh0Ckl+7d3EkZ5N/B /WKKBljleB20c9gqkG3fi1mbn3J4IZ/qBp6povW6jm/wUiLhv6A9f5rbUctJgdSrFpRd eI3z+w64y1RW3qiZ3y3l/NYxRuN3xwPHuEz4yZ+TJd3ZuvvXXSf+t7ngP9ocF4mZDlDa vMci4Jh8XE8wE6CouOUswAituOgX149E/C2OYjyLHle+mhCMQhWnnxtDmoYz3Ip4TTUc 16M413R5LgYKZm3F3s71xujaOsBGXr2UxxiWuXCs6qkJ48UsJNfo7vwLtz0asS6MgkuM XZ+A== 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=PqU3HayZpq6Ime0ZieYiN6pQ8K8ScfUtwypKVw0XPc4=; fh=QJ+fj0hfp5eMH2kLBOwO6BS8UdLE/4i+J9r4pwETEv8=; b=WnA/+diB+RJt1ugVWaKgM/9Lhv38r2X1mH7S8Ji5M+Fbf6ESie708pRWyWT4wWvB0l PAQ+wKc7NqwJAx2YV9lPay8r3ytM45Ji7EY0HfU2OlY5smsiZdTRJnjChBkXJkPtzRjs V86ON6CNoVGCTcwgrIwcZ525f5O3od/zEAxDDG0m7aCy2bkCji8YSalRI3qZFTmtqIyV KfGnzylLn+2RuGm0Gc3thJjJc31ksl5BjD/Xx4aCwm04xxN77MwYw9AFwi/aMPr+2/Vt bMSfvWjWQ+/1I4/si5IFWgELYsW71Awj0KG071VSZErhGEFifJpf7ovvU/KQRjC1LIi1 J2nw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="HEg/B1+M"; 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-118167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118167-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 s10-20020a0562140caa00b006915cc2afedsi5985999qvs.244.2024.03.25.16.35.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 16:35:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118167-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="HEg/B1+M"; 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-118167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118167-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 964971C3ABCD for ; Mon, 25 Mar 2024 23:35:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E7DD83CA0; Mon, 25 Mar 2024 23:35:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HEg/B1+M" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 1C25C81207; Mon, 25 Mar 2024 23:35:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711409731; cv=none; b=DeSvceZ4kaSmMS1JKZZ7gzfVDgxBLtf4LscEdAlzFMlDAaHc28cDSqBnMkVYk2fiHACxU1GMzm2GD8dtezHQbQwxL9Ki8MbBpKYUzxRt42qs6ycjS6EHPVaSB6tbFMFFsK/GYJz+f5uk1J01gtASCgRM00mJkabpO4GNBRfyWU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711409731; c=relaxed/simple; bh=J59xWjUPon0R/XloDWvoBmR+mCac40WYEwIramAsVkQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XQL/6mTwkYHc4mPMMRrpvJdowyWQyvQFljb3Otaizz04+E2KFr+orRlPpayVO6O8NRk1bN9AqcwjJR6Ijdvg0J3HFjTzqfLnd0Civ4IPtGCFcXBuj/j09Pw6CGFy1kuuu6K7IK0sE4lihX8mL+7EJ9zdankbYyUtEaJklIUCdxc= 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=HEg/B1+M; arc=none smtp.client-ip=192.198.163.9 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=1711409730; x=1742945730; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=J59xWjUPon0R/XloDWvoBmR+mCac40WYEwIramAsVkQ=; b=HEg/B1+M3TWGjUWe0k7X7AQ4qsl6+Qq3Uai8YK0onC9ZKRYzmtX3YRCO PgCGbCqsg2h959ucuqPdQp4rBjMQs66/ntkHDUhIFP3pLrrdpDPvekXhn zle7s9UAs+6REwPz5Qc1V/3A3wvhKbY1BnQ4+hlvYgaesIBMY+AT1tSy8 71ImdwW7fhS+9u+u/v96uuqIXWTKUURtaMsM+xWvLfdvzxkUj9EhHV8We WtTinkIBoXJDJ5NhEx6fOREBZQlqYsws/t1lp2R62I1Gh30O4dHLMYf+J y7NaZjw4Qh0664v/o5ntBkRfSKZurzFxZnLqtZz4XPioHUu8DFEFsOAB8 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11024"; a="17171693" X-IronPort-AV: E=Sophos;i="6.07,154,1708416000"; d="scan'208";a="17171693" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2024 16:35:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,154,1708416000"; d="scan'208";a="15809290" 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; 25 Mar 2024 16:35:29 -0700 Date: Mon, 25 Mar 2024 16:35:28 -0700 From: Isaku Yamahata To: "Edgecombe, Rick P" Cc: "Yamahata, Isaku" , "Zhang, Tina" , "seanjc@google.com" , "Huang, Kai" , "kvm@vger.kernel.org" , "Chen, Bo2" , "sagis@google.com" , "isaku.yamahata@gmail.com" , "linux-kernel@vger.kernel.org" , "Aktas, Erdem" , "pbonzini@redhat.com" , "sean.j.christopherson@intel.com" , "Yuan, Hang" , "isaku.yamahata@linux.intel.com" Subject: Re: [PATCH v19 059/130] KVM: x86/tdp_mmu: Don't zap private pages for unsupported cases Message-ID: <20240325233528.GQ2357401@ls.amr.corp.intel.com> References: <20240319235654.GC1994522@ls.amr.corp.intel.com> <1c2283aab681bd882111d14e8e71b4b35549e345.camel@intel.com> <20240321225910.GU1994522@ls.amr.corp.intel.com> <96fcb59cd53ece2c0d269f39c424d087876b3c73.camel@intel.com> <20240325190525.GG2357401@ls.amr.corp.intel.com> <5917c0ee26cf2bb82a4ff14d35e46c219b40a13f.camel@intel.com> <20240325221836.GO2357401@ls.amr.corp.intel.com> <20240325231058.GP2357401@ls.amr.corp.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 Mon, Mar 25, 2024 at 11:21:17PM +0000, "Edgecombe, Rick P" wrote: > On Mon, 2024-03-25 at 16:10 -0700, Isaku Yamahata wrote: > > > > My understanding is that Sean prefers to exit to userspace when KVM can't handle something, > > > > versus > > > > making up behavior that keeps known guests alive. So I would think we should change this patch > > > > to > > > > only be about not using the zapping roots optimization. Then a separate patch should exit to > > > > userspace on attempt to use MTRRs. And we ignore the APIC one. > > > > > > > > This is trying to guess what maintainers would want here. I'm less sure what Paolo prefers. > > > > > > When we hit KVM_MSR_FILTER, the current implementation ignores it and makes it > > > error to guest.  Surely we should make it KVM_EXIT_X86_{RDMSR, WRMSR}, instead. > > > It's aligns with the existing implementation(default VM and SW-protected) and > > > more flexible. > > > > Something like this for "112/130 KVM: TDX: Handle TDX PV rdmsr/wrmsr hypercall" > > Compile only tested at this point. > > Seems reasonable to me. Does QEMU configure a special set of MSRs to filter for TDX currently? No for TDX at the moment. We need to add such logic. -- Isaku Yamahata