From nobody Mon Feb 9 23:43:11 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30E52C77B75 for ; Sat, 13 May 2023 00:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241679AbjEMAiF (ORCPT ); Fri, 12 May 2023 20:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241475AbjEMAhJ (ORCPT ); Fri, 12 May 2023 20:37:09 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B5AB6A56 for ; Fri, 12 May 2023 17:36:49 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-54c2999fdc7so200875227b3.2 for ; Fri, 12 May 2023 17:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683938201; x=1686530201; 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=yBETkGnGrC8xyRU9tqoXVGFHlyOCEt0u5rcLYF6ohy4=; b=ZXGeAKEgO8hcDtjKpOXSnd1FbTzMf1+7DyVEZOA9BrMq9Tl7hGxQEzG/Fl1cU7yZhg u3Jy0T8wQykwBT1qHFXsHxlN5FIEKv02d3rVwzux3mJSTfb0D/7uMNLaEyb2gH9xYrkr WELoXfba5L0iPT22FkArGeve/0l5axDlImnWWHzdm7cSBVRxRoPzAF53f0wCIiHJB83W Zsct/PIdzW5XOp7SR/OCJPZOvq+sJZCUjz5sEKbIyxIg2y009eLzW8Qtmud6WTpisUMW n0pDLKH7s6WSInK2gy6hit353+jnmdLB04+6fToS9m7ApQSsdUH2geLdkYWa+KrfuChT BrPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683938201; x=1686530201; 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=yBETkGnGrC8xyRU9tqoXVGFHlyOCEt0u5rcLYF6ohy4=; b=T0rjP1Rx7i7thOAy69ZcqgTW8qAI0pDLl8j5wNwcQhY9mR0RbJH3CFrgCttUuCXvo9 /R5wvx41LXj0Se9e8pm4kSW1LwJvojGVv657tkRaxfmU8pwc2mYLjdrQVzqkHENPerYV OrZxQFYfSUpk2VvmGMxtNsKTdSFZwQSY2inOuiT6v0sQUst5JXDI3ZpgzL7DeEVeI3Im VAMGvTrOWpMLUG82pOAIYWt/s5PtdGmOYToPlYuJ+JbyEoH53YmkipyGJPY778Eigkn7 L/dbZyyiayN1ewlyDFUMo3VHT9K5euXK+nZro834qSMTjkm8s4mNnosNt4f+m5cGI6QD zAVQ== X-Gm-Message-State: AC+VfDwgKmUJGibptvySkzjDoMaQgP/W+Wc8EH60E4RkBj2TvHf7x7iI OYxRCfUOLugTKyHVVp6l3jBz3SNgvqY= X-Google-Smtp-Source: ACHHUZ7l3ePv6zKDFzoAhujwIzaWMwTG2FjHBPR4kh0IXDS7Hk0xhSDs9YHZN+pcUE3y+CqYI16b+YuhSro= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:e549:0:b0:55d:d26c:9aff with SMTP id c9-20020a81e549000000b0055dd26c9affmr13085374ywm.8.1683938201688; Fri, 12 May 2023 17:36:41 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 12 May 2023 17:35:51 -0700 In-Reply-To: <20230513003600.818142-1-seanjc@google.com> Mime-Version: 1.0 References: <20230513003600.818142-1-seanjc@google.com> X-Mailer: git-send-email 2.40.1.606.ga4b1b128d6-goog Message-ID: <20230513003600.818142-20-seanjc@google.com> Subject: [PATCH v3 19/28] KVM: x86: Remove the unused page-track hook track_flush_slot() From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Zhenyu Wang , Zhi Wang Cc: kvm@vger.kernel.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yan Zhao , Ben Gardon Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yan Zhao Remove ->track_remove_slot(), there are no longer any users and it's unlikely a "flush" hook will ever be the correct API to provide to an external page-track user. Cc: Zhenyu Wang Suggested-by: Sean Christopherson Signed-off-by: Yan Zhao Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 11 ----------- arch/x86/kvm/mmu/mmu.c | 2 -- arch/x86/kvm/mmu/page_track.c | 26 -------------------------- 3 files changed, 39 deletions(-) diff --git a/arch/x86/include/asm/kvm_page_track.h b/arch/x86/include/asm/k= vm_page_track.h index cfd36c22b467..5c348ffdc194 100644 --- a/arch/x86/include/asm/kvm_page_track.h +++ b/arch/x86/include/asm/kvm_page_track.h @@ -33,16 +33,6 @@ struct kvm_page_track_notifier_node { */ void (*track_write)(gpa_t gpa, const u8 *new, int bytes, struct kvm_page_track_notifier_node *node); - /* - * It is called when memory slot is being moved or removed - * users can drop write-protection for the pages in that memory slot - * - * @kvm: the kvm where memory slot being moved or removed - * @slot: the memory slot being moved or removed - * @node: this node - */ - void (*track_flush_slot)(struct kvm *kvm, struct kvm_memory_slot *slot, - struct kvm_page_track_notifier_node *node); =20 /* * Invoked when a memory region is removed from the guest. Or in KVM @@ -85,7 +75,6 @@ kvm_page_track_unregister_notifier(struct kvm *kvm, struct kvm_page_track_notifier_node *n); void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new, int bytes); -void kvm_page_track_flush_slot(struct kvm *kvm, struct kvm_memory_slot *sl= ot); void kvm_page_track_delete_slot(struct kvm *kvm, struct kvm_memory_slot *s= lot); =20 bool kvm_page_track_has_external_user(struct kvm *kvm); diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index af3e562d3106..3f9030650c3d 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -6734,8 +6734,6 @@ void kvm_arch_flush_shadow_memslot(struct kvm *kvm, struct kvm_memory_slot *slot) { kvm_mmu_zap_all_fast(kvm); - - kvm_page_track_flush_slot(kvm, slot); } =20 void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm, u64 gen) diff --git a/arch/x86/kvm/mmu/page_track.c b/arch/x86/kvm/mmu/page_track.c index d971c28be99d..2a6ab7c455c0 100644 --- a/arch/x86/kvm/mmu/page_track.c +++ b/arch/x86/kvm/mmu/page_track.c @@ -278,32 +278,6 @@ void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t= gpa, const u8 *new, kvm_mmu_track_write(vcpu, gpa, new, bytes); } =20 -/* - * Notify the node that memory slot is being removed or moved so that it c= an - * drop write-protection for the pages in the memory slot. - * - * The node should figure out it has any write-protected pages in this slot - * by itself. - */ -void kvm_page_track_flush_slot(struct kvm *kvm, struct kvm_memory_slot *sl= ot) -{ - struct kvm_page_track_notifier_head *head; - struct kvm_page_track_notifier_node *n; - int idx; - - head =3D &kvm->arch.track_notifier_head; - - if (hlist_empty(&head->track_notifier_list)) - return; - - idx =3D srcu_read_lock(&head->track_srcu); - hlist_for_each_entry_srcu(n, &head->track_notifier_list, node, - srcu_read_lock_held(&head->track_srcu)) - if (n->track_flush_slot) - n->track_flush_slot(kvm, slot, n); - srcu_read_unlock(&head->track_srcu, idx); -} - /* * Notify external page track nodes that a memory region is being removed = from * the VM, e.g. so that users can free any associated metadata. --=20 2.40.1.606.ga4b1b128d6-goog