From nobody Fri Dec 19 18:52:12 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 4641E3002AE for ; Thu, 4 Dec 2025 18:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764873976; cv=none; b=KdTsTYMnTv2GoxY3z+ADK+6UZUETmwjWkH2hekte+8O1XaV0ttZvcfVB2X8k51kgMIiLHEBI39BOVqkACVxxRRQdeG7MO9UfaEu/SdnymBrYTES4RbJ2ub7habVii3aQvRXTjpgUruU54yfMBZSHUh9FPkqDv79We1fLlnOW6Z4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764873976; c=relaxed/simple; bh=ixOIT7gBC1pWKudTEU86DEyzo4ic8BfL+pH3/rjQXu0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=a2tmJ8yJ8ZPZzrc5VVZW/I5csFWXx+FSY+YcPGBiyhvQJSTlmR6qKIEGJH3nLAct4ImBRi+5ntlGPzOJ91zixLoKC7Wmr1vUIJN7R5bm38iic72RdHpzRVBC14hnbkL0HRHokPaWhrMOLuAi6kXJPSsk2YGLOtgCgV2yfxr++Bs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=DvPyK2jm; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=lUH8T67Z; arc=none smtp.client-ip=170.10.133.124 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.b="DvPyK2jm"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="lUH8T67Z" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764873973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=U891j5e3VoLi4h2YlpGZwyu+rI6YPUZxSzeS/f8yY78=; b=DvPyK2jm6l5IOzGnVYii0A+3wKzjlBETsiAeotZt/7HYcUv1PLf1wUH8vF45sIcKRsA+/g MDhscvyHFg3lKs23gbfF5ECnjqU2Z/Xi/yTaBfY2avtjfqXsULAmP/9QCmpC9mAyBYq00w hguS1e7N8rZ6fNzVQ95g1aGa9gIUQGk= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-216-E8ffYzzRMT-wUB7b8cs6Hg-1; Thu, 04 Dec 2025 13:46:12 -0500 X-MC-Unique: E8ffYzzRMT-wUB7b8cs6Hg-1 X-Mimecast-MFC-AGG-ID: E8ffYzzRMT-wUB7b8cs6Hg_1764873970 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-42e2e3c3e1aso632380f8f.1 for ; Thu, 04 Dec 2025 10:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1764873969; x=1765478769; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=U891j5e3VoLi4h2YlpGZwyu+rI6YPUZxSzeS/f8yY78=; b=lUH8T67ZMcCvAjRlttU8BmyEfgoQB8s5tVqsxJShdfE1PjPhk43tElhxytpQddFyXy MfZQoFHj7g+voPif3ZiX1GsQvYgFzk3FsCIP6Htf0N1JyGoitm2KHZee5F/PPL78gJE+ iLR/iurWWqm2zLjBK62wJcQQOckvqrPrYVzE8Q8nOyPxk4hpOZddgmEAKhI4E0lUuQq4 5yNTE6iF0PYSE0zKT42HmxPGwgPdLeuChvoPdtDFmvUAQmL8bsEYj69WO9yAzW1STTTp ZqJsmBEX2TiQWt+xtrZ5TQSUOhrjVB5sXiv2hQgl8uqkGEharR7Vj+Z8fq5NuPoshiK9 mgDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764873969; x=1765478769; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U891j5e3VoLi4h2YlpGZwyu+rI6YPUZxSzeS/f8yY78=; b=ZikBgeK8RwzOHn12wOvBWyO8/IHktRHjNMBQZ4fbUAfpWCN7VaXO0D/7/6BrPYeAJD TTVAtCvawBmU7P0k6PSCa24TOduT8HgahzV29t/MoyqqGJZt+Wi6LKfFZpA8Pjo/83O3 1Ze4PxtsEXJPkjlTXip9XxjcBHaqFa0aunkOttc3vjtv9IAT7q/NXhn6PfUHS8CsXY5k ZN3nLxrgN2agZqMkJvPq7ieUAJWq1SjjzouilT8ICILKr4aLfBxsnqeeGIqraK1ijpYp Nr0IuqxJYLgSEnCM936vIpDFhYxB6tRl8lwoDMyT60eJVsQISNc1ncr0nDiIUdfjftvd wjwQ== X-Gm-Message-State: AOJu0YzrRDC2axaEVI/DYVbr25MOoogCDAYosxO2ww/aSIuajQevVdZr NTe4JVvLTSd7usMlNR0Gx+DSSAM+VFgIl4M8NomCYzIXovOMeywjjVXNqadU0iszyUb8XBsNrsi KF9Pef8IXJeV85ewZNNcGCyTDnTjkRtazvwuSyQX+fXQgDW86c4WipJSne+h4aszuUi1c9DQNpu Cj0WVX6Fbgk+3gszsxjBmc9AxfXG/1utIMlypceHpGEcQ= X-Gm-Gg: ASbGncsjWXGXHE6muyhRxSGNcoD79FZbhaLsBdsCJVOzJI0UbUfGNzmkEkIpNTgwhP4 /mvNbx3u2CruI02GAb8/jhIzV17hO6O7vYBqA1TCdp50jV/75k0YZUeiXMEQ/F5QB5vv6BRXxRv 5bS5rfjRncw22z19Jgvb9r+sQ0rg8YzRJ4gLITVqB53EtpnN6ET5Ffrrw5UQ0qEXN5lwDvSLShM KzTF8nZwx3d9RTA9WheCRNke2yQqL53D0IL1mNMbR0aG8nFK+Ets03Rt5daf8gRtTjoeqkbo986 qTh/30D4nTMSx6x7nzUy682gxmo9TEFeUjAFAqvMG9/+i9CY+vqkXdmZ8n3uFE0XzGTuUBvDU9A = X-Received: by 2002:a5d:588e:0:b0:42b:411b:e476 with SMTP id ffacd0b85a97d-42f73171f8dmr8142749f8f.9.1764873969398; Thu, 04 Dec 2025 10:46:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhWokhsrGnJYroHp2metFwEXS1iM+whRYWv0A2+q9F3Y9mz8+yw3WteBIXNycAlKqwIm7Q9w== X-Received: by 2002:a5d:588e:0:b0:42b:411b:e476 with SMTP id ffacd0b85a97d-42f73171f8dmr8142706f8f.9.1764873968835; Thu, 04 Dec 2025 10:46:08 -0800 (PST) Received: from redhat.com ([31.187.78.57]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42f7cbfee5bsm4560090f8f.16.2025.12.04.10.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 10:46:07 -0800 (PST) Date: Thu, 4 Dec 2025 13:46:06 -0500 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Jason Wang , Xuan Zhuo , Eugenio =?utf-8?B?UMOpcmV6?= , virtualization@lists.linux.dev Subject: [PATCH 03/14] tools/virtio: use kernel's virtio.h Message-ID: <33daf1033fc447eb8e3e54d21013ccfd99550e37.1764873799.git.mst@redhat.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace virtio stubs with an include of the kernel header. Signed-off-by: Michael S. Tsirkin --- tools/virtio/linux/virtio.h | 73 +------------------------------------ 1 file changed, 1 insertion(+), 72 deletions(-) diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h index 5d3440f474dd..d3029c944589 100644 --- a/tools/virtio/linux/virtio.h +++ b/tools/virtio/linux/virtio.h @@ -1,72 +1 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef LINUX_VIRTIO_H -#define LINUX_VIRTIO_H -#include -#include -#include - -struct device { - void *parent; -}; - -struct virtio_device { - struct device dev; - u64 features; - struct list_head vqs; - spinlock_t vqs_list_lock; - const struct virtio_config_ops *config; -}; - -struct virtqueue { - struct list_head list; - void (*callback)(struct virtqueue *vq); - const char *name; - struct virtio_device *vdev; - unsigned int index; - unsigned int num_free; - unsigned int num_max; - void *priv; - bool reset; -}; - -/* Interfaces exported by virtio_ring. */ -int virtqueue_add_sgs(struct virtqueue *vq, - struct scatterlist *sgs[], - unsigned int out_sgs, - unsigned int in_sgs, - void *data, - gfp_t gfp); - -int virtqueue_add_outbuf(struct virtqueue *vq, - struct scatterlist sg[], unsigned int num, - void *data, - gfp_t gfp); - -int virtqueue_add_inbuf(struct virtqueue *vq, - struct scatterlist sg[], unsigned int num, - void *data, - gfp_t gfp); - -bool virtqueue_kick(struct virtqueue *vq); - -void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len); - -void virtqueue_disable_cb(struct virtqueue *vq); - -bool virtqueue_enable_cb(struct virtqueue *vq); -bool virtqueue_enable_cb_delayed(struct virtqueue *vq); - -void *virtqueue_detach_unused_buf(struct virtqueue *vq); -struct virtqueue *vring_new_virtqueue(unsigned int index, - unsigned int num, - unsigned int vring_align, - struct virtio_device *vdev, - bool weak_barriers, - bool ctx, - void *pages, - bool (*notify)(struct virtqueue *vq), - void (*callback)(struct virtqueue *vq), - const char *name); -void vring_del_virtqueue(struct virtqueue *vq); - -#endif +#include <../../include/linux/virtio.h> --=20 MST