From nobody Tue Dec 16 17:19:14 2025 Received: from baidu.com (mx22.baidu.com [220.181.50.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51FD224B28; Tue, 6 May 2025 01:23:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.181.50.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746494602; cv=none; b=MBShooi3bRhLEBrMZkPUq79o2sY1stmN0mY0xETlkY4Ei20XfDPFMssKeK6IZfwFaZDIcmqJjaybF/RnxMNavy2DJRglOfBkqXJwsqGWDOtKGhPTiDAQJdogEGpAqUSPncZE+efv9jF1DRHLHRsRX1A3xzNzZ1DbWmCapasSiGw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746494602; c=relaxed/simple; bh=Rz5mAkcAfO2eGMS9ePIIhXXsMu0PG+vS7H048NPddfY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JeFrgEqPc2Ql8IIUd3BI2WWuZWp/A0nSQYyG5ZDLsxdQL+1RhD7jfsePRmmjQ9X8GP1BjCVIFVUuNb7u2H0xi2XBrIGHK/XdnVq9Pc076FudDIeIyhkRZBB09tObGOh6QNZtgYJEFwTg8qiyCxMdLi8vWwlNmUvNJU+l0PrrQEg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com; spf=pass smtp.mailfrom=baidu.com; arc=none smtp.client-ip=220.181.50.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baidu.com From: lirongqing To: , , , CC: Li RongQing Subject: [PATCH][v2] KVM: Remove obsolete comment about locking for kvm_io_bus_read/write Date: Tue, 6 May 2025 09:22:51 +0800 Message-ID: <20250506012251.2613-1-lirongqing@baidu.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: BC-Mail-Ex14.internal.baidu.com (172.31.51.54) To BJHW-Mail-Ex15.internal.baidu.com (10.127.64.38) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex15_2025-05-06 09:22:59:713 X-FEAS-Client-IP: 10.127.64.38 X-FE-Policy-ID: 52:10:53:SYSTEM Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Li RongQing Nobody is actually calling these functions with slots_lock held, The srcu_dereference() in kvm_io_bus_read/write() precisely communicates both what is being protected, and what provides the protection. so the comments are no longer needed Suggested-by: Sean Christopherson Signed-off-by: Li RongQing --- Diff with v1: Remove comments, instead of fixing virt/kvm/kvm_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index e85b33a..d9fe087 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -5774,7 +5774,6 @@ static int __kvm_io_bus_write(struct kvm_vcpu *vcpu, = struct kvm_io_bus *bus, return -EOPNOTSUPP; } =20 -/* kvm_io_bus_write - called under kvm->slots_lock */ int kvm_io_bus_write(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx, gpa_t ad= dr, int len, const void *val) { @@ -5795,7 +5794,6 @@ int kvm_io_bus_write(struct kvm_vcpu *vcpu, enum kvm_= bus bus_idx, gpa_t addr, } EXPORT_SYMBOL_GPL(kvm_io_bus_write); =20 -/* kvm_io_bus_write_cookie - called under kvm->slots_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 +5843,6 @@ static int __kvm_io_bus_read(struct kvm_vcpu *vcpu, s= truct kvm_io_bus *bus, return -EOPNOTSUPP; } =20 -/* kvm_io_bus_read - called under kvm->slots_lock */ int kvm_io_bus_read(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx, gpa_t add= r, int len, void *val) { --=20 2.9.4