Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2609309rdg; Mon, 16 Oct 2023 09:17:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWj3JB9oOO+SZTHDFutRiKlrT38V/pvdKUCCbIQXEjHYj84KbmghvVj0LxM2yABXBgrf61 X-Received: by 2002:a62:7987:0:b0:6b4:d17b:25ab with SMTP id u129-20020a627987000000b006b4d17b25abmr8629801pfc.25.1697473044248; Mon, 16 Oct 2023 09:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697473044; cv=none; d=google.com; s=arc-20160816; b=lqbXBQsaeFnwg1xvfeW0pOdP1B2Z1iemFirPXtolDhw4EJC6NnES6/xSxC/XmLylOI bPmqhjrnx0TpnhjECWh6cEG96PIucUsrF5YnlICarYCsiTBdQmmsLeJM9nVZ1P9jQHWi 76GWnr5Z0EVOnk/gCaoMmMdxRc2rGtUPyJ1O6F0uJ3WRa5mGxUpNyfZOPpH7rVvp8uAM j2xsBgcNdtCkzXKV2Lu9zwKtaFQPRcaPhQYod9WDyNJIdBeUuLgQWbcY7aSz1h2nnaMO QBV/qEoLrM4j2zYPlrrZm5GFJPCJbX2iOI8Jvahj6NROuQBH3jl8OR2ZL0TQ6e2RkhWc 9V+Q== 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=Ywn4TnQEIXX525nXLtumeEjHFRNm/NKuqpliCkU4ops=; fh=jGP0h4qwsg0s/pwBVu6SJZthvi5drTwAeJhnRRPvCL8=; b=nr053a25IlffxBi5D7sUQnkmjPrqAlMU4TSVsn+N/PUtCHidXnO0oy48h2OX73rDHJ hkuACrg6np67AsgPRmz3OksyIvAo3zxVS5YlZbDwxMml93o7ZT8qb2fBUlr/0RSw+b9A y31ybv9r+Q997Kh9qA68zC3JCW6oXB+wwHS4D0Rl3ZEzQPtpepS6ggzHm/75OrA5kLl2 Se188V+2/G8qXCkh5LmXCH5vYhibBMfLD0V2HeAihZEzpjZNFc8GF2vdW2jZE+xjGUao 8c6s0pedAaXvZZQ8n1ZDS52+zEPVmDeYGSU+1f/83HqQfJZTDa2pjkensSD34vYU8Tfa raCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CIw7q5Rh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u1-20020a056a00098100b0069109ee0b59si121008pfg.231.2023.10.16.09.17.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 09:17:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CIw7q5Rh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 68D25802E5F8; Mon, 16 Oct 2023 09:17:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234016AbjJPQRN (ORCPT + 99 others); Mon, 16 Oct 2023 12:17:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233855AbjJPQRC (ORCPT ); Mon, 16 Oct 2023 12:17:02 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA48D115; Mon, 16 Oct 2023 09:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697473012; x=1729009012; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4SCW6Dkj/Vj+qX6sWycKS9/fk9MJ8AKVtZUkBL10lrs=; b=CIw7q5Rh6u0MQ9gB0IFhK2UZwP1R1RiG260gw7Nh4p//ErWML9HcI3Cc +bdx/nH+NDa6jpNKaaQ0IGoOBBbB/kiIKbqNoi4V1T0t0v+Uw0ODN0+cZ ZKcirKYXV+qv4dapZsQjLCLAaVJpZpM0+AqTjNmVSBRFldNTdXq36AlLj gDOzyrJUzcC/G1gZ5i6XyI55UR1sXA0EKCVY322VKvZrFLiIPK5rhVlbQ sTGmWb63rmZwoNE/SPjMpROxDSgMxip3b/2eeihZ9bJBPCrhQm6BKQO1h qvgoNOwh2dz5A4y+hIRmv+jZFnKT+Rst2O0gez7vCBmxjTLTO7RkV7vGt Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="364921779" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="364921779" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:15:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="846448122" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="846448122" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 09:15:43 -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, hang.yuan@intel.com, tina.zhang@intel.com, Yan Zhao , Yuan Yao Subject: [PATCH v16 048/116] KVM: x86/mmu: TDX: Do not enable page track for TD guest Date: Mon, 16 Oct 2023 09:14:00 -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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 16 Oct 2023 09:17:23 -0700 (PDT) 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 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); } -- 2.25.1