From nobody Thu Oct 9 16:33:25 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 BB1101547C0; Tue, 17 Jun 2025 00:19:02 +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=1750119544; cv=none; b=VHM1cYgsU5c4wjGP1zSsXX3hyNa6c8IP0PDNZ8SxEgqaLSJu6a3N5GrE4VDJ2Vtv+F/8fQJkorouDpy38prIjTFvHh/OH5aCzbIDRKsXKppHWOxuk1eexyxpErlEhUanyc8o+Xt5XCOyOi91dNNhBTEjUH/4H+S5/neDkptN/4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750119544; c=relaxed/simple; bh=LOoJjdxUB4Ub7LbtajDLb1UlDqZtd2NrF0DqNmtC0PU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uubxagjvEIqaw3zENQ3HJN/1+DxBKiiQ5xdwUihIqKrN1WRH59NQpjbeJA1etH5kidoMpfHR0i+Pgt3nk+84ZXj3agImR2u28V+byZMBZL1erej84k+u04WvOzyMTiSLBbKPGUJ1X3aRtXPFcak4EJjFYkiejcyDeEdlYd/G3uY= 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=WlwaeUTp; 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="WlwaeUTp" 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=nTlx+GYsiiaRpQjioGAK5Ofohl0JMzdQaTv4jSqczjA=; b=WlwaeUTpAoX3HvWa rIcboywP00Cdu/Nqmu8C3qOiOxAmMYlmmE/fCnh3cUztHEoPdNR/f92ZnKHACZxgs2kKIteTrbm7m Cnrue6rXcvkgQ3YSlFRXxSsDyKM7v9Bx7hu5ETv8HVyEelE3As7EmQbZuhHJC59RhdF+WjllB8ua2 hQiLcQ8j46b2EMYFLcRmuy4zUdB9BmNi7qr8n4imh0J6f6dPTaZIRo1Wfp8L0fZnkB+NwGZdyRAg2 5Qd762bsXVNKC1KHaIy+7HTz3CbYVdLFitefWhOW3dNOa1BtEzwHBYHhGPNmvkVzARlBg/s8DN8sB MrZVo6LRLGsEiJC4/Q==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1uRK2L-009znJ-2E; Tue, 17 Jun 2025 00:18:49 +0000 From: linux@treblig.org To: mst@redhat.com, horms@kernel.org, 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 v2 1/2] vhost: vringh: Remove unused iotlb functions Date: Tue, 17 Jun 2025 01:18:36 +0100 Message-ID: <20250617001838.114457-2-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250617001838.114457-1-linux@treblig.org> References: <20250617001838.114457-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 Acked-by: Eugenio P=C3=A9rez Tested-by: Lei Yang --- 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 Thu Oct 9 16:33:25 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 938D21C683; Tue, 17 Jun 2025 00:19:00 +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=1750119542; cv=none; b=klFqAX0kp/grkrX9JUe4kHNhAh90ZLs5bGRXjmnQFZtmS8sq1H9h2jG9cTJ2DaUjUMxKX4YGFHuDBUAOFV+DjpaT65WhJhxe8S68xG+5aPEWNyu0YDJLn7u/It0O1hl2npnwtuE9THW6P7SJJn8GBgLV4zvD1BPNktgz1+YWyds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750119542; c=relaxed/simple; bh=y3q/CK06lk9lk76b5nH9YzG1AhihlSPk87sJ8wCMgV0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YPHGFj0/5eLliqmIZBUG6eQvQHrDkg+cgub6qQC1JY8PyRN/AyBefg6tGkpkOfMM9/SWXY4h2Hxih6nm+StIY6ZYX9Mm9Ryjge157/2xDPzMXkP/YIfqKwawrnteWdddaBD8PKPZKTFazZpCglEJ6nT/U/VQC5VpfEssbDZ8PtU= 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=J1vuX/AG; 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="J1vuX/AG" 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=l+NrzISvaKK3MwfDhAbTRjiy+gg6Cgp/SV3R9ADgnOE=; b=J1vuX/AGQ5rhOACo REraBkeNzm/4qYaEuWKpfcr4GCD7ubsMBWowg8taeNv0h8GzHrzJ1JAqgwEzIX+UQxH8P+DShHEHb eC9lHAVfpODTcWV2pZThLfcCKzJK6mguv52Hl7u/3CVoha1ml2/ushJ5C8NUR7GTbIqszgYdr6ueq Z8y+NYNEGjG6E175jp/5FGRBQ7SHRBJ8Xe4USGseo7w2ycLiT8P8zoZtmUovuZkSqT9AvirDMlpI1 /bE9uXdE0SWbiBjOCFIDM6Ao3uFIZoDtR4dgFvTvhNdc6q/B7OGBS/97ct99A4kBHQ5+pgFoVGB9D CM5aOPnmFP6a3Zweog==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1uRK2M-009znJ-1O; Tue, 17 Jun 2025 00:18:50 +0000 From: linux@treblig.org To: mst@redhat.com, horms@kernel.org, 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 v2 2/2] vhost: vringh: Remove unused functions Date: Tue, 17 Jun 2025 01:18:37 +0100 Message-ID: <20250617001838.114457-3-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250617001838.114457-1-linux@treblig.org> References: <20250617001838.114457-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 and the two helper functions they used. Signed-off-by: Dr. David Alan Gilbert Acked-by: Eugenio P=C3=A9rez Reviewed-by: Simon Horman Tested-by: Lei Yang --- drivers/vhost/vringh.c | 75 ------------------------------------------ include/linux/vringh.h | 7 ---- 2 files changed, 82 deletions(-) diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 67a028d6fb5f..9f27c3f6091b 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. @@ -900,20 +884,6 @@ static inline int putused_kern(const struct vringh *vr= h, return 0; } =20 -static inline int xfer_kern(const struct vringh *vrh, void *src, - void *dst, size_t len) -{ - memcpy(dst, src, len); - return 0; -} - -static inline int kern_xfer(const struct vringh *vrh, void *dst, - void *src, size_t len) -{ - memcpy(dst, src, len); - return 0; -} - /** * vringh_init_kern - initialize a vringh for a kernelspace vring. * @vrh: the vringh to initialize. @@ -998,51 +968,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