[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250418115504.17155-1-lirongqing@baidu.com>
Date: Fri, 18 Apr 2025 19:55:04 +0800
From: Li RongQing <lirongqing@...du.com>
To: pbonzini@...hat.com,
kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Li RongQing <lirongqing@...du.com>
Subject: [PATCH] KVM: Fix obsolete comment about locking for kvm_io_bus_read/write
Nobody is actually calling these functions with slots_lock held.
The srcu read lock is required.
Signed-off-by: Li RongQing <lirongqing@...du.com>
---
virt/kvm/kvm_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index e85b33a..2e591cc 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -5774,7 +5774,7 @@ static int __kvm_io_bus_write(struct kvm_vcpu *vcpu, struct kvm_io_bus *bus,
return -EOPNOTSUPP;
}
-/* kvm_io_bus_write - called under kvm->slots_lock */
+/* kvm_io_bus_write - called under kvm->srcu read lock */
int kvm_io_bus_write(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx, gpa_t addr,
int len, const void *val)
{
@@ -5795,7 +5795,7 @@ int kvm_io_bus_write(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx, gpa_t addr,
}
EXPORT_SYMBOL_GPL(kvm_io_bus_write);
-/* kvm_io_bus_write_cookie - called under kvm->slots_lock */
+/* kvm_io_bus_write_cookie - called under kvm->srcu read lock */
int kvm_io_bus_write_cookie(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx,
gpa_t addr, int len, const void *val, long cookie)
{
@@ -5845,7 +5845,7 @@ static int __kvm_io_bus_read(struct kvm_vcpu *vcpu, struct kvm_io_bus *bus,
return -EOPNOTSUPP;
}
-/* kvm_io_bus_read - called under kvm->slots_lock */
+/* kvm_io_bus_read - called under kvm->srcu read lock */
int kvm_io_bus_read(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx, gpa_t addr,
int len, void *val)
{
--
2.9.4
Powered by blists - more mailing lists