From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66F30606A322 for ; Thu, 3 Dec 2026 01:50:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=PQLm5swV Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYvx4-00052z-Mx; Wed, 02 Dec 2026 20:49:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYvwz-00051Q-9t for qemu-devel@nongnu.org; Wed, 02 Dec 2026 20:49:33 -0500 Received: from mail-northcentralusazon11013000.outbound.protection.outlook.com ([40.107.201.0] helo=CH4PR04CU002.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYvwx-0000Qu-2J for qemu-devel@nongnu.org; Wed, 02 Dec 2026 20:49:33 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yx+tfBuajqacUPulrthQcAN8IS3tHenBr3x2a6oXhqQOb4s2gFCpPtVU3BuHt+NfilVw/UgVwTTCx1VSkrY5yFLzQuUu+gE/4iYhYojhCFaCJbW+2mQWi41/zkgyeUpxFG8ZjVhdn6QhzqYf8u2LOQx0YXpl1JqshlLmgIZxjufi/0lHdjuIUNeg4SROhanYdoyz+80Wescv+hcJ/ZZd1gfW7ryLSyDHWgrA/MgOISpcGooh/9y7Uh6L4sIi9bVEHQBo90L2q2rNTTmc/jXcAncqKc8QevBzzrSBsu5O+dGPu6PPnX1gMDoquQXR4j17XgciesLOmVVSof8pOo4h0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v3lSbYdZJuw38jhWPbhtJkt/Js4SY/65DeVSWZxvRsI=; b=XDp0qyVqbHkS56ugstgZ35XDn87flSS9qvXCs3Fs22eB/28Y3UCX2MRaSGSSWLMv/RMXRG3u0XuY9Y0cSkhtstnTkcu8I8lFnA+oSTFD/dWtiyWFjmWgR3vUn+HKV3tmswJQyAAFyR5TmZgyUzIl6I1Y6QO5E6mld8FwfpMxi5VXDtfxrM1gVgCOWqAwy/rAewIobm9RLWqy88YJViZVebMziDB6DsW7I7jJ/MtCS/QOOp4K8su1HRLlbqIyfMAUOLVsgU5QmvehitziFd9+i3HDq7k0tbUBYgJq7vE489CUKgLRwWtWInEnwkFCZPGJqzNhSBp0wGwkFyfjjLlfIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v3lSbYdZJuw38jhWPbhtJkt/Js4SY/65DeVSWZxvRsI=; b=PQLm5swVbYZKoP4nPwEbFJJEKU7m/8scSU5SaVkgZn1j+0esN/PB2w8f2I2CpdpO/SnpnZtiXbduAzLDfs+IDjOw7nNGC2qF0UciP+fzPBM36ROcz5JGoss/9KTQfAdYCTUVYU65GHAa7CjwSIn5q48SYyasMchuo8UIqyZfbsM= Received: from SJ0PR05CA0074.namprd05.prod.outlook.com (2603:10b6:a03:332::19) by LV2PR12MB5989.namprd12.prod.outlook.com (2603:10b6:408:171::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Thu, 3 Dec 2026 01:44:19 +0000 Received: from MW1PEPF00018893.namprd03.prod.outlook.com (2603:10b6:a03:332:cafe::90) by SJ0PR05CA0074.outlook.office365.com (2603:10b6:a03:332::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.662.4 via Frontend Transport; Thu, 3 Dec 2026 01:44:19 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by MW1PEPF00018893.mail.protection.outlook.com (10.167.249.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Thu, 3 Dec 2026 01:44:19 +0000 Received: from honglei-remote.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 19:44:16 -0600 From: Honglei Huang To: , , , CC: , , , , Subject: [RFC PATCH v8 0/5] virtio-gpu: Add userptr support and ROCm capability Date: Thu, 3 Dec 2026 09:43:47 +0800 Message-ID: <20261203014352.1792475-1-honghuan@amd.com> X-Mailer: git-send-email 2.34.1 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW1PEPF00018893:EE_|LV2PR12MB5989:EE_ X-MS-Office365-Filtering-Correlation-Id: 636004c9-10e3-4b80-a2ff-08df50def2c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700016|376014|23010399003|1800799024|82310400026|56012099006|261102123227099003|261026121527099003|261026140227099003|261022113327099003|261021121427099003|261021123027099003|261009223027099003|261022075727099003|261028144727099003|10067099003|261022105027099003|18002099003|11063799006|6133799003|13003099007; X-Microsoft-Antispam-Message-Info: y+NU7mtGylPKcF5BYdLQgmPaAMhCNSqF87vIvJofSsfcNS2kuQM24tTmaT9aSEOQhfpBKCOldkoGhhtOB34e4ZguBM/pEhRgX6dg2SlNr/zVmWfif/NrPJ7FAiD3RKtDPGpXJ0XaOJdEEZ9pDgqYwTFcYq7B3jSkO6/IA0F/McmzTdJkOEGXlW/0xD1sHgnZR7BfHofUsnGWhUk2/toBBJSzE9JAUphk/Og0Q6FJdV/fWwAuAULgexXauxNCbDjyiK4IMzzMEaQWcu3nzA3Ra+MFrZlK1Lz1xQGLuuGn5qgAqyDGb3tJbxP7QNp5zBU5uo7Yhg+SlLz7/RNkS0igDpNm7WYP0NiZ4bIwskzyg49J5Bf97zpu+nKsgZ8rKl1Z034E6VjnV7R9yYHfQeTJFmgXQlT8TxWsXMfQAFtZrpYWZTcVZrUsgFuazkkPa7AkfY1z1boFTV202MzASMrR3D9DzVlbVDhPXP2wdztfb6OoA0GSVBXFOI2WpsMJmRvQowu4IciemY88RFS2LiBSizfNsDKDQOR6fZAnaCV5cq90+w94OFkuY8CXl2otD69Xojc9hvF5u6GnlZkZUjqMX091V/Afm8X6i7amcDvJzc1of2cXRZHuwwpO++gYnaXqTJUfgZcdGOlaqc4QzdJBPw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700016)(376014)(23010399003)(1800799024)(82310400026)(56012099006)(261102123227099003)(261026121527099003)(261026140227099003)(261022113327099003)(261021121427099003)(261021123027099003)(261009223027099003)(261022075727099003)(261028144727099003)(10067099003)(261022105027099003)(18002099003)(11063799006)(6133799003)(13003099007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SK3mkYeUwAFtj+StpKrxtkuiytW6z9N7tku5nBNVWj38Ga+3K55Okdy4h8OIyyMu733dfM5AFGqrSi+tD09svPlLf7xoQhMjnwrhBcfh/gPzewH/Fit55IHC9+6oWF3L9bh3ZwQ9rk0JizUducpKZ9cXYr1FOBz7lxUDADhyNSuPxTWoLPNA6pogElTHjBLTlUrisRdMe+8o4QtunKq1tZlYIU1B51FCbNu56tJIZC19a8JH5xWIDDrnXUv9p9bXRCXx2lzUDkBY+ECPOGxAq+3E/h5D9EpqTpi49SAcCLetN5ZC6+LA/R+XhgEKypn6RTnsjLIwpJfUa3PQsPavPOXUG/tPKHKFK2q792Th/LNEIWR8ndzecUq7WCm/cQn+aP9iD1HOasf0daWKNHemDTL0dLhFv407+4uZk5zhESPixu/ywzkavh7pwoHR4UwO X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 01:44:19.4677 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 636004c9-10e3-4b80-a2ff-08df50def2c7 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MW1PEPF00018893.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5989 Received-SPF: pass client-ip=40.107.201.0; envelope-from=Honglei1.Huang@amd.com; helo=CH4PR04CU002.outbound.protection.outlook.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_MSPIKE_H2=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-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 This patch series introduces enhancements to virtio-gpu to improve memory management and GPU virtualization capabilities for ROCm (Radeon Open Compute) workloads. Usage example: -device virtio-gpu-gl,rocm=on The series includes: 1. Add ROCm capset ID 10 to the imported Linux headers. 2. Enable ROCm native contexts through the "rocm=on" device property. 3. Replace the qemu side 16384 entry limit with an overflow check. 4. Add VIRTIO_GPU_F_BLOB_READONLY and VIRTIO_GPU_BLOB_FLAG_USE_READONLY to the imported Linux headers. 5. Advertise readonly blob support whenever blobs are enabled. See overall detail in virglrenderer pr [1]. kernel header change patch: [2]. Virtio spec change request: [3]. Changes in v8: - Rebase onto current master. - Patches 1, 4: generate with update-linux-headers.sh from [2] (Alex). - Patch 2: add Dmitry's Reviewed-by. - Patch 3: check entry array size overflow, not a fixed limit (Dmitry). - Patch 5: advertise readonly blobs generically (Dmitry). Changes in v7: - Replace the obsolete USE_USERPTR=0x8 / USERPTR_RDONLY=0x10 header definitions with negotiated BLOB_READONLY feature bit 6 and USE_READONLY=0x8. - Use ROCm capset ID 10 rather than 8. - Add readonly advertisement for the paired ROCm blob backend. Changes in v6: - Changed to RFC status - Removed VIRTIO_GPU_F_RESOURCE_USERPTR feature flag from patch 1 - Added VIRTIO_GPU_BLOB_FLAG_USERPTR_RDONLY flag to patch 1 Changes in v5: - Split userptr header updates into dedicated patch (patch 1/4) - Extracted nr_entries limit removal into standalone commit (patch 2/4) - Split ROCm header updates into dedicated patch (patch 3/4) - Removed VIRTIO_GPU_F_RESOURCE_USERPTR feature detection - Keep ROCm capability support with "rocm=on" device property (patch 4/4) - Change corresponding commit messages, change corresponding cover letter content - Remove RFC label Changes in v4: - Change this series to RFC - Renamed HSAKMT-related functionality to ROCm for better clarity and alignment with the ROCm ecosystem terminology - Changed device property from "hsakmt=on" to "rocm=on" - Changed flag from VIRTIO_GPU_FLAG_HSAKMT_ENABLED to VIRTIO_GPU_FLAG_ROCM_ENABLED - Changed renderer flag from VIRGL_RENDER_USE_HSAKMT to VIRGL_RENDERER_USE_ROCM - Updated capset handling to use VIRTIO_GPU_CAPSET_ROCM (8) instead of VIRTIO_GPU_CAPSET_HSAKMT (8) - Removed the error handling fix from patch 1 (virtio-gpu-virgl.c) into another thread Changes in v3: - Renamed HSAKMT-related functionality to ROCm for better clarity and alignment with the ROCm ecosystem terminology - Changed device property from "hsakmt=on" to "rocm=on" - Changed flag from VIRTIO_GPU_FLAG_HSAKMT_ENABLED to VIRTIO_GPU_FLAG_ROCM_ENABLED - Changed renderer flag from VIRGL_RENDER_USE_HSAKMT to VIRGL_RENDERER_USE_ROCM - Updated capset handling to use VIRTIO_GPU_CAPSET_ROCM (8) instead of VIRTIO_GPU_CAPSET_HSAKMT (8) - Removed the error handling fix from patch 1 (virtio-gpu-virgl.c) into another thread Changes in v2: - Fixed error handling bug in virtio-gpu-virgl.c where the return value check was inverted (changed from "if (!ret)" to "if (ret != 0)") - Added VIRGL_RENDER_USE_HSAKMT flag initialization in virtio_gpu_virgl_init() when HSAKMT support is enabled - Simplified blob resource creation logic by removing complex conditional branching for userptr vs regular blob handling - Updated commit messages to reflect bug fixes and improvements - Added references to related patches in Linux kernel, virglrenderer, and ROCm Runtime components for complete feature implementation tracking [1]: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1708 [2]: https://lore.kernel.org/all/20261202101658.1209083-1-honghuan@amd.com/ [3]: https://lore.kernel.org/virtio-comment/20261202095728.1127178-1-honghuan@amd.com/ Honglei Huang (5): linux-headers: Update to v7.4-rc2-userptr-v11 for ROCm capset (!UPSTREAM) virtio-gpu: Add ROCm capability support virtio-gpu: remove the artificial IOV mapping limit linux-headers: Update to v7.4-rc2-userptr-v11 for readonly blob (!UPSTREAM) virtio-gpu: advertise readonly blobs hw/display/virtio-gpu-base.c | 1 + hw/display/virtio-gpu-gl.c | 2 ++ hw/display/virtio-gpu-rutabaga.c | 7 ++++++ hw/display/virtio-gpu-virgl.c | 24 +++++++++++++++++++++ hw/display/virtio-gpu.c | 19 ++++++++++------ include/hw/virtio/virtio-gpu.h | 3 +++ include/standard-headers/linux/virtio_gpu.h | 6 ++++++ 7 files changed, 55 insertions(+), 7 deletions(-) base-commit: 9cda597a1a3903d090e8e55e23f5b8a859da88ab -- 2.34.1