From nobody Fri Oct 10 09:39:02 2025 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (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 50AC5279DD6; Fri, 13 Jun 2025 23:07:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749856062; cv=none; b=Ti0ey0Y4wVis7WnQVjHJWkO0Ke1F0LA10U1LgVExrky43s3/XGP1Q2470gUr88p2XV0FktjL2wFtblxZRHYdfNs3qz5Hmj8MVEdFiyKmxW4jgWBY/vGDYhZVfr/j+ESX/g77Ch1aqz2HWhVhIFBbJM2PH2n4+uoioELuzS99TJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749856062; c=relaxed/simple; bh=ECoZ5+TP9aQskq5NYHIIj6ItZgwamalNqUH6JikShnM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BzIct//shas8qGzU3Sg6CNtJm574ejP99q50NCXiehoqJaYntUc4HgIf8fXRX5wu1MXfNMzn5EdHKui0aJ6faj6TFWKuIO287fKQb2jX8HrqilWFxyrfzMRHPse74mhj+cV3vSQaAVOay3KvWLI7XZ1OmEibwuA5ttf7Avrbf6M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=HBh3tjv/; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="HBh3tjv/" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=yXxGDOj4zoKlS3Ljt5GLp0sLLRwyFJizlLysOBFNGd8=; b=HBh3tjv/aw40mvzC gE5dV06eLTHjjfWCaov5D1ZeFi08W+vMH4xNa3WSJ6frppYS5AWO6S4ajwgAtB9hqFq8OY8+OSjQ9 8b/0epiPxv3ZMhvTtAJMaEQNzWYYdLuWtRcfz6wCDqKKQSjhe1RLlGn3+cX/Y4ymBxDvcWK3oAxHi QV+N8fgSDtT08IVhebVmetpXXTSOAMpHnk+OGpicYZ9aBqM2rILh9RWhK38YwgcjHGuSofy1qEnfX 4QvJonQETaNgIgzFZ7PcYFsRcMI2Bs3VmqL0DLnwQJ1qdgGdHrKgrx38yJ6NXCpv8pMmrCDsNkZe9 jx450mnrZYZt1bdcFw==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1uQDUi-009ZoB-1P; Fri, 13 Jun 2025 23:07:32 +0000 From: linux@treblig.org To: mst@redhat.com, jasowang@redhat.com, eperezma@redhat.com, xuanzhuo@linux.alibaba.com Cc: kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 1/2] vhost: vringh: Remove unused iotlb functions Date: Sat, 14 Jun 2025 00:07:30 +0100 Message-ID: <20250613230731.573512-2-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250613230731.573512-1-linux@treblig.org> References: <20250613230731.573512-1-linux@treblig.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" The functions: vringh_abandon_iotlb() vringh_notify_disable_iotlb() and vringh_notify_enable_iotlb() were added in 2020 by commit 9ad9c49cfe97 ("vringh: IOTLB support") but have remained unused. Remove them. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Simon Horman --- drivers/vhost/vringh.c | 43 ------------------------------------------ include/linux/vringh.h | 5 ----- 2 files changed, 48 deletions(-) diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index bbce65452701..67a028d6fb5f 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -1534,23 +1534,6 @@ ssize_t vringh_iov_push_iotlb(struct vringh *vrh, } EXPORT_SYMBOL(vringh_iov_push_iotlb); =20 -/** - * vringh_abandon_iotlb - we've decided not to handle the descriptor(s). - * @vrh: the vring. - * @num: the number of descriptors to put back (ie. num - * vringh_get_iotlb() to undo). - * - * The next vringh_get_iotlb() will return the old descriptor(s) again. - */ -void vringh_abandon_iotlb(struct vringh *vrh, unsigned int num) -{ - /* We only update vring_avail_event(vr) when we want to be notified, - * so we haven't changed that yet. - */ - vrh->last_avail_idx -=3D num; -} -EXPORT_SYMBOL(vringh_abandon_iotlb); - /** * vringh_complete_iotlb - we've finished with descriptor, publish it. * @vrh: the vring. @@ -1571,32 +1554,6 @@ int vringh_complete_iotlb(struct vringh *vrh, u16 he= ad, u32 len) } EXPORT_SYMBOL(vringh_complete_iotlb); =20 -/** - * vringh_notify_enable_iotlb - we want to know if something changes. - * @vrh: the vring. - * - * This always enables notifications, but returns false if there are - * now more buffers available in the vring. - */ -bool vringh_notify_enable_iotlb(struct vringh *vrh) -{ - return __vringh_notify_enable(vrh, getu16_iotlb, putu16_iotlb); -} -EXPORT_SYMBOL(vringh_notify_enable_iotlb); - -/** - * vringh_notify_disable_iotlb - don't tell us if something changes. - * @vrh: the vring. - * - * This is our normal running state: we disable and then only enable when - * we're going to sleep. - */ -void vringh_notify_disable_iotlb(struct vringh *vrh) -{ - __vringh_notify_disable(vrh, putu16_iotlb); -} -EXPORT_SYMBOL(vringh_notify_disable_iotlb); - /** * vringh_need_notify_iotlb - must we tell the other side about used buffe= rs? * @vrh: the vring we've called vringh_complete_iotlb() on. diff --git a/include/linux/vringh.h b/include/linux/vringh.h index c3a8117dabe8..af8bd2695a7b 100644 --- a/include/linux/vringh.h +++ b/include/linux/vringh.h @@ -319,13 +319,8 @@ ssize_t vringh_iov_push_iotlb(struct vringh *vrh, struct vringh_kiov *wiov, const void *src, size_t len); =20 -void vringh_abandon_iotlb(struct vringh *vrh, unsigned int num); - int vringh_complete_iotlb(struct vringh *vrh, u16 head, u32 len); =20 -bool vringh_notify_enable_iotlb(struct vringh *vrh); -void vringh_notify_disable_iotlb(struct vringh *vrh); - int vringh_need_notify_iotlb(struct vringh *vrh); =20 #endif /* CONFIG_VHOST_IOTLB */ --=20 2.49.0 From nobody Fri Oct 10 09:39:02 2025 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (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 4E0902798EF; Fri, 13 Jun 2025 23:07:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749856062; cv=none; b=d9asnONznc0dyht4pP7jHLr5XiQdnAQj3EV4rgTrCxM25j/AMm/U/P8xDwSUYaYGgXC0sOVAuDafcSsgNGnIsyCvCEeZq5bT/urnIPE57gr/wNSpi6u4VaonvyZR749LxpPvk8FIuhDB2bIEdg6abPZbGAdiRAUPIs2EjKd3HXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749856062; c=relaxed/simple; bh=5LBmNvxGQVphTBm+dhvh3993X6dnlRF+TMf6MHhy5xI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S1UV5PdmhU6EJlHqRfw0uEjxj/ukV8NoErX86ghwFht0/alIJCjzJ4prbt2QLCjgnIb1EFIj9lzbLgh0WvsZhcE3V4nKd/tVGIpPt5tmT8D6J9L/+R6N8RcJckSa3TY75wwC6O0zEz2kfyKAit6r/cMI2QzThcUxoJXK/AYufd8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=WQrD3AGd; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="WQrD3AGd" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=waQo5q91jU8Ji7flII4J5+MFXZhCzcoj/TS8hqA7oVQ=; b=WQrD3AGd8Ew03Pa6 GjvTc8x4Y+t+pUy1C2N1njppwCWMEBFmRE+zmRqQArYR4JS3JF/6i0mXBznS6Gv0C6XdR29EA1pHx 42NwtvJpSSLgR3Fd4XP0+OSIZpZKnqgImYpSM/bcaOoYPEnNzIdzBGvQmBTQG0L5MtZwCNbUgQC2z DC7vmIfpMWHYxKmNIwoKTKu9GMdLjo+/Uu9goVvBVlBgJlRTMsihvXo3U7Nxq0miyx1uaDfN33XME L62K8QnbUtZhCzrmfPglJDFLtB9OQShfqf2gn9OGZ6ABa0TIOBB7a5oX8SYYXph1KQWKqTtjvycPT XhyqWqe2F2/q5d3/ZA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1uQDUj-009ZoB-08; Fri, 13 Jun 2025 23:07:33 +0000 From: linux@treblig.org To: mst@redhat.com, jasowang@redhat.com, eperezma@redhat.com, xuanzhuo@linux.alibaba.com Cc: kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 2/2] vhost: vringh: Remove unused functions Date: Sat, 14 Jun 2025 00:07:31 +0100 Message-ID: <20250613230731.573512-3-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250613230731.573512-1-linux@treblig.org> References: <20250613230731.573512-1-linux@treblig.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" The functions: vringh_abandon_kern() vringh_abandon_user() vringh_iov_pull_kern() and vringh_iov_push_kern() were all added in 2013 by commit f87d0fbb5798 ("vringh: host-side implementation of virtio rings.") but have remained unused. Remove them. Signed-off-by: Dr. David Alan Gilbert --- drivers/vhost/vringh.c | 61 ------------------------------------------ include/linux/vringh.h | 7 ----- 2 files changed, 68 deletions(-) diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 67a028d6fb5f..c99070da39a6 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -779,22 +779,6 @@ ssize_t vringh_iov_push_user(struct vringh_iov *wiov, } EXPORT_SYMBOL(vringh_iov_push_user); =20 -/** - * vringh_abandon_user - we've decided not to handle the descriptor(s). - * @vrh: the vring. - * @num: the number of descriptors to put back (ie. num - * vringh_get_user() to undo). - * - * The next vringh_get_user() will return the old descriptor(s) again. - */ -void vringh_abandon_user(struct vringh *vrh, unsigned int num) -{ - /* We only update vring_avail_event(vr) when we want to be notified, - * so we haven't changed that yet. */ - vrh->last_avail_idx -=3D num; -} -EXPORT_SYMBOL(vringh_abandon_user); - /** * vringh_complete_user - we've finished with descriptor, publish it. * @vrh: the vring. @@ -998,51 +982,6 @@ int vringh_getdesc_kern(struct vringh *vrh, } EXPORT_SYMBOL(vringh_getdesc_kern); =20 -/** - * vringh_iov_pull_kern - copy bytes from vring_iov. - * @riov: the riov as passed to vringh_getdesc_kern() (updated as we consu= me) - * @dst: the place to copy. - * @len: the maximum length to copy. - * - * Returns the bytes copied <=3D len or a negative errno. - */ -ssize_t vringh_iov_pull_kern(struct vringh_kiov *riov, void *dst, size_t l= en) -{ - return vringh_iov_xfer(NULL, riov, dst, len, xfer_kern); -} -EXPORT_SYMBOL(vringh_iov_pull_kern); - -/** - * vringh_iov_push_kern - copy bytes into vring_iov. - * @wiov: the wiov as passed to vringh_getdesc_kern() (updated as we consu= me) - * @src: the place to copy from. - * @len: the maximum length to copy. - * - * Returns the bytes copied <=3D len or a negative errno. - */ -ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, - const void *src, size_t len) -{ - return vringh_iov_xfer(NULL, wiov, (void *)src, len, kern_xfer); -} -EXPORT_SYMBOL(vringh_iov_push_kern); - -/** - * vringh_abandon_kern - we've decided not to handle the descriptor(s). - * @vrh: the vring. - * @num: the number of descriptors to put back (ie. num - * vringh_get_kern() to undo). - * - * The next vringh_get_kern() will return the old descriptor(s) again. - */ -void vringh_abandon_kern(struct vringh *vrh, unsigned int num) -{ - /* We only update vring_avail_event(vr) when we want to be notified, - * so we haven't changed that yet. */ - vrh->last_avail_idx -=3D num; -} -EXPORT_SYMBOL(vringh_abandon_kern); - /** * vringh_complete_kern - we've finished with descriptor, publish it. * @vrh: the vring. diff --git a/include/linux/vringh.h b/include/linux/vringh.h index af8bd2695a7b..49e7cbc9697a 100644 --- a/include/linux/vringh.h +++ b/include/linux/vringh.h @@ -175,9 +175,6 @@ int vringh_complete_multi_user(struct vringh *vrh, const struct vring_used_elem used[], unsigned num_used); =20 -/* Pretend we've never seen descriptor (for easy error handling). */ -void vringh_abandon_user(struct vringh *vrh, unsigned int num); - /* Do we need to fire the eventfd to notify the other side? */ int vringh_need_notify_user(struct vringh *vrh); =20 @@ -235,10 +232,6 @@ int vringh_getdesc_kern(struct vringh *vrh, u16 *head, gfp_t gfp); =20 -ssize_t vringh_iov_pull_kern(struct vringh_kiov *riov, void *dst, size_t l= en); -ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, - const void *src, size_t len); -void vringh_abandon_kern(struct vringh *vrh, unsigned int num); int vringh_complete_kern(struct vringh *vrh, u16 head, u32 len); =20 bool vringh_notify_enable_kern(struct vringh *vrh); --=20 2.49.0