Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1820107rdb; Sun, 4 Feb 2024 02:51:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5EX8ctt+0TnnSCKQsf4ckUB4KXr8GVKxL3iys+4B1yLab73oLfgGwp7WfLIlZ6rkYWqmD X-Received: by 2002:a9d:7c85:0:b0:6dd:dd86:ad81 with SMTP id q5-20020a9d7c85000000b006dddd86ad81mr14415916otn.14.1707043891346; Sun, 04 Feb 2024 02:51:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707043891; cv=pass; d=google.com; s=arc-20160816; b=kEwRCqpRkYL06IjMzQHj7SL4EcHodD1Fj5skoCNZOwuJcgC8sRSJHz8nB24zu4Tci3 4evju/+lCRd17tfyE+QR7kbhyjYTKWigPrVWcMwhjhQJVizKmYwTXWsBVqTHS8tU9CDD ocH/Pg1Mle8DXf2YZrgTWRiDbzZtE6uWQFDa6+TecjEpmp5DgTWKwoCcP1gw/ffFQqCv FofCbYD3+pQYeQOyLfPzuRcDX4ujUVw/fp5f1E55g+aSiJa3zpPdFTdoTXZycX5pv7cq eGG8VpTXq+eeyK/6Ms3QfdloWs9JnAgotKPxGs6YWHMp0b/YtJntQOVdCO7oLjGe108i Q64g== 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=BvKMHvZApLC4/+cAgum01UFkXPsuboYFOW45sgx/bak=; fh=dlJpE2G1n7sUvgH04yF1Ke0empC/Xms/N4kqpDOltRM=; b=aL0vgCqtBh4hp1mhA51CAMoHneld278Y4FY+3DpGjcp4bl7ISK/JWresaQqLaTS4tz YkXjmdEJ3gIR5PXynXsX5/Sp7AOJejNTnMr6EX1XwQB5h593X4Y+w2L5bm8sS1W7Mopo X1nOT0fbgkotSNb3pevu54PTag6+zJXwb5P2Nedrook6K5ooYdvtTEugaBZSbV9BMFMR M+SsgHXPP6T0UbJhgMhy8KJcxKs46aaKf5ixFk+pVxsNO8lhypKi3UcVwwtqZwF2i0oI PBA1yTVYjL71smWrhqPIs6L7WcS6pB0rzxU+2VX0ihV9yKlIJGLyEOHDIN0/A8jEi9Fl Vcbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nL1W88nU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51531-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51531-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCXigciaU0KRheAVBQSkLgtF7LG0D7Ik1IPy01GJfP9WS+TOVQZmrDLjZU7x1Kkog/zC/leaEICQ8UG/Csy5j4Q43Esjxj7UAldc3DTp7Q== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z18-20020aa78892000000b006e025b1c0a7si2714226pfe.259.2024.02.04.02.51.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 02:51:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51531-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nL1W88nU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51531-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51531-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E4916B224D2 for ; Sun, 4 Feb 2024 08:46:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 315FD14AA7; Sun, 4 Feb 2024 08:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nL1W88nU" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 AEC5A14275; Sun, 4 Feb 2024 08:46:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707036403; cv=none; b=SA7pckbAKX0nS2fhvoyG7DcHpfNWT1uhEtwN/cjw8whykuonSxWzmj9WV2ZpFB5+BZaBPIq5LrusfPNNlD7DIU3sNiLpFeewbVPJZ1ku2naM0l1my+PP7lzVhYbL/JwDLa9RcbTZrf+02z2ncyjri0yrgEsgXL5iXhbxAY53i1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707036403; c=relaxed/simple; bh=Cpy3CKuYNywdrx8Zum44pEFdPYhqxi2fjTOZk38Zifk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JEwMtx8L+dSd2Nbkd5I8+ZuoUCUe6wSz0DFAHg/o1LQgwz47UZR3AeAkVomTVdCK0dqpvrjQR+aBWjOfWGAC/CVsTnDsA14wFSYMmBR58b68+bHion+jpxy8Hjvo2bAUpRqu2cPvio3Rsd2cYe8CHlCZ6oRCsLmaIlLjnV6Shq8= 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=nL1W88nU; arc=none smtp.client-ip=192.198.163.14 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=1707036402; x=1738572402; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Cpy3CKuYNywdrx8Zum44pEFdPYhqxi2fjTOZk38Zifk=; b=nL1W88nUfdRjOkUSjTPQy1lIvFGqsLTqVQG/bOzWLDP2yTXgl3FD1CpN aCcCR4qkRzXJE5Glmqmk8KE7TvM2FHn/ejLsMlyfdsUqFEbz3L8PjnPq5 /Gsrd3RPAq6rNvugyIsL0yNQ6EBkSk8rT/g2QQAicX9bKvmnrlISHzzaL ebzXqUEFN2/OXxQordWS/eYEkXdshz8QyQM02KpxRM+PmOpEcGgz4XlLb 53pH4Ok6bWdYoEORo/N03Ai/71q+CtVdrzywlNUMLz4PnwWT1GcWeyXhG 3s4+yJzd+tE9SqSy/VrqHs99OSJJalMi1R+CH+h0pgb8vKuDAd0FWZTQ1 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10973"; a="528900" X-IronPort-AV: E=Sophos;i="6.05,242,1701158400"; d="scan'208";a="528900" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2024 00:46:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,242,1701158400"; d="scan'208";a="515985" Received: from binbinwu-mobl.ccr.corp.intel.com (HELO [10.238.10.49]) ([10.238.10.49]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2024 00:46:37 -0800 Message-ID: <4f35f658-bd0a-4461-b9db-992bef0e57a9@linux.intel.com> Date: Sun, 4 Feb 2024 16:46:35 +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 v18 053/121] KVM: x86/mmu: TDX: Do not enable page track for TD guest 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, Yan Zhao , Yuan Yao References: From: Binbin Wu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/23/2024 7:53 AM, isaku.yamahata@intel.com wrote: > From: Yan Zhao > > TDX does not support write protection and hence page track. > Though !tdp_enabled and kvm_shadow_root_allocated(kvm) are always false > for TD guest, should also return false when external write tracking is > enabled. Nit: The preferred shortlog prefix format is "KVM: :", remove "TDX" from the shortlog? "KVM: x86/mmu: Do not enable page track for TD guest" should be OK. Reviewed-by: Binbin Wu > > Cc: Yuan Yao > Signed-off-by: Yan Zhao > --- > arch/x86/kvm/mmu/page_track.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/kvm/mmu/page_track.c b/arch/x86/kvm/mmu/page_track.c > index c87da11f3a04..ce698ab213c1 100644 > --- a/arch/x86/kvm/mmu/page_track.c > +++ b/arch/x86/kvm/mmu/page_track.c > @@ -22,6 +22,9 @@ > > bool kvm_page_track_write_tracking_enabled(struct kvm *kvm) > { > + if (kvm->arch.vm_type == KVM_X86_TDX_VM) > + return false; > + > return IS_ENABLED(CONFIG_KVM_EXTERNAL_WRITE_TRACKING) || > !tdp_enabled || kvm_shadow_root_allocated(kvm); > }