From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5448913B293 for ; Sat, 13 Jun 2026 00:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781309031; cv=none; b=rIDs4A3RqJNbtIyCkycflzJVrr1K/ikF9BhetM1ZaHkDboIDV8VyNN3YJq1gISvJ4zJeA2031XxO7whAwcMjZxp2q4N+t+4XepPsRJ7OAn6NVmUu3/oPEQCCB2DgYfpVmujOjRwrKvcQYWIVwZig5dpmnDWI8SXfGL1i3RZkBlk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781309031; c=relaxed/simple; bh=ylefe9JgIcNwU2nDRKF4DQxEjsugSsIymNueIngwpBM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ASgCBsGXJyTktWYk71aYghLdA9cMRTzDKiWpfTcxU5s98umG3Oq1tB+LRk66ZQTtwb7rg3Zk7xwlQyz+nGcLmZOO2Se8DJPUaUTUo+2w+A9kYFTlEsqJB1TTBVhiye54TOXgCTgVTTH57MJTfNQ6BDOkfAXDqbahpWeZC/0q5Nw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hRNNKT+Y; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hRNNKT+Y" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-8423efdbe6fso1002756b3a.0 for ; Fri, 12 Jun 2026 17:03:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781309024; x=1781913824; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=oRysUbRevtt3nFHcLXAJjhNOc5YQ8z/NfKqLVpBQ8Mk=; b=hRNNKT+YMOGjccM0wJKJbuNGEKSD4XhMkFJsshMdzTCzhqLkxX3uZKvfN8yXJo5R/F +b6S231f157k2b0EI1Aga9ejaAmK6eCxGNVWUalKgvuP+jGUyDWSsMNwn4Gl8wKWCijK E3YGxC5iqq6V507DqZQkfGjEesKAjwmA7eXe0DRs5KDibYYQrb4bIP4UEYFpgsfBNvsJ Cwe+faW/Sw16Y9zO7JMAVMrvF8M4SsTJA2EVjwQDXFZqGQ7uRhS0G75wIkkcscbTd4VB ZchZ8QQy3m+ZYWhX9Gg4ku2xQHJb7lW4F3ZAW7RiuTh8R93ImUSn4R/8F7uHkpSoIJ1d H6/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781309024; x=1781913824; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oRysUbRevtt3nFHcLXAJjhNOc5YQ8z/NfKqLVpBQ8Mk=; b=nL+rZ72exIxZUHE+tDHsYA5yW69A29+drtrzlDH8MG2mPT+CSy8b3+eGxee6vSsU3p iygG8c38CHsWuRMmP5z9KFMQHg+H0Rjr+U///lwcqvjZsq6kbepqVCuV6s6g1bSnp1L8 S2KdHxEYMjvwDV8bjsUbz0D6B3ZJiOATGcRUzL+qStTK84IddIkc8SrUr+V8c8dB3YgJ LHrLXDk+6g4ZVm2cMWaqH7Tzq8kkgKQXzLv9jYRUQ+dT8bSpoWHEVfon7DsxlQIi6hAl n/ahEwQE+BVUF86UvCw3OPbXFNIc1VqC6imjbAXBtPY9XBxYMJ05y2r3PQyH28TWpRRo rCcA== X-Forwarded-Encrypted: i=1; AFNElJ/Q6zC3FZIM0AAbmnfi4v8jdJ+swb6O39Pq4zvHEk2lNYazxCYPHaj8DUXxP9HPbi4pLdZ4B3Pk8iwQA78=@vger.kernel.org X-Gm-Message-State: AOJu0YznWFMsWV3rbO0lDYmWHpGiBECC+A0HcrMlaqfps/prG06ycr24 PTOv4EK/FNnH4UOcTb7zWO0g1P05gb/brr9iIRKwcbgJ7S0coFXFVYT3vvPSTiLktLsrif3cq6D YJveTwQ== X-Received: from pfjc12.prod.google.com ([2002:a05:6a00:8c:b0:82f:6a26:5f78]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:9519:b0:841:dc85:1638 with SMTP id d2e1a72fcca58-8434d1009dcmr5178798b3a.42.1781309023496; Fri, 12 Jun 2026 17:03:43 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 12 Jun 2026 17:03:07 -0700 In-Reply-To: <20260613000329.732085-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260613000329.732085-1-seanjc@google.com> X-Mailer: git-send-email 2.54.0.1136.gdb2ca164c4-goog Message-ID: <20260613000329.732085-9-seanjc@google.com> Subject: [PATCH v4 08/30] KVM: x86: Move tdp_enabled from kvm_host.h to mmu.h From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Vitaly Kuznetsov Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed , Kai Huang Content-Type: text/plain; charset="UTF-8" Relocated the declaration of tdp_enabled into mmu.h, and opportunistically hoist tdp_mmu_enabled up to the top so that the two are co-located. No functional change intended. Reviewed-by: Kai Huang Reviewed-by: Yosry Ahmed Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 2 -- arch/x86/kvm/mmu.h | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 57e67bad4abe..153ed5611c2e 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -2188,8 +2188,6 @@ void kvm_zap_gfn_range(struct kvm *kvm, gfn_t gfn_start, gfn_t gfn_end); int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); -extern bool tdp_enabled; - /* * EMULTYPE_NO_DECODE - Set when re-emulating an instruction (after completing * userspace I/O) to indicate that the emulation context diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h index 28fca48dcf64..0eaea2d4fac9 100644 --- a/arch/x86/kvm/mmu.h +++ b/arch/x86/kvm/mmu.h @@ -6,6 +6,12 @@ #include "regs.h" #include "cpuid.h" +extern bool tdp_enabled; +#ifdef CONFIG_X86_64 +extern bool tdp_mmu_enabled; +#else +#define tdp_mmu_enabled false +#endif extern bool __read_mostly enable_mmio_caching; #define PT_WRITABLE_SHIFT 1 @@ -260,12 +266,6 @@ static inline bool kvm_shadow_root_allocated(struct kvm *kvm) return smp_load_acquire(&kvm->arch.shadow_root_allocated); } -#ifdef CONFIG_X86_64 -extern bool tdp_mmu_enabled; -#else -#define tdp_mmu_enabled false -#endif - int kvm_tdp_mmu_map_private_pfn(struct kvm_vcpu *vcpu, gfn_t gfn, kvm_pfn_t pfn); static inline bool kvm_memslots_have_rmaps(struct kvm *kvm) -- 2.54.0.1136.gdb2ca164c4-goog