Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBA7A33E379 for ; Fri, 20 Feb 2026 12:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.97.179.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771589139; cv=none; b=H1XDQBW3T5PZwCGSpKJVALpZeqrk00PZAPTVlnbSlZqtKC3nrKfO7BKfYsYThaCS2WWS9O4ruEWH0pa9ozsh8Y5LDRCzSkqvPgZCfyx7RAfaSJlXx66qeyohkqoX6abE4nQymPQhrDqwOuGANjQuFPn7EdjAT31XZsb7zHCQTpM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771589139; c=relaxed/simple; bh=/w361SvblFJoPYwEFx2s+DxKg/z/ltk+EzG/HPT1qb0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uxRWAzOAZt8dU++nrs42c87Aq7YDFLSDcoM83fi+wp90KqhjA1qcc4x+KbnuF/z7kCg/cSVOn5vwqudKB2fI7igfq7TZvQWqmarHlVsYNU1k6Db39HCvDhvxYjbX1dnaSb7W3a8uk46qi7VgG2H8L7TGpbeuH3ESQOTFGapSTTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=WV8dyA2u; arc=none smtp.client-ip=213.97.179.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="WV8dyA2u" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=MVdTpJp5FvN6uZN1JWbKwlAa05JOua2sErkFp+VaSXE=; b=WV8dyA2uEXIJMx1aSVmXUHbdu5 AYzH3IN17nsN8WjpJX+GG72Jpabp25gUpK9hChF/8v+JGqEh2+7TUG41BsWhW2Fgz0sOURzDsIgMc Nw7m5r6t8u+kb4stx3hGkK/ouXlmSNWoEYT0t73YJXo5YKL0pUL0XfhdwC7zANFvAG+cOrzIMh5AI qVuHqF33FuhJ+gMQqdbSqxGWK7sY2hIAO6uN6I5CsPCaPvcRlvlO+ch2EOn8XPeV23625W4QPpwQH xrx9q7XnPnmDImB/JU0pr8mzgcWauJneA/9DZqzJHFcb8ZALFStzHZvGKlkDedeGhULPD96TWUVDL dcJXi9qg==; Received: from [90.240.106.137] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1vtPGJ-002v0A-T7; Fri, 20 Feb 2026 13:05:35 +0100 From: Tvrtko Ursulin To: criu@lists.linux.dev Cc: David Francis , Tvrtko Ursulin Subject: [RFC 15/26] plugins/amdgpu: Add plugin to inventory even if process has no vmas Date: Fri, 20 Feb 2026 12:05:03 +0000 Message-ID: <20260220120514.4540-16-tvrtko.ursulin@igalia.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260220120514.4540-1-tvrtko.ursulin@igalia.com> References: <20260220120514.4540-1-tvrtko.ursulin@igalia.com> Precedence: bulk X-Mailing-List: criu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently the plugin is added to the inventory only if there were amdgpu mapped vmas in the target process. This makes restoring a simple process with only an open DRM fd and some buffer objects not work. Fix it by adding the plugin to the inventory when there were open DRM files as well. Signed-off-by: Tvrtko Ursulin --- plugins/amdgpu/amdgpu_plugin.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/plugins/amdgpu/amdgpu_plugin.c b/plugins/amdgpu/amdgpu_plugin.c index b3cc3a12ce2e..c9c1c8278d74 100644 --- a/plugins/amdgpu/amdgpu_plugin.c +++ b/plugins/amdgpu/amdgpu_plugin.c @@ -448,6 +448,22 @@ struct thread_data { int id; /* File ID used by CRIU to identify KFD image for this process */ }; +static int amdgpu_add_to_inventory(void) +{ + int ret; + + if (plugin_added_to_inventory) + return 0; + + ret = add_inventory_plugin(CR_PLUGIN_DESC.name); + if (ret) + pr_err("Failed to add AMDGPU plugin to inventory image\n"); + else + plugin_added_to_inventory = true; + + return 0; +} + int amdgpu_plugin_handle_device_vma(int fd, const struct stat *st_buf) { struct stat st_kfd; @@ -471,13 +487,8 @@ int amdgpu_plugin_handle_device_vma(int fd, const struct stat *st_buf) if (ret) pr_perror("%s(), Can't handle VMAs of input device", __func__); - if (!ret && !plugin_added_to_inventory) { - ret = add_inventory_plugin(CR_PLUGIN_DESC.name); - if (ret) - pr_err("Failed to add AMDGPU plugin to inventory image\n"); - else - plugin_added_to_inventory = true; - } + if (!ret) + ret = amdgpu_add_to_inventory(); return ret; } @@ -1458,8 +1469,12 @@ int amdgpu_plugin_dump_file(int fd, int id) if (ret) return ret; - /* Need to return success here so that criu can call plugins for renderD nodes */ - return try_dump_dmabuf_list(); + ret = try_dump_dmabuf_list(); + + if (!ret) + ret = amdgpu_add_to_inventory(); + + return ret; } pr_info("%s() called for fd = %d\n", __func__, major(st.st_rdev)); -- 2.52.0