From nobody Sat Feb 7 05:49:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769419419; cv=none; d=zohomail.com; s=zohoarc; b=lZ3w8jf33CqV3sF223mGzTC+LK1imLYRQKlVr1Y1MGbzSJlm8jrXPYD2NucNOyjHmTQfK2dPAQOIlTULFVvgSHRrjRPBETtOV2uumRN48veQ2YKMHUAkkaxZFIcrJo1Agxg+UC38CuS6JIomE3B25MCtpL9VBjF63F8jp4HLakg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769419419; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gYgRz7jr5GNyxrbwjf9WtD4Etbl+LMoXUeu3rrxpWiM=; b=P7iq3EXetKV/WVy28OdR/Vwv+cKw3cTof/nwzEGXtr8RdUqdCMFuKQoLrKsAlDnj2tVmPDhb42eTElThvH2KRyVyFzHocFXYgRD3ZBVb6Z6fsDbkDA1wjmPzJw+9kv9REzWdfs6wM7AO3EO7l8mcOyUtel8ZZlUan6Q7EZ5LWr8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769419419322547.8637888373861; Mon, 26 Jan 2026 01:23:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkInm-0001qB-S0; Mon, 26 Jan 2026 04:22:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkInh-0001lK-V1 for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkIne-0005te-Um for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:25 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-368-OSiFwXFIOhK8MERg8xddGA-1; Mon, 26 Jan 2026 04:22:20 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AEF4319775A5; Mon, 26 Jan 2026 09:22:18 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.175]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EB1BB1956095; Mon, 26 Jan 2026 09:22:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769419342; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gYgRz7jr5GNyxrbwjf9WtD4Etbl+LMoXUeu3rrxpWiM=; b=a/xFFmqt+ZHnNX06dYpAVB3211E+cjfQgKSZfy5cuknQJZHTw3SPzJe7WqJ6lkN9z+PVWy bDWzIsyfhlAVwNSEm+JeZhToD/7lA/smClXElYr13Nb9zpjUSt2ljF2ZVm/M9j3SCZpSLL qcBAv4FFANvzblJFeo7uyNv+dEZJs3w= X-MC-Unique: OSiFwXFIOhK8MERg8xddGA-1 X-Mimecast-MFC-AGG-ID: OSiFwXFIOhK8MERg8xddGA_1769419339 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Zhenzhong Duan , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 1/7] vfio/migration: Fix page size calculation Date: Mon, 26 Jan 2026 10:22:06 +0100 Message-ID: <20260126092212.503162-2-clg@redhat.com> In-Reply-To: <20260126092212.503162-1-clg@redhat.com> References: <20260126092212.503162-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769419421385158500 From: Zhenzhong Duan Coverity detected an issue of left shifting int by more than 31 bits leading to undefined behavior. In practice bcontainer->dirty_pgsizes always have some common page sizes when dirty tracking is supported. Resolves: Coverity CID 1644186 Resolves: Coverity CID 1644187 Resolves: Coverity CID 1644188 Fixes: 46c763311419 ("vfio/migration: Add migration blocker if VM memory is= too large to cause unmap_bitmap failure"). Suggested-by: C=C3=A9dric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260116060315.65723-1-zhenzhong.d= uan@intel.com Signed-off-by: C=C3=A9dric Le Goater --- hw/vfio/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index f857dc25ed4d0f824bdabc168228a5e925ac7dbe..b4695030c7295f318faf1d12ac4= 8ba951aa943c7 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -1173,7 +1173,7 @@ static bool vfio_dirty_tracking_exceed_limit(VFIODevi= ce *vbasedev) * can also switch to use IOMMUFD backend if there is a need to migrate * large VM. */ - page_size =3D 1 << ctz64(bcontainer->dirty_pgsizes); + page_size =3D 1ULL << ctz64(bcontainer->dirty_pgsizes); max_size =3D bcontainer->max_dirty_bitmap_size * BITS_PER_BYTE * page_= size; =20 return current_machine->ram_size > max_size; --=20 2.52.0 From nobody Sat Feb 7 05:49:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769419418; cv=none; d=zohomail.com; s=zohoarc; b=aIYx/7DYNFI6VNnpkbOn6dP6VD5OU97YPe6bDS8BCCYjDoczlkS1CP/wi4/Xotw5y9ut2F3J6L0IpHJYCLr2cPj3bdHGndRu6fYXxlrhfkQhgjPS0Ukxx2P2DQjU4BSfl3JhMV8CK9CdlWI5BmRzPfmekJDK9MrIOnrE3Y4MVOI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769419418; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kFGSyUH8rotNFk+Zp/oHgCXJPYMdGYVHu4ViuZY5iY8=; b=CpCUI93jTEXYgJocA8Zyw/aRWzX03WW/VAVXDY/cpTUa9q5ruNy+wW4SKYl7IBmPUWQUHg/6deCGz4dwE4a3pj0flH1EvBGBcfWeZNyQo4K2+PkGo7c5Ge4a2ojD/VR6bLEQ9hRdEjecKx8dtxp3SBHxXWO5IZIay2WD+bE3/CI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17694194188911001.7548160270424; Mon, 26 Jan 2026 01:23:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkInq-0001sD-I5; Mon, 26 Jan 2026 04:22:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkInk-0001oe-CK for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkIni-0005uH-J4 for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:27 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-284-E1p3p5WvNB6Co8weyAni6w-1; Mon, 26 Jan 2026 04:22:21 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D1F591955D9F; Mon, 26 Jan 2026 09:22:20 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.175]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 161241956053; Mon, 26 Jan 2026 09:22:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769419346; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kFGSyUH8rotNFk+Zp/oHgCXJPYMdGYVHu4ViuZY5iY8=; b=Ht7Rvxdpor6+9GzMV5YCp5KAzkgIwPJcC9TbQVH47o3c3o8/fJ3u1DS+S7YkcmEZSZh+wX 3KmyJtwGc9o/qmuRufvslErlssdQtUzoGb0xic2ikwqKpfgVfnE7dkYsqRVS5Ixsxt612q 55GOrHbll+fjGIUdz5MGFqDCe5GjDY8= X-MC-Unique: E1p3p5WvNB6Co8weyAni6w-1 X-Mimecast-MFC-AGG-ID: E1p3p5WvNB6Co8weyAni6w_1769419341 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Jim Shu , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 2/7] hw/vfio: cpr-iommufd: Fix wrong usage of migrate_add_blocker_modes Date: Mon, 26 Jan 2026 10:22:07 +0100 Message-ID: <20260126092212.503162-3-clg@redhat.com> In-Reply-To: <20260126092212.503162-1-clg@redhat.com> References: <20260126092212.503162-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769419420614154100 From: Jim Shu The return value of API is 0 for success and negative error code for failure. We'll check if the return value equals to 0. Also, the MIG_MODE should be CPR_TRANSFER and CPR_EXEC instead of 2 same bits. The API usage is aligned with 'hw/vfio/cpr-legacy.c' after these 2 changes. Fixes: 3ca0a0ab05c ("migration: Use bitset of MigMode instead of variable a= rguments") Signed-off-by: Jim Shu Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260121063418.2001326-1-jim.shu@s= ifive.com Signed-off-by: C=C3=A9dric Le Goater --- hw/vfio/cpr-iommufd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/cpr-iommufd.c b/hw/vfio/cpr-iommufd.c index c244db88fbbb4ae5c5c876a610f9187edda904c9..6758c73b6b96a32170ced8b18ae= bf8212d9542cd 100644 --- a/hw/vfio/cpr-iommufd.c +++ b/hw/vfio/cpr-iommufd.c @@ -159,8 +159,8 @@ bool vfio_iommufd_cpr_register_iommufd(IOMMUFDBackend *= be, Error **errp) =20 if (!vfio_cpr_supported(be, cpr_blocker)) { return migrate_add_blocker_modes(cpr_blocker, - BIT(MIG_MODE_CPR_TRANSFER) | BIT(MIG_MODE_CPR_TRANSFER= ), - errp); + BIT(MIG_MODE_CPR_TRANSFER) | BIT(MIG_MODE_CPR_EXEC), + errp) =3D=3D 0; } =20 vmstate_register(NULL, -1, &iommufd_cpr_vmstate, be); --=20 2.52.0 From nobody Sat Feb 7 05:49:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769419419; cv=none; d=zohomail.com; s=zohoarc; b=JYme1YKnKjEpnu0PM2A2fA6djgkUxh5meRwlpex8hisDbRNUSIscwYnSBSlmKZwDOYYOy5IxnMVS83kDVuf7S9XtdsGGan7q8sslWwqXCiKUYkzjLMCINSlXL7ddXPQQclViZ7bg8OAVmK3LOKrWLra7cyFABWEQI8KaFgjmraY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769419419; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9Xkda2hXx1f7CgtXVpjf2hKJ+v7hRRp/a053KOy+c7Q=; b=XdsC78t7HQsmRQEadiljTT2OpAjapWwP5lEA1c4nBl0XZKAJi4ZriNb2PNh7Cj1ze3b7KlCjGeEYJYgp+U1/YVl7ZOICG3hVQ71CR2ZmH8ta7N46EFcM4tCcXY4RSe4afAIkC01QUnLWFigDVBKkAAHWSheBNQjauA2grfEowx0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769419419413865.4924661691929; Mon, 26 Jan 2026 01:23:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkIny-0001x0-Jd; Mon, 26 Jan 2026 04:22:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkInq-0001tA-1s for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkInl-0005yz-KW for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:33 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-472-ZlWPLResPCGbbqWQxklUFg-1; Mon, 26 Jan 2026 04:22:25 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5A8EC1955D9A; Mon, 26 Jan 2026 09:22:24 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.175]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 389111956095; Mon, 26 Jan 2026 09:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769419349; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9Xkda2hXx1f7CgtXVpjf2hKJ+v7hRRp/a053KOy+c7Q=; b=FNW/D9x3QiXaGnAwfE5AlxEqH/B8A8hKd4aEf4obeli8U3pfsM/Uk994FmGspSqzTB6yE4 01AtoU09kNm8wvrjVMT1YDn5aP5ugm5BZP7GDMa0zG8G9YSGJGPdyiPoa5LuFRc0D+U6fE ggFx9ZtcEuPmNC4fXyi5EGLtL+U2qJo= X-MC-Unique: ZlWPLResPCGbbqWQxklUFg-1 X-Mimecast-MFC-AGG-ID: ZlWPLResPCGbbqWQxklUFg_1769419344 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Shameer Kolothum , "Michael S. Tsirkin" , Jason Wang , Nicolin Chen , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Eric Auger Subject: [PULL 3/7] linux-headers: Update to Linux v6.19-rc1 Date: Mon, 26 Jan 2026 10:22:08 +0100 Message-ID: <20260126092212.503162-4-clg@redhat.com> In-Reply-To: <20260126092212.503162-1-clg@redhat.com> References: <20260126092212.503162-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769419421531158500 From: Shameer Kolothum Mainly for adding support for VFIO DMABUF. While at it, update all headers. The header update breaks virtio-net due to virtio_net_hdr_v1_hash changes. Include the virtio-net changes to avoid build and bisect failures. Cc: Michael S. Tsirkin Cc: Jason Wang Tested-by: Nicolin Chen Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Shameer Kolothum Reviewed-by: Eric Auger Tested-by: Eric Auger Reviewed-by: Michael S. Tsirkin Link: https://lore.kernel.org/qemu-devel/20260121114111.34045-2-skolothumth= o@nvidia.com Signed-off-by: C=C3=A9dric Le Goater --- include/standard-headers/drm/drm_fourcc.h | 25 ++-- include/standard-headers/linux/ethtool.h | 5 + .../linux/input-event-codes.h | 14 ++- include/standard-headers/linux/pci_regs.h | 89 ++++++++++++++ include/standard-headers/linux/virtio_net.h | 3 +- include/standard-headers/linux/virtio_pci.h | 2 +- linux-headers/asm-arm64/kvm.h | 2 +- linux-headers/asm-arm64/unistd_64.h | 1 + linux-headers/asm-generic/unistd.h | 4 +- linux-headers/asm-loongarch/kvm.h | 1 + linux-headers/asm-loongarch/unistd.h | 6 + linux-headers/asm-loongarch/unistd_64.h | 1 + linux-headers/asm-mips/unistd_n32.h | 1 + linux-headers/asm-mips/unistd_n64.h | 1 + linux-headers/asm-mips/unistd_o32.h | 1 + linux-headers/asm-powerpc/unistd_32.h | 1 + linux-headers/asm-powerpc/unistd_64.h | 1 + linux-headers/asm-riscv/kvm.h | 3 + linux-headers/asm-riscv/unistd_32.h | 1 + linux-headers/asm-riscv/unistd_64.h | 1 + linux-headers/asm-s390/bitsperlong.h | 4 - linux-headers/asm-s390/unistd.h | 4 - linux-headers/asm-s390/unistd_64.h | 9 +- linux-headers/asm-x86/kvm.h | 1 + linux-headers/asm-x86/unistd_32.h | 1 + linux-headers/asm-x86/unistd_64.h | 1 + linux-headers/asm-x86/unistd_x32.h | 1 + linux-headers/linux/iommufd.h | 10 ++ linux-headers/linux/kvm.h | 11 ++ linux-headers/linux/mshv.h | 116 +++++++++++++++++- linux-headers/linux/psp-sev.h | 66 ++++++---- linux-headers/linux/vfio.h | 28 +++++ hw/net/virtio-net.c | 11 +- 33 files changed, 370 insertions(+), 56 deletions(-) diff --git a/include/standard-headers/drm/drm_fourcc.h b/include/standard-h= eaders/drm/drm_fourcc.h index cef077dfb35a6d1e8221b44ac1c23ee51b257c73..b39e197cc79f687966e40b78a95= 5d3d0834efcc4 100644 --- a/include/standard-headers/drm/drm_fourcc.h +++ b/include/standard-headers/drm/drm_fourcc.h @@ -978,14 +978,20 @@ extern "C" { * 2 =3D Gob Height 8, Turing+ Page Kind mapping * 3 =3D Reserved for future use. * - * 22:22 s Sector layout. On Tegra GPUs prior to Xavier, there is a f= urther - * bit remapping step that occurs at an even lower level than = the - * page kind and block linear swizzles. This causes the layou= t of - * surfaces mapped in those SOC's GPUs to be incompatible with= the - * equivalent mapping on other GPUs in the same system. - * - * 0 =3D Tegra K1 - Tegra Parker/TX2 Layout. - * 1 =3D Desktop GPU and Tegra Xavier+ Layout + * 22:22 s Sector layout. There is a further bit remapping step that = occurs + * 26:27 at an even lower level than the page kind and block linear + * swizzles. This causes the bit arrangement of surfaces in m= emory + * to differ subtly, and prevents direct sharing of surfaces b= etween + * GPUs with different layouts. + * + * 0 =3D Tegra K1 - Tegra Parker/TX2 Layout + * 1 =3D Pre-GB20x, GB20x 32+ bpp, GB10, Tegra Xavier-Orin L= ayout + * 2 =3D GB20x(Blackwell 2)+ 8 bpp surface layout + * 3 =3D GB20x(Blackwell 2)+ 16 bpp surface layout + * 4 =3D Reserved for future use. + * 5 =3D Reserved for future use. + * 6 =3D Reserved for future use. + * 7 =3D Reserved for future use. * * 25:23 c Lossless Framebuffer Compression type. * @@ -1000,7 +1006,7 @@ extern "C" { * 6 =3D Reserved for future use * 7 =3D Reserved for future use * - * 55:25 - Reserved for future use. Must be zero. + * 55:28 - Reserved for future use. Must be zero. */ #define DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(c, s, g, k, h) \ fourcc_mod_code(NVIDIA, (0x10 | \ @@ -1008,6 +1014,7 @@ extern "C" { (((k) & 0xff) << 12) | \ (((g) & 0x3) << 20) | \ (((s) & 0x1) << 22) | \ + (((s) & 0x6) << 25) | \ (((c) & 0x7) << 23))) =20 /* To grandfather in prior block linear format modifiers to the above layo= ut, diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-he= aders/linux/ethtool.h index dc24512d287538cb590435152cc8aba5979ad5c7..d0f7a63f1099c2e53d92a3ed608= f495f3b64b5ff 100644 --- a/include/standard-headers/linux/ethtool.h +++ b/include/standard-headers/linux/ethtool.h @@ -2077,6 +2077,10 @@ enum ethtool_link_mode_bit_indices { ETHTOOL_LINK_MODE_800000baseDR4_2_Full_BIT =3D 118, ETHTOOL_LINK_MODE_800000baseSR4_Full_BIT =3D 119, ETHTOOL_LINK_MODE_800000baseVR4_Full_BIT =3D 120, + ETHTOOL_LINK_MODE_1600000baseCR8_Full_BIT =3D 121, + ETHTOOL_LINK_MODE_1600000baseKR8_Full_BIT =3D 122, + ETHTOOL_LINK_MODE_1600000baseDR8_Full_BIT =3D 123, + ETHTOOL_LINK_MODE_1600000baseDR8_2_Full_BIT =3D 124, =20 /* must be last entry */ __ETHTOOL_LINK_MODE_MASK_NBITS @@ -2190,6 +2194,7 @@ enum ethtool_link_mode_bit_indices { #define SPEED_200000 200000 #define SPEED_400000 400000 #define SPEED_800000 800000 +#define SPEED_1600000 1600000 =20 #define SPEED_UNKNOWN -1 =20 diff --git a/include/standard-headers/linux/input-event-codes.h b/include/s= tandard-headers/linux/input-event-codes.h index c914ccd7237ab00aa19f92d42a36d01c3f12e3ce..ede79c6ae4f538bf18e80eedd7b= ab56dc1959115 100644 --- a/include/standard-headers/linux/input-event-codes.h +++ b/include/standard-headers/linux/input-event-codes.h @@ -27,7 +27,7 @@ #define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ #define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ #define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ -#define INPUT_PROP_HAPTIC_TOUCHPAD 0x07 /* is a haptic touchpad */ +#define INPUT_PROP_PRESSUREPAD 0x07 /* pressure triggers clicks */ =20 #define INPUT_PROP_MAX 0x1f #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) @@ -631,6 +631,18 @@ #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ =20 +/* + * Keycodes for hotkeys toggling the electronic privacy screen found on so= me + * laptops on/off. Note when the embedded-controller turns on/off the epri= vacy + * screen itself then the state should be reported through drm connecter p= rops: + * https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connec= tor-properties + * Except when implementing the drm connecter properties API is not possib= le + * because e.g. the firmware does not allow querying the presence and/or s= tatus + * of the eprivacy screen at boot. + */ +#define KEY_EPRIVACY_SCREEN_ON 0x252 +#define KEY_EPRIVACY_SCREEN_OFF 0x253 + #define KEY_KBDINPUTASSIST_PREV 0x260 #define KEY_KBDINPUTASSIST_NEXT 0x261 #define KEY_KBDINPUTASSIST_PREVGROUP 0x262 diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-h= eaders/linux/pci_regs.h index 07e06aafec502af7c12379f7207e2e3321dc2ff1..3add74ae259483bab76e7552cb2= 8bd9c9ef0b30c 100644 --- a/include/standard-headers/linux/pci_regs.h +++ b/include/standard-headers/linux/pci_regs.h @@ -503,6 +503,7 @@ #define PCI_EXP_DEVCAP_PWR_VAL 0x03fc0000 /* Slot Power Limit Value */ #define PCI_EXP_DEVCAP_PWR_SCL 0x0c000000 /* Slot Power Limit Scale */ #define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */ +#define PCI_EXP_DEVCAP_TEE 0x40000000 /* TEE I/O (TDISP) Support */ #define PCI_EXP_DEVCTL 0x08 /* Device Control */ #define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */ #define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */ @@ -754,6 +755,8 @@ #define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */ #define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */ #define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */ +#define PCI_EXT_CAP_ID_DEV3 0x2F /* Device 3 Capability/Control/Status */ +#define PCI_EXT_CAP_ID_IDE 0x30 /* Integrity and Data Encryption */ #define PCI_EXT_CAP_ID_PL_64GT 0x31 /* Physical Layer 64.0 GT/s */ #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_64GT =20 @@ -1244,9 +1247,95 @@ /* Deprecated old name, replaced with PCI_DOE_DATA_OBJECT_DISC_RSP_3_TYPE = */ #define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL PCI_DOE_DATA_OBJECT_DISC_= RSP_3_TYPE =20 +/* Device 3 Extended Capability */ +#define PCI_DEV3_CAP 0x04 /* Device 3 Capabilities Register */ +#define PCI_DEV3_CTL 0x08 /* Device 3 Control Register */ +#define PCI_DEV3_STA 0x0c /* Device 3 Status Register */ +#define PCI_DEV3_STA_SEGMENT 0x8 /* Segment Captured (end-to-end flit-mod= e detected) */ + /* Compute Express Link (CXL r3.1, sec 8.1.5) */ #define PCI_DVSEC_CXL_PORT 3 #define PCI_DVSEC_CXL_PORT_CTL 0x0c #define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR 0x00000001 =20 +/* Integrity and Data Encryption Extended Capability */ +#define PCI_IDE_CAP 0x04 +#define PCI_IDE_CAP_LINK 0x1 /* Link IDE Stream Supported */ +#define PCI_IDE_CAP_SELECTIVE 0x2 /* Selective IDE Streams Supported */ +#define PCI_IDE_CAP_FLOWTHROUGH 0x4 /* Flow-Through IDE Stream Supported= */ +#define PCI_IDE_CAP_PARTIAL_HEADER_ENC 0x8 /* Partial Header Encryption = Supported */ +#define PCI_IDE_CAP_AGGREGATION 0x10 /* Aggregation Supported */ +#define PCI_IDE_CAP_PCRC 0x20 /* PCRC Supported */ +#define PCI_IDE_CAP_IDE_KM 0x40 /* IDE_KM Protocol Supported */ +#define PCI_IDE_CAP_SEL_CFG 0x80 /* Selective IDE for Config Request Sup= port */ +#define PCI_IDE_CAP_ALG __GENMASK(12, 8) /* Supported Algorithms */ +#define PCI_IDE_CAP_ALG_AES_GCM_256 0 /* AES-GCM 256 key size, 96b MA= C */ +#define PCI_IDE_CAP_LINK_TC_NUM __GENMASK(15, 13) /* Link IDE TCs */ +#define PCI_IDE_CAP_SEL_NUM __GENMASK(23, 16) /* Supported Selective IDE= Streams */ +#define PCI_IDE_CAP_TEE_LIMITED 0x1000000 /* TEE-Limited Stream Supported= */ +#define PCI_IDE_CTL 0x08 +#define PCI_IDE_CTL_FLOWTHROUGH_IDE 0x4 /* Flow-Through IDE Stream Enabl= ed */ + +#define PCI_IDE_LINK_STREAM_0 0xc /* First Link Stream Register Block */ +#define PCI_IDE_LINK_BLOCK_SIZE 8 +/* Link IDE Stream block, up to PCI_IDE_CAP_LINK_TC_NUM */ +#define PCI_IDE_LINK_CTL_0 0x00 /* First Link Control Register Offset = in block */ +#define PCI_IDE_LINK_CTL_EN 0x1 /* Link IDE Stream Enable */ +#define PCI_IDE_LINK_CTL_TX_AGGR_NPR __GENMASK(3, 2) /* Tx Aggregation = Mode NPR */ +#define PCI_IDE_LINK_CTL_TX_AGGR_PR __GENMASK(5, 4) /* Tx Aggregation M= ode PR */ +#define PCI_IDE_LINK_CTL_TX_AGGR_CPL __GENMASK(7, 6) /* Tx Aggregation = Mode CPL */ +#define PCI_IDE_LINK_CTL_PCRC_EN 0x100 /* PCRC Enable */ +#define PCI_IDE_LINK_CTL_PART_ENC __GENMASK(13, 10) /* Partial Header Enc= ryption Mode */ +#define PCI_IDE_LINK_CTL_ALG __GENMASK(18, 14) /* Selection from PCI_IDE= _CAP_ALG */ +#define PCI_IDE_LINK_CTL_TC __GENMASK(21, 19) /* Traffic Class */ +#define PCI_IDE_LINK_CTL_ID __GENMASK(31, 24) /* Stream ID */ +#define PCI_IDE_LINK_STS_0 0x4 /* First Link Status Registe= r Offset in block */ +#define PCI_IDE_LINK_STS_STATE __GENMASK(3, 0) /* Link IDE Stream Stat= e */ +#define PCI_IDE_LINK_STS_IDE_FAIL 0x80000000 /* IDE fail message receiv= ed */ + +/* Selective IDE Stream block, up to PCI_IDE_CAP_SELECTIVE_STREAMS_NUM */ +/* Selective IDE Stream Capability Register */ +#define PCI_IDE_SEL_CAP 0x00 +#define PCI_IDE_SEL_CAP_ASSOC_NUM __GENMASK(3, 0) +/* Selective IDE Stream Control Register */ +#define PCI_IDE_SEL_CTL 0x04 +#define PCI_IDE_SEL_CTL_EN 0x1 /* Selective IDE Stream Enable */ +#define PCI_IDE_SEL_CTL_TX_AGGR_NPR __GENMASK(3, 2) /* Tx Aggregation = Mode NPR */ +#define PCI_IDE_SEL_CTL_TX_AGGR_PR __GENMASK(5, 4) /* Tx Aggregation M= ode PR */ +#define PCI_IDE_SEL_CTL_TX_AGGR_CPL __GENMASK(7, 6) /* Tx Aggregation = Mode CPL */ +#define PCI_IDE_SEL_CTL_PCRC_EN 0x100 /* PCRC Enable */ +#define PCI_IDE_SEL_CTL_CFG_EN 0x200 /* Selective IDE for Configurati= on Requests */ +#define PCI_IDE_SEL_CTL_PART_ENC __GENMASK(13, 10) /* Partial Header Enc= ryption Mode */ +#define PCI_IDE_SEL_CTL_ALG __GENMASK(18, 14) /* Selection from PCI_IDE= _CAP_ALG */ +#define PCI_IDE_SEL_CTL_TC __GENMASK(21, 19) /* Traffic Class */ +#define PCI_IDE_SEL_CTL_DEFAULT 0x400000 /* Default Stream */ +#define PCI_IDE_SEL_CTL_TEE_LIMITED 0x800000 /* TEE-Limited Stream */ +#define PCI_IDE_SEL_CTL_ID __GENMASK(31, 24) /* Stream ID */ +#define PCI_IDE_SEL_CTL_ID_MAX 255 +/* Selective IDE Stream Status Register */ +#define PCI_IDE_SEL_STS 0x08 +#define PCI_IDE_SEL_STS_STATE __GENMASK(3, 0) /* Selective IDE Stream = State */ +#define PCI_IDE_SEL_STS_STATE_INSECURE 0 +#define PCI_IDE_SEL_STS_STATE_SECURE 2 +#define PCI_IDE_SEL_STS_IDE_FAIL 0x80000000 /* IDE fail message receiv= ed */ +/* IDE RID Association Register 1 */ +#define PCI_IDE_SEL_RID_1 0x0c +#define PCI_IDE_SEL_RID_1_LIMIT __GENMASK(23, 8) +/* IDE RID Association Register 2 */ +#define PCI_IDE_SEL_RID_2 0x10 +#define PCI_IDE_SEL_RID_2_VALID 0x1 +#define PCI_IDE_SEL_RID_2_BASE __GENMASK(23, 8) +#define PCI_IDE_SEL_RID_2_SEG __GENMASK(31, 24) +/* Selective IDE Address Association Register Block, up to PCI_IDE_SEL_CAP= _ASSOC_NUM */ +#define PCI_IDE_SEL_ADDR_BLOCK_SIZE 12 +#define PCI_IDE_SEL_ADDR_1(x) (20 + (x) * PCI_IDE_SEL_ADDR_BLOCK_SIZE) +#define PCI_IDE_SEL_ADDR_1_VALID 0x1 +#define PCI_IDE_SEL_ADDR_1_BASE_LOW __GENMASK(19, 8) +#define PCI_IDE_SEL_ADDR_1_LIMIT_LOW __GENMASK(31, 20) +/* IDE Address Association Register 2 is "Memory Limit Upper" */ +#define PCI_IDE_SEL_ADDR_2(x) (24 + (x) * PCI_IDE_SEL_ADDR_BLOCK_SIZE) +/* IDE Address Association Register 3 is "Memory Base Upper" */ +#define PCI_IDE_SEL_ADDR_3(x) (28 + (x) * PCI_IDE_SEL_ADDR_BLOCK_SIZE) +#define PCI_IDE_SEL_BLOCK_SIZE(nr_assoc) (20 + PCI_IDE_SEL_ADDR_BLOCK_SIZ= E * (nr_assoc)) + #endif /* LINUX_PCI_REGS_H */ diff --git a/include/standard-headers/linux/virtio_net.h b/include/standard= -headers/linux/virtio_net.h index 93abaae0b9079bc10a441caa41d7ce1815cdee06..17a0174d6ca7b727068b1002365= 435dd8c29a3ee 100644 --- a/include/standard-headers/linux/virtio_net.h +++ b/include/standard-headers/linux/virtio_net.h @@ -193,7 +193,8 @@ struct virtio_net_hdr_v1 { =20 struct virtio_net_hdr_v1_hash { struct virtio_net_hdr_v1 hdr; - uint32_t hash_value; + uint16_t hash_value_lo; + uint16_t hash_value_hi; #define VIRTIO_NET_HASH_REPORT_NONE 0 #define VIRTIO_NET_HASH_REPORT_IPv4 1 #define VIRTIO_NET_HASH_REPORT_TCPv4 2 diff --git a/include/standard-headers/linux/virtio_pci.h b/include/standard= -headers/linux/virtio_pci.h index 09e964e6eeea4f41d7d8b884bdfd3e5142da3cbb..4c82513df2800c2154f9939e490= abee7982a954a 100644 --- a/include/standard-headers/linux/virtio_pci.h +++ b/include/standard-headers/linux/virtio_pci.h @@ -40,7 +40,7 @@ #define _LINUX_VIRTIO_PCI_H =20 #include "standard-headers/linux/types.h" -#include "standard-headers/linux/kernel.h" +#include "standard-headers/linux/const.h" =20 #ifndef VIRTIO_PCI_NO_LEGACY =20 diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h index f4d9baafa1c5fa7d19abb4b7bdc37f47a9414e6c..46ffbddab54bc4248c9a22db3a0= 6395ff93338db 100644 --- a/linux-headers/asm-arm64/kvm.h +++ b/linux-headers/asm-arm64/kvm.h @@ -31,7 +31,7 @@ #define KVM_SPSR_FIQ 4 #define KVM_NR_SPSR 5 =20 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ #include #include #include diff --git a/linux-headers/asm-arm64/unistd_64.h b/linux-headers/asm-arm64/= unistd_64.h index 4ae25c2b91685f9a3653e04d9027312bfe9aecab..1ef9c408135b2be7e6943e1a892= 7e9a11c2b38a1 100644 --- a/linux-headers/asm-arm64/unistd_64.h +++ b/linux-headers/asm-arm64/unistd_64.h @@ -326,6 +326,7 @@ #define __NR_open_tree_attr 467 #define __NR_file_getattr 468 #define __NR_file_setattr 469 +#define __NR_listns 470 =20 =20 #endif /* _ASM_UNISTD_64_H */ diff --git a/linux-headers/asm-generic/unistd.h b/linux-headers/asm-generic= /unistd.h index 04e0077fb4c97a4d565da86d3d0d1d243f32336e..942370b3f5d252305832d105615= f1628fa0ad304 100644 --- a/linux-headers/asm-generic/unistd.h +++ b/linux-headers/asm-generic/unistd.h @@ -857,9 +857,11 @@ __SYSCALL(__NR_open_tree_attr, sys_open_tree_attr) __SYSCALL(__NR_file_getattr, sys_file_getattr) #define __NR_file_setattr 469 __SYSCALL(__NR_file_setattr, sys_file_setattr) +#define __NR_listns 470 +__SYSCALL(__NR_listns, sys_listns) =20 #undef __NR_syscalls -#define __NR_syscalls 470 +#define __NR_syscalls 471 =20 /* * 32 bit systems traditionally used different diff --git a/linux-headers/asm-loongarch/kvm.h b/linux-headers/asm-loongarc= h/kvm.h index 57ba1a563bb1a2563f77f1317b1d60b60866e52a..de6c3f18e40ab13f9f56daeeed9= b6d3c7a9fe17b 100644 --- a/linux-headers/asm-loongarch/kvm.h +++ b/linux-headers/asm-loongarch/kvm.h @@ -104,6 +104,7 @@ struct kvm_fpu { #define KVM_LOONGARCH_VM_FEAT_PV_IPI 6 #define KVM_LOONGARCH_VM_FEAT_PV_STEALTIME 7 #define KVM_LOONGARCH_VM_FEAT_PTW 8 +#define KVM_LOONGARCH_VM_FEAT_MSGINT 9 =20 /* Device Control API on vcpu fd */ #define KVM_LOONGARCH_VCPU_CPUCFG 0 diff --git a/linux-headers/asm-loongarch/unistd.h b/linux-headers/asm-loong= arch/unistd.h index 1f01980f9c94826957c9729c09c550cd090e4850..e19c7f2f9f87a49a49a64255065= 08f5c0efc3315 100644 --- a/linux-headers/asm-loongarch/unistd.h +++ b/linux-headers/asm-loongarch/unistd.h @@ -1,3 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ =20 +#include + +#if __BITS_PER_LONG =3D=3D 32 +#include +#else #include +#endif diff --git a/linux-headers/asm-loongarch/unistd_64.h b/linux-headers/asm-lo= ongarch/unistd_64.h index 5033fc8f2fe9ef0193aa85370848e80fc23562e9..aa5daac4ef9020807a1bc7bb60e= 3005857ac8206 100644 --- a/linux-headers/asm-loongarch/unistd_64.h +++ b/linux-headers/asm-loongarch/unistd_64.h @@ -322,6 +322,7 @@ #define __NR_open_tree_attr 467 #define __NR_file_getattr 468 #define __NR_file_setattr 469 +#define __NR_listns 470 =20 =20 #endif /* _ASM_UNISTD_64_H */ diff --git a/linux-headers/asm-mips/unistd_n32.h b/linux-headers/asm-mips/u= nistd_n32.h index c99c10e5bf45da1eea82202e0c0362ac70b4aa8d..a33d106dca769262119aba69243= 94cbc90430042 100644 --- a/linux-headers/asm-mips/unistd_n32.h +++ b/linux-headers/asm-mips/unistd_n32.h @@ -398,5 +398,6 @@ #define __NR_open_tree_attr (__NR_Linux + 467) #define __NR_file_getattr (__NR_Linux + 468) #define __NR_file_setattr (__NR_Linux + 469) +#define __NR_listns (__NR_Linux + 470) =20 #endif /* _ASM_UNISTD_N32_H */ diff --git a/linux-headers/asm-mips/unistd_n64.h b/linux-headers/asm-mips/u= nistd_n64.h index 0d975bb1856054334b649f4aab472e549d02326b..1bc251e4507c3a86b31fe80a7d2= 788853a1abc73 100644 --- a/linux-headers/asm-mips/unistd_n64.h +++ b/linux-headers/asm-mips/unistd_n64.h @@ -374,5 +374,6 @@ #define __NR_open_tree_attr (__NR_Linux + 467) #define __NR_file_getattr (__NR_Linux + 468) #define __NR_file_setattr (__NR_Linux + 469) +#define __NR_listns (__NR_Linux + 470) =20 #endif /* _ASM_UNISTD_N64_H */ diff --git a/linux-headers/asm-mips/unistd_o32.h b/linux-headers/asm-mips/u= nistd_o32.h index 86ac0ac84b39d79e63177b86390bd2f41c2dfca2..c57175d496c080cebb8414c91b5= a93c96e7725c3 100644 --- a/linux-headers/asm-mips/unistd_o32.h +++ b/linux-headers/asm-mips/unistd_o32.h @@ -444,5 +444,6 @@ #define __NR_open_tree_attr (__NR_Linux + 467) #define __NR_file_getattr (__NR_Linux + 468) #define __NR_file_setattr (__NR_Linux + 469) +#define __NR_listns (__NR_Linux + 470) =20 #endif /* _ASM_UNISTD_O32_H */ diff --git a/linux-headers/asm-powerpc/unistd_32.h b/linux-headers/asm-powe= rpc/unistd_32.h index d7a32c5e069039634bac2f83f6ca53a130aa7a56..a3f4aa2fe20f2ff30cc825174c0= d0c3df50c1425 100644 --- a/linux-headers/asm-powerpc/unistd_32.h +++ b/linux-headers/asm-powerpc/unistd_32.h @@ -451,6 +451,7 @@ #define __NR_open_tree_attr 467 #define __NR_file_getattr 468 #define __NR_file_setattr 469 +#define __NR_listns 470 =20 =20 #endif /* _ASM_UNISTD_32_H */ diff --git a/linux-headers/asm-powerpc/unistd_64.h b/linux-headers/asm-powe= rpc/unistd_64.h index ff35c51fc65660a037b72e0fb4970d45bc45a028..d4444557f1ce4bf0d0ed2fdfdd6= 0432cff9c677e 100644 --- a/linux-headers/asm-powerpc/unistd_64.h +++ b/linux-headers/asm-powerpc/unistd_64.h @@ -423,6 +423,7 @@ #define __NR_open_tree_attr 467 #define __NR_file_getattr 468 #define __NR_file_setattr 469 +#define __NR_listns 470 =20 =20 #endif /* _ASM_UNISTD_64_H */ diff --git a/linux-headers/asm-riscv/kvm.h b/linux-headers/asm-riscv/kvm.h index 759a4852c09a564a150d58f0a6b9095bfa5001ce..54f3ad7ed2e4bf2580c1659758b= d9f89f7a451c8 100644 --- a/linux-headers/asm-riscv/kvm.h +++ b/linux-headers/asm-riscv/kvm.h @@ -23,6 +23,8 @@ #define KVM_INTERRUPT_SET -1U #define KVM_INTERRUPT_UNSET -2U =20 +#define KVM_EXIT_FAIL_ENTRY_NO_VSFILE (1ULL << 0) + /* for KVM_GET_REGS and KVM_SET_REGS */ struct kvm_regs { }; @@ -211,6 +213,7 @@ enum KVM_RISCV_SBI_EXT_ID { KVM_RISCV_SBI_EXT_STA, KVM_RISCV_SBI_EXT_SUSP, KVM_RISCV_SBI_EXT_FWFT, + KVM_RISCV_SBI_EXT_MPXY, KVM_RISCV_SBI_EXT_MAX, }; =20 diff --git a/linux-headers/asm-riscv/unistd_32.h b/linux-headers/asm-riscv/= unistd_32.h index 6083373e884ca3010397917fc7e3cace41db82f2..9f33956246392da58bdfc1e4cea= fd97cdfee221b 100644 --- a/linux-headers/asm-riscv/unistd_32.h +++ b/linux-headers/asm-riscv/unistd_32.h @@ -317,6 +317,7 @@ #define __NR_open_tree_attr 467 #define __NR_file_getattr 468 #define __NR_file_setattr 469 +#define __NR_listns 470 =20 =20 #endif /* _ASM_UNISTD_32_H */ diff --git a/linux-headers/asm-riscv/unistd_64.h b/linux-headers/asm-riscv/= unistd_64.h index f0c7585c60edf18a788fb877dde33d1064fbd28a..c2e7258916470221e354f83d6e3= c8237b7bfb36c 100644 --- a/linux-headers/asm-riscv/unistd_64.h +++ b/linux-headers/asm-riscv/unistd_64.h @@ -327,6 +327,7 @@ #define __NR_open_tree_attr 467 #define __NR_file_getattr 468 #define __NR_file_setattr 469 +#define __NR_listns 470 =20 =20 #endif /* _ASM_UNISTD_64_H */ diff --git a/linux-headers/asm-s390/bitsperlong.h b/linux-headers/asm-s390/= bitsperlong.h index cceaf47b021ad59687e7e71a37f5a79747581707..7af27a985f25d80956ca9c92929= feedfb0c654d8 100644 --- a/linux-headers/asm-s390/bitsperlong.h +++ b/linux-headers/asm-s390/bitsperlong.h @@ -2,11 +2,7 @@ #ifndef __ASM_S390_BITSPERLONG_H #define __ASM_S390_BITSPERLONG_H =20 -#ifndef __s390x__ -#define __BITS_PER_LONG 32 -#else #define __BITS_PER_LONG 64 -#endif =20 #include =20 diff --git a/linux-headers/asm-s390/unistd.h b/linux-headers/asm-s390/unist= d.h index 27b8b211c8eaf15db869a81d235e31eb9272a504..14846188770b7328dc3bf1c86c3= e3151bb1fcdb7 100644 --- a/linux-headers/asm-s390/unistd.h +++ b/linux-headers/asm-s390/unistd.h @@ -8,10 +8,6 @@ #ifndef _ASM_S390_UNISTD_H_ #define _ASM_S390_UNISTD_H_ =20 -#ifdef __s390x__ #include -#else -#include -#endif =20 #endif /* _ASM_S390_UNISTD_H_ */ diff --git a/linux-headers/asm-s390/unistd_64.h b/linux-headers/asm-s390/un= istd_64.h index 0652ba63318b0eb908d68633d73021f31b35b1ac..8d9e579ef50d46cb27ff1f0694f= 74083e285c17c 100644 --- a/linux-headers/asm-s390/unistd_64.h +++ b/linux-headers/asm-s390/unistd_64.h @@ -1,6 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_S390_UNISTD_64_H -#define _ASM_S390_UNISTD_64_H +#ifndef _ASM_UNISTD_64_H +#define _ASM_UNISTD_64_H =20 #define __NR_exit 1 #define __NR_fork 2 @@ -390,5 +389,7 @@ #define __NR_open_tree_attr 467 #define __NR_file_getattr 468 #define __NR_file_setattr 469 +#define __NR_listns 470 =20 -#endif /* _ASM_S390_UNISTD_64_H */ + +#endif /* _ASM_UNISTD_64_H */ diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 3bb38f6c3a4129c8b18f6c77e0093a50d215b706..b804fd25a2b861327c2be7a30f1= 4b2dbb2df1944 100644 --- a/linux-headers/asm-x86/kvm.h +++ b/linux-headers/asm-x86/kvm.h @@ -500,6 +500,7 @@ struct kvm_sync_regs { /* vendor-specific groups and attributes for system fd */ #define KVM_X86_GRP_SEV 1 # define KVM_X86_SEV_VMSA_FEATURES 0 +# define KVM_X86_SNP_POLICY_BITS 1 =20 struct kvm_vmx_nested_state_data { __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE]; diff --git a/linux-headers/asm-x86/unistd_32.h b/linux-headers/asm-x86/unis= td_32.h index 8f784a56347d86bf0fb751d87aea640997ef2ef9..34255aac64f020864107bdd72b0= 17d51ce321a02 100644 --- a/linux-headers/asm-x86/unistd_32.h +++ b/linux-headers/asm-x86/unistd_32.h @@ -460,6 +460,7 @@ #define __NR_open_tree_attr 467 #define __NR_file_getattr 468 #define __NR_file_setattr 469 +#define __NR_listns 470 =20 =20 #endif /* _ASM_UNISTD_32_H */ diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unis= td_64.h index 26c258d1a609f03029e955de64a1e8a6e065164e..07f242a5fa435cc1fead96e8432= 8b0512a1c0645 100644 --- a/linux-headers/asm-x86/unistd_64.h +++ b/linux-headers/asm-x86/unistd_64.h @@ -384,6 +384,7 @@ #define __NR_open_tree_attr 467 #define __NR_file_getattr 468 #define __NR_file_setattr 469 +#define __NR_listns 470 =20 =20 #endif /* _ASM_UNISTD_64_H */ diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/uni= std_x32.h index 65c2aed94623f987c0efa57eb9831be6117760da..08fc9da2fab506d13713f0b5699= 8004b269ba831 100644 --- a/linux-headers/asm-x86/unistd_x32.h +++ b/linux-headers/asm-x86/unistd_x32.h @@ -337,6 +337,7 @@ #define __NR_open_tree_attr (__X32_SYSCALL_BIT + 467) #define __NR_file_getattr (__X32_SYSCALL_BIT + 468) #define __NR_file_setattr (__X32_SYSCALL_BIT + 469) +#define __NR_listns (__X32_SYSCALL_BIT + 470) #define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512) #define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513) #define __NR_ioctl (__X32_SYSCALL_BIT + 514) diff --git a/linux-headers/linux/iommufd.h b/linux-headers/linux/iommufd.h index 2105a039551e982dea31e243a7c6c53fae98635e..384183a40393cb5a5cde875fdfc= 60496eec5699e 100644 --- a/linux-headers/linux/iommufd.h +++ b/linux-headers/linux/iommufd.h @@ -450,6 +450,16 @@ struct iommu_hwpt_vtd_s1 { * nested domain will translate the same as the nesting parent. The S1 will * install a Context Descriptor Table pointing at userspace memory transla= ted * by the nesting parent. + * + * It's suggested to allocate a vDEVICE object carrying vSID and then re-a= ttach + * the nested domain, as soon as the vSID is available in the VMM level: + * + * - when Cfg=3Dtranslate, a vDEVICE must be allocated prior to attaching = to the + * allocated nested domain, as CD/ATS invalidations and vevents need a v= SID. + * - when Cfg=3Dbypass/abort, a vDEVICE is not enforced during the nested = domain + * attachment, to support a GBPA case where VM sets CR0.SMMUEN=3D0. Howe= ver, if + * VM sets CR0.SMMUEN=3D1 while missing a vDEVICE object, kernel would f= ail to + * report events to the VM. E.g. F_TRANSLATION when guest STE.Cfg=3Dabor= t. */ struct iommu_hwpt_arm_smmuv3 { __aligned_le64 ste[2]; diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 4ea28ef7cac1942f3e4d88119dea1ac5f6ef88f9..a4ab42dcba977797f20fad2375a= b7e428f873f5e 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -179,6 +179,7 @@ struct kvm_xen_exit { #define KVM_EXIT_LOONGARCH_IOCSR 38 #define KVM_EXIT_MEMORY_FAULT 39 #define KVM_EXIT_TDX 40 +#define KVM_EXIT_ARM_SEA 41 =20 /* For KVM_EXIT_INTERNAL_ERROR */ /* Emulate instruction failed. */ @@ -465,6 +466,14 @@ struct kvm_run { } setup_event_notify; }; } tdx; + /* KVM_EXIT_ARM_SEA */ + struct { +#define KVM_EXIT_ARM_SEA_FLAG_GPA_VALID (1ULL << 0) + __u64 flags; + __u64 esr; + __u64 gva; + __u64 gpa; + } arm_sea; /* Fix the size of the union. */ char padding[256]; }; @@ -955,6 +964,8 @@ struct kvm_enable_cap { #define KVM_CAP_RISCV_MP_STATE_RESET 242 #define KVM_CAP_ARM_CACHEABLE_PFNMAP_SUPPORTED 243 #define KVM_CAP_GUEST_MEMFD_FLAGS 244 +#define KVM_CAP_ARM_SEA_TO_USER 245 +#define KVM_CAP_S390_USER_OPEREXEC 246 =20 struct kvm_irq_routing_irqchip { __u32 irqchip; diff --git a/linux-headers/linux/mshv.h b/linux-headers/linux/mshv.h index 5bc83db6a325478fa5ed14872f074d4760eb26fc..acceeddc1c9f14768e84b9426ae= 00a3303584932 100644 --- a/linux-headers/linux/mshv.h +++ b/linux-headers/linux/mshv.h @@ -26,6 +26,7 @@ enum { MSHV_PT_BIT_LAPIC, MSHV_PT_BIT_X2APIC, MSHV_PT_BIT_GPA_SUPER_PAGES, + MSHV_PT_BIT_CPU_AND_XSAVE_FEATURES, MSHV_PT_BIT_COUNT, }; =20 @@ -41,6 +42,8 @@ enum { * @pt_flags: Bitmask of 1 << MSHV_PT_BIT_* * @pt_isolation: MSHV_PT_ISOLATION_* * + * This is the initial/v1 version for backward compatibility. + * * Returns a file descriptor to act as a handle to a guest partition. * At this point the partition is not yet initialized in the hypervisor. * Some operations must be done with the partition in this state, e.g. set= ting @@ -52,6 +55,37 @@ struct mshv_create_partition { __u64 pt_isolation; }; =20 +#define MSHV_NUM_CPU_FEATURES_BANKS 2 + +/** + * struct mshv_create_partition_v2 + * + * This is extended version of the above initial MSHV_CREATE_PARTITION + * ioctl and allows for following additional parameters: + * + * @pt_num_cpu_fbanks: Must be set to MSHV_NUM_CPU_FEATURES_BANKS. + * @pt_cpu_fbanks: Disabled processor feature banks array. + * @pt_disabled_xsave: Disabled xsave feature bits. + * + * pt_cpu_fbanks and pt_disabled_xsave are passed through as-is to the cre= ate + * partition hypercall. + * + * Returns : same as above original mshv_create_partition + */ +struct mshv_create_partition_v2 { + __u64 pt_flags; + __u64 pt_isolation; + __u16 pt_num_cpu_fbanks; + __u8 pt_rsvd[6]; /* MBZ */ + __u64 pt_cpu_fbanks[MSHV_NUM_CPU_FEATURES_BANKS]; + __u64 pt_rsvd1[2]; /* MBZ */ +#if defined(__x86_64__) + __u64 pt_disabled_xsave; +#else + __u64 pt_rsvd2; /* MBZ */ +#endif +} __attribute__((packed)); + /* /dev/mshv */ #define MSHV_CREATE_PARTITION _IOW(MSHV_IOCTL, 0x00, struct mshv_create_pa= rtition) =20 @@ -89,7 +123,7 @@ enum { * @rsvd: MBZ * * Map or unmap a region of userspace memory to Guest Physical Addresses (= GPA). - * Mappings can't overlap in GPA space or userspace. + * Mappings can't overlap in GPA space. * To unmap, these fields must match an existing mapping. */ struct mshv_user_mem_region { @@ -288,4 +322,84 @@ struct mshv_get_set_vp_state { * #define MSHV_ROOT_HVCALL _IOWR(MSHV_IOCTL, 0x07, struct mshv_root_hvc= all) */ =20 +/* Structure definitions, macros and IOCTLs for mshv_vtl */ + +#define MSHV_CAP_CORE_API_STABLE 0x0 +#define MSHV_CAP_REGISTER_PAGE 0x1 +#define MSHV_CAP_VTL_RETURN_ACTION 0x2 +#define MSHV_CAP_DR6_SHARED 0x3 +#define MSHV_MAX_RUN_MSG_SIZE 256 + +struct mshv_vp_registers { + __u32 count; /* supports only 1 register at a time */ + __u32 reserved; /* Reserved for alignment or future use */ + __u64 regs_ptr; /* pointer to struct hv_register_assoc */ +}; + +struct mshv_vtl_set_eventfd { + __s32 fd; + __u32 flag; +}; + +struct mshv_vtl_signal_event { + __u32 connection_id; + __u32 flag; +}; + +struct mshv_vtl_sint_post_msg { + __u64 message_type; + __u32 connection_id; + __u32 payload_size; /* Must not exceed HV_MESSAGE_PAYLOAD_BYTE_COUNT */ + __u64 payload_ptr; /* pointer to message payload (bytes) */ +}; + +struct mshv_vtl_ram_disposition { + __u64 start_pfn; + __u64 last_pfn; +}; + +struct mshv_vtl_set_poll_file { + __u32 cpu; + __u32 fd; +}; + +struct mshv_vtl_hvcall_setup { + __u64 bitmap_array_size; /* stores number of bytes */ + __u64 allow_bitmap_ptr; +}; + +struct mshv_vtl_hvcall { + __u64 control; /* Hypercall control code */ + __u64 input_size; /* Size of the input data */ + __u64 input_ptr; /* Pointer to the input struct */ + __u64 status; /* Status of the hypercall (output) */ + __u64 output_size; /* Size of the output data */ + __u64 output_ptr; /* Pointer to the output struct */ +}; + +struct mshv_sint_mask { + __u8 mask; + __u8 reserved[7]; +}; + +/* /dev/mshv device IOCTL */ +#define MSHV_CHECK_EXTENSION _IOW(MSHV_IOCTL, 0x00, __u32) + +/* vtl device */ +#define MSHV_CREATE_VTL _IOR(MSHV_IOCTL, 0x1D, char) +#define MSHV_ADD_VTL0_MEMORY _IOW(MSHV_IOCTL, 0x21, struct mshv_vtl_ram_di= sposition) +#define MSHV_SET_POLL_FILE _IOW(MSHV_IOCTL, 0x25, struct mshv_vtl_set_pol= l_file) +#define MSHV_RETURN_TO_LOWER_VTL _IO(MSHV_IOCTL, 0x27) +#define MSHV_GET_VP_REGISTERS _IOWR(MSHV_IOCTL, 0x05, struct mshv_vp_regi= sters) +#define MSHV_SET_VP_REGISTERS _IOW(MSHV_IOCTL, 0x06, struct mshv_vp_regis= ters) + +/* VMBus device IOCTLs */ +#define MSHV_SINT_SIGNAL_EVENT _IOW(MSHV_IOCTL, 0x22, struct mshv_vtl_s= ignal_event) +#define MSHV_SINT_POST_MESSAGE _IOW(MSHV_IOCTL, 0x23, struct mshv_vtl_s= int_post_msg) +#define MSHV_SINT_SET_EVENTFD _IOW(MSHV_IOCTL, 0x24, struct mshv_vtl_s= et_eventfd) +#define MSHV_SINT_PAUSE_MESSAGE_STREAM _IOW(MSHV_IOCTL, 0x25, struct m= shv_sint_mask) + +/* hv_hvcall device */ +#define MSHV_HVCALL_SETUP _IOW(MSHV_IOCTL, 0x1E, struct mshv_vtl_hv= call_setup) +#define MSHV_HVCALL _IOWR(MSHV_IOCTL, 0x1F, struct mshv_vtl_h= vcall) #endif diff --git a/linux-headers/linux/psp-sev.h b/linux-headers/linux/psp-sev.h index c525125ea8150986b8d667379c192341f6097d94..9479928a4ad68afc56d0e347a3b= a2b742e94ef1d 100644 --- a/linux-headers/linux/psp-sev.h +++ b/linux-headers/linux/psp-sev.h @@ -47,32 +47,32 @@ typedef enum { * with possible values from the specification. */ SEV_RET_NO_FW_CALL =3D -1, - SEV_RET_SUCCESS =3D 0, - SEV_RET_INVALID_PLATFORM_STATE, - SEV_RET_INVALID_GUEST_STATE, - SEV_RET_INAVLID_CONFIG, + SEV_RET_SUCCESS =3D 0, + SEV_RET_INVALID_PLATFORM_STATE =3D 0x0001, + SEV_RET_INVALID_GUEST_STATE =3D 0x0002, + SEV_RET_INAVLID_CONFIG =3D 0x0003, SEV_RET_INVALID_CONFIG =3D SEV_RET_INAVLID_CONFIG, - SEV_RET_INVALID_LEN, - SEV_RET_ALREADY_OWNED, - SEV_RET_INVALID_CERTIFICATE, - SEV_RET_POLICY_FAILURE, - SEV_RET_INACTIVE, - SEV_RET_INVALID_ADDRESS, - SEV_RET_BAD_SIGNATURE, - SEV_RET_BAD_MEASUREMENT, - SEV_RET_ASID_OWNED, - SEV_RET_INVALID_ASID, - SEV_RET_WBINVD_REQUIRED, - SEV_RET_DFFLUSH_REQUIRED, - SEV_RET_INVALID_GUEST, - SEV_RET_INVALID_COMMAND, - SEV_RET_ACTIVE, - SEV_RET_HWSEV_RET_PLATFORM, - SEV_RET_HWSEV_RET_UNSAFE, - SEV_RET_UNSUPPORTED, - SEV_RET_INVALID_PARAM, - SEV_RET_RESOURCE_LIMIT, - SEV_RET_SECURE_DATA_INVALID, + SEV_RET_INVALID_LEN =3D 0x0004, + SEV_RET_ALREADY_OWNED =3D 0x0005, + SEV_RET_INVALID_CERTIFICATE =3D 0x0006, + SEV_RET_POLICY_FAILURE =3D 0x0007, + SEV_RET_INACTIVE =3D 0x0008, + SEV_RET_INVALID_ADDRESS =3D 0x0009, + SEV_RET_BAD_SIGNATURE =3D 0x000A, + SEV_RET_BAD_MEASUREMENT =3D 0x000B, + SEV_RET_ASID_OWNED =3D 0x000C, + SEV_RET_INVALID_ASID =3D 0x000D, + SEV_RET_WBINVD_REQUIRED =3D 0x000E, + SEV_RET_DFFLUSH_REQUIRED =3D 0x000F, + SEV_RET_INVALID_GUEST =3D 0x0010, + SEV_RET_INVALID_COMMAND =3D 0x0011, + SEV_RET_ACTIVE =3D 0x0012, + SEV_RET_HWSEV_RET_PLATFORM =3D 0x0013, + SEV_RET_HWSEV_RET_UNSAFE =3D 0x0014, + SEV_RET_UNSUPPORTED =3D 0x0015, + SEV_RET_INVALID_PARAM =3D 0x0016, + SEV_RET_RESOURCE_LIMIT =3D 0x0017, + SEV_RET_SECURE_DATA_INVALID =3D 0x0018, SEV_RET_INVALID_PAGE_SIZE =3D 0x0019, SEV_RET_INVALID_PAGE_STATE =3D 0x001A, SEV_RET_INVALID_MDATA_ENTRY =3D 0x001B, @@ -87,6 +87,22 @@ typedef enum { SEV_RET_RESTORE_REQUIRED =3D 0x0025, SEV_RET_RMP_INITIALIZATION_FAILED =3D 0x0026, SEV_RET_INVALID_KEY =3D 0x0027, + SEV_RET_SHUTDOWN_INCOMPLETE =3D 0x0028, + SEV_RET_INCORRECT_BUFFER_LENGTH =3D 0x0030, + SEV_RET_EXPAND_BUFFER_LENGTH_REQUEST =3D 0x0031, + SEV_RET_SPDM_REQUEST =3D 0x0032, + SEV_RET_SPDM_ERROR =3D 0x0033, + SEV_RET_SEV_STATUS_ERR_IN_DEV_CONN =3D 0x0035, + SEV_RET_SEV_STATUS_INVALID_DEV_CTX =3D 0x0036, + SEV_RET_SEV_STATUS_INVALID_TDI_CTX =3D 0x0037, + SEV_RET_SEV_STATUS_INVALID_TDI =3D 0x0038, + SEV_RET_SEV_STATUS_RECLAIM_REQUIRED =3D 0x0039, + SEV_RET_IN_USE =3D 0x003A, + SEV_RET_SEV_STATUS_INVALID_DEV_STATE =3D 0x003B, + SEV_RET_SEV_STATUS_INVALID_TDI_STATE =3D 0x003C, + SEV_RET_SEV_STATUS_DEV_CERT_CHANGED =3D 0x003D, + SEV_RET_SEV_STATUS_RESYNC_REQ =3D 0x003E, + SEV_RET_SEV_STATUS_RESPONSE_TOO_LARGE =3D 0x003F, SEV_RET_MAX, } sev_ret_code; =20 diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index 4d96d1fc12faf3d4fc1de687781e4dfa5fe4069d..720edfee7af6adcba70361b9427= 8024b860a1547 100644 --- a/linux-headers/linux/vfio.h +++ b/linux-headers/linux/vfio.h @@ -14,6 +14,7 @@ =20 #include #include +#include =20 #define VFIO_API_VERSION 0 =20 @@ -1478,6 +1479,33 @@ struct vfio_device_feature_bus_master { }; #define VFIO_DEVICE_FEATURE_BUS_MASTER 10 =20 +/** + * Upon VFIO_DEVICE_FEATURE_GET create a dma_buf fd for the + * regions selected. + * + * open_flags are the typical flags passed to open(2), eg O_RDWR, O_CLOEXE= C, + * etc. offset/length specify a slice of the region to create the dmabuf f= rom. + * nr_ranges is the total number of (P2P DMA) ranges that comprise the dma= buf. + * + * flags should be 0. + * + * Return: The fd number on success, -1 and errno is set on failure. + */ +#define VFIO_DEVICE_FEATURE_DMA_BUF 11 + +struct vfio_region_dma_range { + __u64 offset; + __u64 length; +}; + +struct vfio_device_feature_dma_buf { + __u32 region_index; + __u32 open_flags; + __u32 flags; + __u32 nr_ranges; + struct vfio_region_dma_range dma_ranges[] __counted_by(nr_ranges); +}; + /* -------- API for Type1 VFIO IOMMU -------- */ =20 /** diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 317f1ad23b14d200ce4fefe91c1726c469a44b0e..512a7c02c936a46cd333aa1293a= 6440dd08d9664 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1879,7 +1879,8 @@ static int virtio_net_process_rss(NetClientState *nc,= const uint8_t *buf, n->rss_data.runtime_hash_type= s); if (net_hash_type > NetPktRssIpV6UdpEx) { if (n->rss_data.populate_hash) { - hdr->hash_value =3D VIRTIO_NET_HASH_REPORT_NONE; + hdr->hash_value_lo =3D VIRTIO_NET_HASH_REPORT_NONE; + hdr->hash_value_hi =3D VIRTIO_NET_HASH_REPORT_NONE; hdr->hash_report =3D 0; } return n->rss_data.redirect ? n->rss_data.default_queue : -1; @@ -1888,7 +1889,8 @@ static int virtio_net_process_rss(NetClientState *nc,= const uint8_t *buf, hash =3D net_rx_pkt_calc_rss_hash(pkt, net_hash_type, n->rss_data.key); =20 if (n->rss_data.populate_hash) { - hdr->hash_value =3D hash; + hdr->hash_value_lo =3D cpu_to_le16(hash & 0xffff); + hdr->hash_value_hi =3D cpu_to_le16((hash >> 16) & 0xffff); hdr->hash_report =3D reports[net_hash_type]; } =20 @@ -1990,10 +1992,11 @@ static ssize_t virtio_net_receive_rcu(NetClientStat= e *nc, const uint8_t *buf, =20 receive_header(n, sg, elem->in_num, buf, size); if (n->rss_data.populate_hash) { - offset =3D offsetof(typeof(extra_hdr), hash_value); + offset =3D offsetof(typeof(extra_hdr), hash_value_lo); iov_from_buf(sg, elem->in_num, offset, (char *)&extra_hdr + offset, - sizeof(extra_hdr.hash_value) + + sizeof(extra_hdr.hash_value_lo) + + sizeof(extra_hdr.hash_value_hi) + sizeof(extra_hdr.hash_report)); } offset =3D n->host_hdr_len; --=20 2.52.0 From nobody Sat Feb 7 05:49:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769419400; cv=none; d=zohomail.com; s=zohoarc; b=C4FCoj2gTrOtmlt+UhxlGIKqj0Z5eJaJSFaTlELm5VNQ09rhWXrY5i1xFS+x2CwWlN28fliXbkvjkbDBK6PSmiOZBailuvJuRowYfTNZnchfzs4eHcmlwdb9AFn3MuibsIvOJj6q9YOrp2dDeK37LjrQU7HaTlvK4R3sjPJGUDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769419400; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3hEabu/Tq4sGkr6Y5w9RAh2UfpWvIsQdYKgROmkilT0=; b=XvFCBCaZUwox75NqvrFLopNxJmlFbLVmMunKCgucJirgrAjGecHbbUUEit6koeDileJaND5TZCmNDVrj7x8zWHJnEEd8oe2Shr7yQPOppTX8kKHgQGkgTBTqfObYAYnHMyh9TmYLV7C/lGZWMR9MTsja3nRPdoi7uEif7OkagrM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769419400859758.2885634676402; Mon, 26 Jan 2026 01:23:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkInz-0001xC-2P; Mon, 26 Jan 2026 04:22:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkIno-0001sE-3S for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkInm-0005z8-G3 for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:31 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-230-0aTBk0HpOP-_EuyI1Sxt0g-1; Mon, 26 Jan 2026 04:22:28 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E1FC51800473; Mon, 26 Jan 2026 09:22:26 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.175]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D0A5E1956095; Mon, 26 Jan 2026 09:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769419349; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3hEabu/Tq4sGkr6Y5w9RAh2UfpWvIsQdYKgROmkilT0=; b=cl0dHFyIbZfQcA/QcZaHKVErSHqRZ7DQNVChTPbVnPuUWh12G6eqo9KMGWa5FssAKXEh4l hQu58W2l8EleT1ISBRVSiKPrAVeXL602BTNY67k2O6bjEozfbjzb3bUThkC2O0X3U6yfL/ TInMxkAioOj2TwLYI3Eq4MlAcj+cI14= X-MC-Unique: 0aTBk0HpOP-_EuyI1Sxt0g-1 X-Mimecast-MFC-AGG-ID: 0aTBk0HpOP-_EuyI1Sxt0g_1769419347 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Shameer Kolothum , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Eric Auger , "Michael S. Tsirkin" Subject: [PULL 4/7] hw/vfio: Add helper to retrieve device feature Date: Mon, 26 Jan 2026 10:22:09 +0100 Message-ID: <20260126092212.503162-5-clg@redhat.com> In-Reply-To: <20260126092212.503162-1-clg@redhat.com> References: <20260126092212.503162-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769419402016158500 From: Shameer Kolothum Add vfio_device_get_feature() as a common helper to retrieve VFIO device features. No functional change intended. Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Shameer Kolothum Reviewed-by: Eric Auger Tested-by: Eric Auger Reviewed-by: Michael S. Tsirkin Link: https://lore.kernel.org/qemu-devel/20260121114111.34045-3-skolothumth= o@nvidia.com Signed-off-by: C=C3=A9dric Le Goater --- include/hw/vfio/vfio-device.h | 3 +++ hw/vfio/container.c | 2 +- hw/vfio/device.c | 9 +++++++++ hw/vfio/listener.c | 4 ++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/hw/vfio/vfio-device.h b/include/hw/vfio/vfio-device.h index f6f3d0e3786cf85553d75674828391e16f9fa250..35a5ec6d9224df515c354fe50fc= f7c80c1241c8c 100644 --- a/include/hw/vfio/vfio-device.h +++ b/include/hw/vfio/vfio-device.h @@ -272,6 +272,9 @@ bool vfio_device_get_host_iommu_quirk_bypass_ro(VFIODev= ice *vbasedev, uint32_t type, void *caps, uint32_t size); =20 +int vfio_device_get_feature(VFIODevice *vbasedev, + struct vfio_device_feature *feature); + int vfio_device_get_region_info(VFIODevice *vbasedev, int index, struct vfio_region_info **info); int vfio_device_get_region_info_type(VFIODevice *vbasedev, uint32_t type, diff --git a/hw/vfio/container.c b/hw/vfio/container.c index af16cd14db069882cc5fcf6349b433af3867f40c..4c2816b5741fa5232f104fb16fe= 919f7642f2a36 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -205,7 +205,7 @@ static int vfio_device_dma_logging_report(VFIODevice *v= basedev, hwaddr iova, feature->flags =3D VFIO_DEVICE_FEATURE_GET | VFIO_DEVICE_FEATURE_DMA_LOGGING_REPORT; =20 - return vbasedev->io_ops->device_feature(vbasedev, feature); + return vfio_device_get_feature(vbasedev, feature); } =20 static int vfio_container_iommu_query_dirty_bitmap( diff --git a/hw/vfio/device.c b/hw/vfio/device.c index 086f20f6762a3a86f52bbab840ef67f603850a01..973fc35b59d4bdaa34c0f2773ec= 78df0f151dfa2 100644 --- a/hw/vfio/device.c +++ b/hw/vfio/device.c @@ -547,6 +547,15 @@ bool vfio_device_get_host_iommu_quirk_bypass_ro(VFIODe= vice *vbasedev, return false; } =20 +int vfio_device_get_feature(VFIODevice *vbasedev, + struct vfio_device_feature *feature) +{ + if (!vbasedev->io_ops || !vbasedev->io_ops->device_feature) { + return -EINVAL; + } + return vbasedev->io_ops->device_feature(vbasedev, feature); +} + /* * Traditional ioctl() based io */ diff --git a/hw/vfio/listener.c b/hw/vfio/listener.c index 8ba1cd255d146ab8055ab73c71eac640eafa1bdd..1087fdc142e05ecd7890b68a08b= b562e161c501b 100644 --- a/hw/vfio/listener.c +++ b/hw/vfio/listener.c @@ -909,7 +909,7 @@ static void vfio_devices_dma_logging_stop(VFIOContainer= *bcontainer) continue; } =20 - ret =3D vbasedev->io_ops->device_feature(vbasedev, feature); + ret =3D vfio_device_get_feature(vbasedev, feature); =20 if (ret !=3D 0) { warn_report("%s: Failed to stop DMA logging, err %d (%s)", @@ -1014,7 +1014,7 @@ static bool vfio_devices_dma_logging_start(VFIOContai= ner *bcontainer, continue; } =20 - ret =3D vbasedev->io_ops->device_feature(vbasedev, feature); + ret =3D vfio_device_get_feature(vbasedev, feature); if (ret) { error_setg_errno(errp, -ret, "%s: Failed to start DMA logging", vbasedev->name); --=20 2.52.0 From nobody Sat Feb 7 05:49:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769419415; cv=none; d=zohomail.com; s=zohoarc; b=arp0s6zpgMSDuaElDICjoMJMFpfzvZC86g/4D1QrhgeVbadGc7IL+VvT3soEOu2b9zRIbXBK2+ZuDOTR8HA6J7Mc4S27O5c5mGKLJgvQBezecIB6FnzA5p/XWpu5PD/rumUIuxaFSubBZ6pUFq1Ay6k6R8IuEI2DZO/SQG4/6N4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769419415; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GPa5h3aD/5wLkODm+sqMFrJ0UMHGiuqZciNwX7qEZyg=; b=eJDicimQNuYcjqnhl86hN4P3D01NCf+wsi7ERG7gIVbybepCMEkGO/y+0SjU5wh2138XwIKQ/GXn7GMXFd4jjHFuGhRRCq9DFtpBm4LpM0tBXhS6L0O4qobCOAWQ5LOj+ZISsEezIflV3h7/3aQht/3T26tb2M3Cpgt7Nqzz21o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769419415940333.87724574235665; Mon, 26 Jan 2026 01:23:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkIo2-00020t-Pe; Mon, 26 Jan 2026 04:22:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkIns-0001v6-CH for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkInq-0005zi-2j for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:36 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-137-pDHmG497MsuOy6qbr-n5Qg-1; Mon, 26 Jan 2026 04:22:31 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EA6201944E45; Mon, 26 Jan 2026 09:22:29 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.175]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7A3E01956095; Mon, 26 Jan 2026 09:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769419353; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GPa5h3aD/5wLkODm+sqMFrJ0UMHGiuqZciNwX7qEZyg=; b=JwH8cunjg3KkCOnWxA/Sy3yvBOE7YaD77OD9OlTH2XtmOIRocb7gjimp+zLXygdJTafrSA tDCOSkrUL6bOux0AQ3WIwF/L3k4SlmuVoFHCJ7XTVMB+C9auMKcaBWhLny14CXFkKgn056 MpfV4BWTyVnkuOMXeVE8jovwMIAZhtk= X-MC-Unique: pDHmG497MsuOy6qbr-n5Qg-1 X-Mimecast-MFC-AGG-ID: pDHmG497MsuOy6qbr-n5Qg_1769419350 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Nicolin Chen , Zhenzhong Duan , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Shameer Kolothum , Eric Auger , "Michael S. Tsirkin" Subject: [PULL 5/7] hw/vfio/region: Create dmabuf for PCI BAR per region Date: Mon, 26 Jan 2026 10:22:10 +0100 Message-ID: <20260126092212.503162-6-clg@redhat.com> In-Reply-To: <20260126092212.503162-1-clg@redhat.com> References: <20260126092212.503162-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769419417587158500 From: Nicolin Chen Linux now provides a VFIO dmabuf exporter to expose PCI BAR memory for P2P use cases. Create a dmabuf for each mapped BAR region after the mmap is set up, and store the returned fd in the region=E2=80=99s RAMBlock. This allows= QEMU to pass the fd to dma_map_file(), enabling iommufd to import the dmabuf and map the BAR correctly in the host IOMMU page table. If the kernel lacks support or dmabuf setup fails, QEMU skips the setup and continues with normal mmap handling. Tested-by: Nicolin Chen Reviewed-by: Zhenzhong Duan Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Nicolin Chen Signed-off-by: Shameer Kolothum Reviewed-by: Eric Auger Tested-by: Eric Auger Reviewed-by: Michael S. Tsirkin Link: https://lore.kernel.org/qemu-devel/20260121114111.34045-4-skolothumth= o@nvidia.com Signed-off-by: C=C3=A9dric Le Goater --- hw/vfio/region.c | 65 +++++++++++++++++++++++++++++++++++++++++++- hw/vfio/trace-events | 1 + 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/hw/vfio/region.c b/hw/vfio/region.c index ca75ab1be4d601f5371c929a7784c8ba264df9ae..ab39d77574ccef0ca8d39343597= 9db97bcbd882b 100644 --- a/hw/vfio/region.c +++ b/hw/vfio/region.c @@ -29,6 +29,7 @@ #include "qemu/error-report.h" #include "qemu/units.h" #include "monitor/monitor.h" +#include "system/ramblock.h" #include "vfio-helpers.h" =20 /* @@ -238,13 +239,71 @@ static void vfio_subregion_unmap(VFIORegion *region, = int index) region->mmaps[index].mmap =3D NULL; } =20 +static bool vfio_region_create_dma_buf(VFIORegion *region, Error **errp) +{ + g_autofree struct vfio_device_feature *feature =3D NULL; + VFIODevice *vbasedev =3D region->vbasedev; + struct vfio_device_feature_dma_buf *dma_buf; + size_t total_size; + int i, ret; + + total_size =3D sizeof(*feature) + sizeof(*dma_buf) + + sizeof(struct vfio_region_dma_range) * region->nr_mmaps; + feature =3D g_malloc0(total_size); + *feature =3D (struct vfio_device_feature) { + .argsz =3D total_size, + .flags =3D VFIO_DEVICE_FEATURE_GET | VFIO_DEVICE_FEATURE_DMA_BUF, + }; + + dma_buf =3D (void *)feature->data; + *dma_buf =3D (struct vfio_device_feature_dma_buf) { + .region_index =3D region->nr, + .open_flags =3D O_RDWR, + .nr_ranges =3D region->nr_mmaps, + }; + + for (i =3D 0; i < region->nr_mmaps; i++) { + dma_buf->dma_ranges[i].offset =3D region->mmaps[i].offset; + dma_buf->dma_ranges[i].length =3D region->mmaps[i].size; + } + + ret =3D vfio_device_get_feature(vbasedev, feature); + if (ret < 0) { + if (ret =3D=3D -ENOTTY) { + warn_report_once("VFIO dma-buf not supported in kernel: " + "PCI BAR IOMMU mappings may fail"); + return true; + } + /* P2P DMA or exposing device memory use cases are not supported. = */ + error_setg_errno(errp, -ret, "%s: failed to create dma-buf: " + "PCI BAR IOMMU mappings may fail", + memory_region_name(region->mem)); + return false; + } + + /* Assign the dmabuf fd to associated RAMBlock */ + for (i =3D 0; i < region->nr_mmaps; i++) { + MemoryRegion *mr =3D ®ion->mmaps[i].mem; + RAMBlock *ram_block =3D mr->ram_block; + + ram_block->fd =3D ret; + ram_block->fd_offset =3D region->mmaps[i].offset; + trace_vfio_region_dmabuf(region->vbasedev->name, ret, region->nr, + memory_region_name(region->mem), + region->mmaps[i].offset, + region->mmaps[i].size); + } + return true; +} + int vfio_region_mmap(VFIORegion *region) { int i, ret, prot =3D 0; + Error *local_err =3D NULL; char *name; int fd; =20 - if (!region->mem) { + if (!region->mem || !region->nr_mmaps) { return 0; } =20 @@ -305,6 +364,10 @@ int vfio_region_mmap(VFIORegion *region) region->mmaps[i].size - 1); } =20 + if (!vfio_region_create_dma_buf(region, &local_err)) { + error_report_err(local_err); + } + return 0; =20 no_mmap: diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events index 180e3d526b80bd43d18bbfb9332833df4fbeb720..466695507b77c974ba0e4e61109= c0abe2d06c71c 100644 --- a/hw/vfio/trace-events +++ b/hw/vfio/trace-events @@ -118,6 +118,7 @@ vfio_device_put(int fd) "close vdev->fd=3D%d" vfio_region_write(const char *name, int index, uint64_t addr, uint64_t dat= a, unsigned size) " (%s:region%d+0x%"PRIx64", 0x%"PRIx64 ", %d)" vfio_region_read(char *name, int index, uint64_t addr, unsigned size, uint= 64_t data) " (%s:region%d+0x%"PRIx64", %d) =3D 0x%"PRIx64 vfio_region_setup(const char *dev, int index, const char *name, unsigned l= ong flags, unsigned long offset, unsigned long size) "Device %s, region %d = \"%s\", flags: 0x%lx, offset: 0x%lx, size: 0x%lx" +vfio_region_dmabuf(const char *dev, int fd, int index, const char *name, = unsigned long offset, unsigned long size) "Device %s, dmabuf fd %d region %= d \"%s\", offset: 0x%lx, size: 0x%lx" vfio_region_mmap_fault(const char *name, int index, unsigned long offset, = unsigned long size, int fault) "Region %s mmaps[%d], [0x%lx - 0x%lx], fault= : %d" vfio_region_mmap(const char *name, unsigned long offset, unsigned long end= ) "Region %s [0x%lx - 0x%lx]" vfio_region_exit(const char *name, int index) "Device %s, region %d" --=20 2.52.0 From nobody Sat Feb 7 05:49:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769419428; cv=none; d=zohomail.com; s=zohoarc; b=CqH5YphF5C++wWifHF/kuBKBMADYpv8+Pxkv15/PxDeaIeAVM5XdYgb46w+KJPNUcFf07yZibxoQGjq8WidzBF75F5a8aUPb69Jf9I5Jy3u+Rtt+FXnd3/tk25WKf5kSR09pDZBaryXG05l/e8zKQw3Zj4lsTr5w948i6Fo7qCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769419428; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=66kDQ2hv6CCMl0UoTs0whRJv33vogTxZaTih57LfNSM=; b=bn6UBrnBHMoMTx2jhBRYKKuAQ6DOw9OeqmnW6aomnGe+EpvyFonKdc6TnKfEYoLXAchiL67OXw1oZLDG5t3s7TlYyA/69w0bvSCVSAAmg9lJEJAZO4iabeaoYvwJJKrjoFNutl7f4SGkPpcyLfYV9FgHepaW1RkZobm47BCL5T4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769419428260328.8390707488418; Mon, 26 Jan 2026 01:23:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkIoE-00028l-W2; Mon, 26 Jan 2026 04:22:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkInu-0001w3-5N for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkIns-000607-8D for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:37 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-324-Zkei-aVMOqWI5O8ZmRzLNg-1; Mon, 26 Jan 2026 04:22:33 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D49F1955DBB; Mon, 26 Jan 2026 09:22:32 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.175]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 68FBD1956095; Mon, 26 Jan 2026 09:22:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769419355; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=66kDQ2hv6CCMl0UoTs0whRJv33vogTxZaTih57LfNSM=; b=LSrFB7TH3VXo5gxsZnJ/nSJM06gPByyyTHhNhl6vR59slesE9eWH16nOi1ZcqUQA+/Z9Ur 8J8wmnNgtb5zTnJ70lmeF9ByYm42ZZzgpDCgsWbAfuPgboSyBtMLLpOr8Yuzt5vZCa43LF wexXk/nO1ETQ1eycRVv2wxjpXq26N2w= X-MC-Unique: Zkei-aVMOqWI5O8ZmRzLNg-1 X-Mimecast-MFC-AGG-ID: Zkei-aVMOqWI5O8ZmRzLNg_1769419352 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Mark Cave-Ayland , John Levon , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 6/7] vfio-user: fix VFIO_PROXY_USE_MULTI constant value Date: Mon, 26 Jan 2026 10:22:11 +0100 Message-ID: <20260126092212.503162-7-clg@redhat.com> In-Reply-To: <20260126092212.503162-1-clg@redhat.com> References: <20260126092212.503162-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769419429455158500 From: Mark Cave-Ayland The constant value should represent the next bit in the VFIOProxy flags whi= ch is 0x10 and not 0x16. Signed-off-by: Mark Cave-Ayland Fixes: 1a0c32a9da ("vfio-user: add coalesced posted writes") Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20260121110055.2333711-2-mark.cave= ayland@nutanix.com Signed-off-by: C=C3=A9dric Le Goater --- hw/vfio-user/proxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h index 61e64a0020fcd3a12e6cf846682bb0c8e4352c07..b09fd886f17f24abcf8d99e5520= a39501c0486f1 100644 --- a/hw/vfio-user/proxy.h +++ b/hw/vfio-user/proxy.h @@ -94,7 +94,7 @@ typedef struct VFIOUserProxy { #define VFIO_PROXY_CLIENT 0x1 #define VFIO_PROXY_FORCE_QUEUED 0x4 #define VFIO_PROXY_NO_POST 0x8 -#define VFIO_PROXY_USE_MULTI 0x16 +#define VFIO_PROXY_USE_MULTI 0x10 =20 /* coalescing high and low water marks for VFIOProxy num_outgoing */ #define VFIO_USER_OUT_HIGH 1024 --=20 2.52.0 From nobody Sat Feb 7 05:49:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1769419418; cv=none; d=zohomail.com; s=zohoarc; b=X6D8mB+5tRPDOOSjl90Cir2J2GYfBqj7caHAgSQwSw6e6HKfqVB2Csb/Iq36iWPiR6pr43xN6SLP1Ychje/Y3mYvJk2+jY9lXQBSrnou9hJsx4XtEA7M/7iaTAAs93vQE1jp+6IzMbhKgDNR1AFTQoF+TPOHH6HRb500zoVnVVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769419418; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=I8+gTPo+yv/FqpTy8nATRmAuAwhNf/xZdt8S5Dqeu0g=; b=JW6AZX8fk3w+AdI3fV8f2mrJ4//0xsTZSkCFb8HIH9MMqvM8qft7b+JhlM9XGuIPWZJ3oVi8U2zPNS1vErABX62O8w0L3Rq+Uq9lHW6KNypwgYePhRZKOYQ3ZNS7KuWSeik30cQhpGsIp/lCX+JdGhbkltOrAWvtG2A3lLaJsWc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176941941886443.65674982317523; Mon, 26 Jan 2026 01:23:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkIoA-00024W-Pp; Mon, 26 Jan 2026 04:22:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkInx-0001xf-Ld for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkInw-00060W-38 for qemu-devel@nongnu.org; Mon, 26 Jan 2026 04:22:41 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-iSfoWPmpNfmeiDrJVAouzg-1; Mon, 26 Jan 2026 04:22:35 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7D4761955F2C; Mon, 26 Jan 2026 09:22:34 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.175]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BF4201956095; Mon, 26 Jan 2026 09:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769419359; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I8+gTPo+yv/FqpTy8nATRmAuAwhNf/xZdt8S5Dqeu0g=; b=i2HM94ddHv9U2FxF67C/8bXaQL4mpUrAUWktmp2DEiUzgdJxtWZepJBz2k4he+6y7h3YIi xK3yYNduVAobSpqHUDhXsqUPy+ttePu1yTMIRr5soFg5C7bhUuGpYjmKRmI9Bx4FSj07LO vGJysoj0y3VZvYFuBdUlBy3qmiRhLCc= X-MC-Unique: iSfoWPmpNfmeiDrJVAouzg-1 X-Mimecast-MFC-AGG-ID: iSfoWPmpNfmeiDrJVAouzg_1769419354 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Mark Cave-Ayland , John Levon , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 7/7] vfio-user: update VFIOProxy flag constants to use the BIT() macro Date: Mon, 26 Jan 2026 10:22:12 +0100 Message-ID: <20260126092212.503162-8-clg@redhat.com> In-Reply-To: <20260126092212.503162-1-clg@redhat.com> References: <20260126092212.503162-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1769419420543154100 From: Mark Cave-Ayland This should help avoid incorrect constant values being used in future. At the same time we can remove the gap left for BIT(1) which was originally intended for the VFIO_PROXY_NO_MMAP feature which was removed from later versions of the vfio-user series. Suggested-by: John Levon Signed-off-by: Mark Cave-Ayland Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20260121110055.2333711-3-mark.cave= ayland@nutanix.com Signed-off-by: C=C3=A9dric Le Goater --- hw/vfio-user/proxy.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h index b09fd886f17f24abcf8d99e5520a39501c0486f1..7b97460cc504a408e8e4299fa84= fd56a2d674aa0 100644 --- a/hw/vfio-user/proxy.h +++ b/hw/vfio-user/proxy.h @@ -91,10 +91,10 @@ typedef struct VFIOUserProxy { } VFIOUserProxy; =20 /* VFIOProxy flags */ -#define VFIO_PROXY_CLIENT 0x1 -#define VFIO_PROXY_FORCE_QUEUED 0x4 -#define VFIO_PROXY_NO_POST 0x8 -#define VFIO_PROXY_USE_MULTI 0x10 +#define VFIO_PROXY_CLIENT BIT(0) +#define VFIO_PROXY_FORCE_QUEUED BIT(1) +#define VFIO_PROXY_NO_POST BIT(2) +#define VFIO_PROXY_USE_MULTI BIT(3) =20 /* coalescing high and low water marks for VFIOProxy num_outgoing */ #define VFIO_USER_OUT_HIGH 1024 --=20 2.52.0