From nobody Fri Dec 19 18:52:09 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 C1CD833F37F for ; Thu, 4 Dec 2025 18:46:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764873993; cv=none; b=QhuGnYaGvwzR1Du9sONVK/sAHNehlxkmWyhBpkCwPfEMleyBWNBYsDvrhEtjRUS7OYtMJkdq2OXDWnKOOY0/h+3IUgzyQkULLdOrmLFkyGA+i9snRLWJNR8K0tnzozYe6rFSvIuLDnmVJYZWMfTiy0vhfI+osaY/Oxuxm1iKjOo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764873993; c=relaxed/simple; bh=6qSPIQNvDSN9byLvC1hB5tTrrcXcXB4AZ7/2aqOOQcM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gdSkfHbMHu/wGWXRGEIV+ygE4WYbe3wmLHRdzUuDCJbJTdMXyW0QHlFHO7pPyrLrNuqI15fwZ4GeHr4ZFBI6Utb2TKkfynNODq1BAi+TAABF4TnaPXOV6tL9qlXlgYTwNKX1X4eBDFEkJFqoilnA0JhAj1INmPMJe6Vnq3ksMpc= 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=QEyCHRqZ; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=FFWHjLuF; arc=none smtp.client-ip=170.10.129.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="QEyCHRqZ"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="FFWHjLuF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764873990; 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=bES/x3uRbK5GEMVnke1YpYjyE02M84Cb/sOR55KODgI=; b=QEyCHRqZdSUUkjvyPUKty3yJIuC99ABVP9mHcVKWhG1G6PDEuLlOuocPWrR7t82ONciKKb contz43gv7Oa3ILiyB3onkz1U27ZGxaRA/+6/EcdVHcadK/0p/2OOFm4gXpRDStHBCZTr3 l5PyeTf9ikBnzOWvc9Nw/IHREc2aheY= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-403-gZvUN5kzMVuTPQQsbh0MFg-1; Thu, 04 Dec 2025 13:46:29 -0500 X-MC-Unique: gZvUN5kzMVuTPQQsbh0MFg-1 X-Mimecast-MFC-AGG-ID: gZvUN5kzMVuTPQQsbh0MFg_1764873988 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-477a1e2b372so9802575e9.2 for ; Thu, 04 Dec 2025 10:46:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1764873988; x=1765478788; 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=bES/x3uRbK5GEMVnke1YpYjyE02M84Cb/sOR55KODgI=; b=FFWHjLuFL+tzBrrsgiHjNppE5bNyeuUBlTRRtQwtN9F21Seuk3iEtLYtTHdDSgpWvl M/ZsWg8eFHAEv7G6zLdlTf68+qykdtretzP4sMVaBl6OS3rs8/PU5COtXn1DHagg5byB ILN1zeSvuDPtpYvfdIiOcNpkDpQBwqrJOrQaouWjzNMmw9soMYeAQ0R5mi9aMXI79mDA /1/A8cKQLqIQG9mR7ialvFQVyUQISD9/h5KDt1muSqtxBYXSwKyElUO3AXSLnPBZRuaX g0tbqF0GBHwlvi7zssggMyevGSBYqbwXPfk9sog8MShQEBaitAd43dxrOmm0J14k4ZOW tM/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764873988; x=1765478788; 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=bES/x3uRbK5GEMVnke1YpYjyE02M84Cb/sOR55KODgI=; b=VpkopHwWAB4dHvwgg70E7iN55GwcLHiVu9EC1ukLhulYxpgglLJ/T0n2CdtqF89ADk sf7Q2YJHgIm0thkWeaFMIA39A1EIb0RSD8ylNu8aQt0sQC/un9XAU8TP9Vl6RAlchsWb uCdChy1/TVaThQzRK0LWKIsTYVQhabwhAbeo2/URr03AId7E7TcIFAedflKqavpqma3X 0bBy9e8j8oOvi0zW6JDwRjGzDbEjWDidMZcZ8FSJtSpPMqo+zvSMFL4BB1vesd1zToq8 Vo3h47AoziU4qYw/ewaInUoxR1uzktLSD9fHTllesV+QCKxg4b8sFcmqE555sDXglA2L FLqg== X-Gm-Message-State: AOJu0YyPv44jp8HG8p+qC9ze8R7r257BoDsrjTirJmnjZybcT3t5dBac fnCSiVepnKM9MHEPQkwDhT0mxI3sdEFJgsJIzEyXdoFBakWLKr5gfg1ko+zUAlGqVbIlnznD8BJ wD/rABiE+dag5oMTf66oKf73kiRv6X5JcL1FigcEEFgjvvOAfMD5u2KD43Q0GGbDrwSiItGndod YAbq6Anny7yBswjw+kWQK7fpRcpwcZoLAN8txuOUg9k6Y= X-Gm-Gg: ASbGncsltPQ4+UkTQAbO06u/kNiszz40UaX7bak219OGPUyHfNuttu/3IQaifabkZ/Y 6GTUcP3WD8WCMmqUWGpUyW2gMEBEXCHYsSs3NZKLVqt+W6cwZLvRkgPkBycGZBhdu0XoIx71hfL iNALgWG4wvin4C4KjjyUq6Gp+KWxUdLsbiRgyh5BGZdP7dwwa4KOV6lDx48+SSaXZKvx1EpULE/ RXK7WcAkwxGc2ZTerwcQnGga97Z8AXYbk2m6s++81vvqO/sgQGebUauHIvdymgdxYmD+YVudB/Q 3I7YVAnXUj1bdjV8neeyhfLxh88mQmH6VJSHVfrwGpaQLyyCLCoem4D+ENRK/3QFhzXBGCq0RGw = X-Received: by 2002:a05:600c:3ba8:b0:477:755b:5587 with SMTP id 5b1f17b1804b1-4792aeeb522mr73371385e9.8.1764873988164; Thu, 04 Dec 2025 10:46:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5VYL8/Jo7qxIJUuIOY0+ZbRuBK1Fcetv9Z2YtYqoi0233HhToF14XrdWEChAqY58zSszdGA== X-Received: by 2002:a05:600c:3ba8:b0:477:755b:5587 with SMTP id 5b1f17b1804b1-4792aeeb522mr73371105e9.8.1764873987679; Thu, 04 Dec 2025 10:46:27 -0800 (PST) Received: from redhat.com ([31.187.78.57]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47930ca15adsm46541205e9.13.2025.12.04.10.46.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 10:46:27 -0800 (PST) Date: Thu, 4 Dec 2025 13:46:25 -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 11/14] tools/virtio: switch to kernel's virtio_config.h Message-ID: <8e5c85dc8aad001f161f7e2d8799ffbccfc31381.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" Drops stubs in virtio_config.h, use the kernel's version instead - we are now activly developing it, so the stub became too hard to maintain. Signed-off-by: Michael S. Tsirkin --- tools/virtio/linux/virtio_config.h | 102 +---------------------------- 1 file changed, 1 insertion(+), 101 deletions(-) diff --git a/tools/virtio/linux/virtio_config.h b/tools/virtio/linux/virtio= _config.h index 42a564f22f2d..a0cd3f9a3111 100644 --- a/tools/virtio/linux/virtio_config.h +++ b/tools/virtio/linux/virtio_config.h @@ -1,101 +1 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef LINUX_VIRTIO_CONFIG_H -#define LINUX_VIRTIO_CONFIG_H -#include -#include -#include - -struct virtio_config_ops { - int (*disable_vq_and_reset)(struct virtqueue *vq); - int (*enable_vq_after_reset)(struct virtqueue *vq); -}; - -/* - * __virtio_test_bit - helper to test feature bits. For use by transports. - * Devices should normally use virtio_has_feature, - * which includes more checks. - * @vdev: the device - * @fbit: the feature bit - */ -static inline bool __virtio_test_bit(const struct virtio_device *vdev, - unsigned int fbit) -{ - return vdev->features & (1ULL << fbit); -} - -/** - * __virtio_set_bit - helper to set feature bits. For use by transports. - * @vdev: the device - * @fbit: the feature bit - */ -static inline void __virtio_set_bit(struct virtio_device *vdev, - unsigned int fbit) -{ - vdev->features |=3D (1ULL << fbit); -} - -/** - * __virtio_clear_bit - helper to clear feature bits. For use by transport= s. - * @vdev: the device - * @fbit: the feature bit - */ -static inline void __virtio_clear_bit(struct virtio_device *vdev, - unsigned int fbit) -{ - vdev->features &=3D ~(1ULL << fbit); -} - -#define virtio_has_feature(dev, feature) \ - (__virtio_test_bit((dev), feature)) - -/** - * virtio_has_dma_quirk - determine whether this device has the DMA quirk - * @vdev: the device - */ -static inline bool virtio_has_dma_quirk(const struct virtio_device *vdev) -{ - /* - * Note the reverse polarity of the quirk feature (compared to most - * other features), this is for compatibility with legacy systems. - */ - return !virtio_has_feature(vdev, VIRTIO_F_ACCESS_PLATFORM); -} - -static inline bool virtio_is_little_endian(struct virtio_device *vdev) -{ - return virtio_has_feature(vdev, VIRTIO_F_VERSION_1) || - virtio_legacy_is_little_endian(); -} - -/* Memory accessors */ -static inline u16 virtio16_to_cpu(struct virtio_device *vdev, __virtio16 v= al) -{ - return __virtio16_to_cpu(virtio_is_little_endian(vdev), val); -} - -static inline __virtio16 cpu_to_virtio16(struct virtio_device *vdev, u16 v= al) -{ - return __cpu_to_virtio16(virtio_is_little_endian(vdev), val); -} - -static inline u32 virtio32_to_cpu(struct virtio_device *vdev, __virtio32 v= al) -{ - return __virtio32_to_cpu(virtio_is_little_endian(vdev), val); -} - -static inline __virtio32 cpu_to_virtio32(struct virtio_device *vdev, u32 v= al) -{ - return __cpu_to_virtio32(virtio_is_little_endian(vdev), val); -} - -static inline u64 virtio64_to_cpu(struct virtio_device *vdev, __virtio64 v= al) -{ - return __virtio64_to_cpu(virtio_is_little_endian(vdev), val); -} - -static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 v= al) -{ - return __cpu_to_virtio64(virtio_is_little_endian(vdev), val); -} - -#endif +#include "../../include/linux/virtio_config.h" --=20 MST