Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2687745rwd; Sun, 28 May 2023 22:14:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7MQm2msovUB9NOhooHvaOE0kvjSgKhuAPLDYxj+3Yk4ijVYzw2XUV7TXBEVV1py8mHTBk8 X-Received: by 2002:a05:6a21:6811:b0:110:9b0b:71b6 with SMTP id wr17-20020a056a21681100b001109b0b71b6mr4940251pzb.37.1685337257105; Sun, 28 May 2023 22:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685337257; cv=none; d=google.com; s=arc-20160816; b=vmE/47tgmuwOatsvKMvk4Zv3yYSmUFpbalePwL7+C9IXWTvdVC5dejZbE8qLgNIJGB yJ0rScpdcqiZZNl1ozatkyH5EQ56fSg3G9PMbyk0jJSL76PeoCuinLAlB2QnEvve4+Qh qYtwQUriIIB3o0KEyeT5vhc8UDPS/MpsLHAyLhtMroXFFvNqj3Pf5fRljUy8KVL6rqvc AtwzzzfEiGgA7Qkg4XpRqXIchiWqUC99xEAohq0aFrPxEJrfQzHng185LQWtKarYvNkM i6Hymee/FcqO0VKV/hbIv7iNkEKs21w4XKQ0Y9nBhpdhgha1G61wWeY5mQDkcIrWn2xM 2OIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=v7xK3D6ug2WO4/kf11G06lPC5Tyzah6nkpSHITpNseM=; b=Bx10uA9VA3J4vfpTPj76jHllEZD4x6ntncjH4ARprttJ667rEGMF/9yTd0AFdhkCNG 3/q+XCSWYsV6HeGKKsO/U+E+QenKF2ni0EFCzbFJlXjBVeKz9QqdJ1sm7LfkIJmto4GP e3jWm+GVBnfg1mIT5/y0rSg9uSLdyT15MfvP/PCgSbXgAD1tb8jbLA8g95HsutzHS/vb VVQX9lPuvWnvCmsNHvgpgi1/g2owyDFmYGbSlTD3YA4FYD2BxPbAjAlxXvW1/AXTnrKl proIBIwtfrijI/KtJcdFT3in/Loi5SFDCVSFh4AqpQCeIEgP8oY/FTllX79Yle92Cf1G j+Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GiONkdZP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e23-20020a656797000000b0051f17a517adsi8011431pgr.492.2023.05.28.22.14.05; Sun, 28 May 2023 22:14:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GiONkdZP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231789AbjE2E0P (ORCPT + 99 others); Mon, 29 May 2023 00:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231849AbjE2EZi (ORCPT ); Mon, 29 May 2023 00:25:38 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CFAB180; Sun, 28 May 2023 21:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685334202; x=1716870202; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bAyBc4s3tiQ/01jXFwZRD2ovwWFrfG+pQJPt5k9h7e8=; b=GiONkdZPx8xw2boX3q2md7l11pXjQgkm/ocCeEI7Yua8DtkCMEJDaZF5 u7Pi9akGziyDjqgKXFSJ2Z1ddDfavbBuPnREIahi9STEXNWzWBQpeAZbh tV+VscBqUbPokTBUXpnC9GlhwRUAUjlxE0OGfGKXvSw6JnNwe3w4xUmMs KAtSkgSYEuQlfni6+npWar4n/PiIzbJ7Oa2/lCPNKVobj7cGxWWlAfYYA PLKm7Xzm+TWLeYJSUuUdCF0OuRWybK695VV56MypQ+5vVNCgEOT6slRhr XxGloTiLrSsPxFT5gaPnAU3jUe8He5tVbQtMNsdQz6AN3S3GPkrShcG5Z w==; X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="334966003" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="334966003" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2023 21:21:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="775784327" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="775784327" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2023 21:21:17 -0700 From: isaku.yamahata@intel.com To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , David Matlack , Kai Huang , Zhi Wang , chen.bo@intel.com, Yan Zhao , Yuan Yao Subject: [PATCH v14 048/113] KVM: x86/mmu: TDX: Do not enable page track for TD guest Date: Sun, 28 May 2023 21:19:30 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 0a2ac438d647..d738d318ce17 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_PROTECTED_VM) + return false; + return IS_ENABLED(CONFIG_KVM_EXTERNAL_WRITE_TRACKING) || !tdp_enabled || kvm_shadow_root_allocated(kvm); } -- 2.25.1