From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796407504; b=rsuPYb6pAwJRhgxmQJ+X6Z8+bIMFlzWwFzeBJRQHWUaS4AzLe9hgoAZHkEzDhhEAIT5b c8GABhIEQBuzGQZpogKRfovGr9Ii5maN3+hG1RUmfokfcuDWpDCpPOcmcyOpnHC1PE0K8 eOyonJMqRWrdqVb4nAvvjuaj1v2k5JCfgQFulK1qv1ilCZVnesrp17rwIlkzMcglah90k +uHUTC3vU2Ptotfdg0SAqYWKhdxrjbOvpK6qtUc3hICNILF/HW73AgwiLXwZm8tFniubs X+7IKRYntfkfPnMKd4iF/5h3JkdHfVkLvpEyBZ8vXqNqpca2ZKdkavmtW3JXDSTzkiA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796407504; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Scanned-By; bh=ME3QWwHaMacPh2dfwkPWeC7KPRjY9IHefCPyjwhxLcQ=; b=25LC8qVpW/kcW61L3IU3XvvFVbz7oMMnvW3gaz+xa3XytLaFb0lGaeYM0u1gveKPIuVm ti9pfQxkgxj1SpmjvBY2JqZKYGJuOodiVu7oMwJqyilv6YT2e1J9HNA7WTq7H+qaO0ih7 UCE++8qRC2+DffrpQ3lzIIm2Vnrimc7P5Ay7DcCnmFgbfnutsl35ivTt2t+Bmdn7kYow5 G9F67oeGiWbE63om1ozw2cfHonHa4Loz8m9xVOI+r+5xY6af/31M5DDmwTG5WPiUXhi+D SUOEdPxkvQ7sgq/JRufXtuKde+kadzEoQ0WXwGIE8hrWMujfRtBwKHbsOYz4wKZ0Epg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b="ZlV+/wVh"; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3FCC607312D for ; Fri, 4 Dec 2026 18:05:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D3FCC607312D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZlV+/wVh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796407503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ME3QWwHaMacPh2dfwkPWeC7KPRjY9IHefCPyjwhxLcQ=; b=ZlV+/wVh/KWRi567kxN+bOJ7EL6C/eBpQQaAs0uuI1/OQRMOX+wXk215TcMgskoxle1uPo LzvbXpvB6lSnrPGLrx+zQnAsTwUjocbh+EaYhtlelNWZZobWEkimwQSrMNRUmPcHgVa41N 1vUHHFeLsOd5XEkddS2G3gy2N3NTVNs= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS with 8BITMIME (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-653-Xku2Y5ymO0yiKKGKE0CwaQ-1; Fri, 4 Dec 2026 18:05:01 +0000 X-MC-Unique: Xku2Y5ymO0yiKKGKE0CwaQ-1 X-Mimecast-MFC-AGG-ID: Xku2Y5ymO0yiKKGKE0CwaQ_1796407499 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CA43D18F52C1; Fri, 4 Dec 2026 18:04:59 +0000 (UTC) Received: from pbonzini-thinkpadx1carbon6th.rmtit.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 87ED33003EA8; Fri, 4 Dec 2026 18:04:58 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Jun Miao , Sean Christopherson Subject: [PATCH 6.1.y 18/24] KVM: Fix comments that refer to the non-existent install_new_memslots() Date: Fri, 4 Dec 2026 19:04:17 +0100 Message-ID: <20261204180423.2168641-19-pbonzini@redhat.com> In-Reply-To: <20261204180423.2168641-1-pbonzini@redhat.com> References: <20261204180423.2168641-1-pbonzini@redhat.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 From: Jun Miao [ Upstream commit b0d237087c674c43df76c1a0bc2737592f3038f4 ] Fix stale comments that were left behind when install_new_memslots() was replaced by kvm_swap_active_memslots() as part of the scalable memslots rework. Fixes: a54d806688fe ("KVM: Keep memslots in tree-based structures instead of array-based ones") Signed-off-by: Jun Miao Link: https://lore.kernel.org/r/20230223052851.1054799-1-jun.miao@intel.com Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini --- Documentation/virt/kvm/locking.rst | 2 +- include/linux/kvm_host.h | 4 ++-- virt/kvm/kvm_main.c | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/virt/kvm/locking.rst b/Documentation/virt/kvm/locking.rst index 845a561629f1..c93fd24bb726 100644 --- a/Documentation/virt/kvm/locking.rst +++ b/Documentation/virt/kvm/locking.rst @@ -24,7 +24,7 @@ The acquisition orders for mutexes are as follows: - kvm->mn_active_invalidate_count ensures that pairs of invalidate_range_start() and invalidate_range_end() callbacks use the same memslots array. kvm->slots_lock and kvm->slots_arch_lock - are taken on the waiting side in install_new_memslots, so MMU notifiers + are taken on the waiting side when modifying memslots, so MMU notifiers must not take either kvm->slots_lock or kvm->slots_arch_lock. On x86: diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b5a3a48379cf..2c602e741a08 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -58,7 +58,7 @@ /* * Bit 63 of the memslot generation number is an "update in-progress flag", - * e.g. is temporarily set for the duration of install_new_memslots(). + * e.g. is temporarily set for the duration of kvm_swap_active_memslots(). * This flag effectively creates a unique generation number that is used to * mark cached memslot data, e.g. MMIO accesses, as potentially being stale, * i.e. may (or may not) have come from the previous memslots generation. @@ -702,7 +702,7 @@ struct kvm { * use by the VM. To be used under the slots_lock (above) or in a * kvm->srcu critical section where acquiring the slots_lock would * lead to deadlock with the synchronize_srcu in - * install_new_memslots. + * kvm_swap_active_memslots(). */ struct mutex slots_arch_lock; struct mm_struct *mm; /* userspace tied to this vm */ diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 9845e6a734f3..add614b3b40d 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1317,7 +1317,7 @@ static void kvm_destroy_vm(struct kvm *kvm) * At this point, pending calls to invalidate_range_start() * have completed but no more MMU notifiers will run, so * mn_active_invalidate_count may remain unbalanced. - * No threads can be waiting in install_new_memslots as the + * No threads can be waiting in kvm_swap_active_memslots() as the * last reference on KVM has been dropped, but freeing * memslots would deadlock without this manual intervention. * @@ -1759,13 +1759,13 @@ static void kvm_invalidate_memslot(struct kvm *kvm, kvm_arch_flush_shadow_memslot(kvm, old); kvm_arch_guest_memory_reclaimed(kvm); - /* Was released by kvm_swap_active_memslots, reacquire. */ + /* Was released by kvm_swap_active_memslots(), reacquire. */ mutex_lock(&kvm->slots_arch_lock); /* * Copy the arch-specific field of the newly-installed slot back to the * old slot as the arch data could have changed between releasing - * slots_arch_lock in install_new_memslots() and re-acquiring the lock + * slots_arch_lock in kvm_swap_active_memslots() and re-acquiring the lock * above. Writers are required to retrieve memslots *after* acquiring * slots_arch_lock, thus the active slot's data is guaranteed to be fresh. */ @@ -1827,11 +1827,11 @@ static int kvm_set_memslot(struct kvm *kvm, int r; /* - * Released in kvm_swap_active_memslots. + * Released in kvm_swap_active_memslots(). * - * Must be held from before the current memslots are copied until - * after the new memslots are installed with rcu_assign_pointer, - * then released before the synchronize srcu in kvm_swap_active_memslots. + * Must be held from before the current memslots are copied until after + * the new memslots are installed with rcu_assign_pointer, then + * released before the synchronize srcu in kvm_swap_active_memslots(). * * When modifying memslots outside of the slots_lock, must be held * before reading the pointer to the current memslots until after all -- 2.56.1