Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2164640rda; Tue, 24 Oct 2023 14:38:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFeCd3XJ36CKmkoDHp5GHFcx4Shjtz7GniWyo7hXk5kAfb67y3Jrbog5qyBnEXqJT90f23j X-Received: by 2002:a05:6a20:3d1f:b0:17b:9675:23fa with SMTP id y31-20020a056a203d1f00b0017b967523famr4830075pzi.24.1698183487551; Tue, 24 Oct 2023 14:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698183487; cv=none; d=google.com; s=arc-20160816; b=Caq4AIhubfo7V4WJQJ3sPhNdqiFhFMEAGqBWM2/tzBEs33Zh8u2I7/w9ZX6LUOg5BM tVQRsm8PuTILjhHVM2Jq995tvXgaFP1bhF1JA0ZqZ0l05Xk3PqMzCyjBfLWbR2UvF1xS mDY9HuFVLjDO/2vEmZC6QX/MHcLs2gpipFem054zpHsNzHlzTohrzV4u0A2cvRFv+T1q PblaMg+I4Qh96sK1i4XaNPJCX4Z+PC0UqUOZnN5Il2lCdFaTDhuysxb7KWZjaLJTb1HR bogcGYaFhUA3qtEo+ppN+HATi0zuX1DeVCxxFCCFy7m4kG1qBL5hZLUm1wuD6s0cPcH/ RA8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ChkYc+GULd0fN/nFw+559WVZQK+W9W42DJqglKFeScU=; fh=j4GZXefy+ACJEAl/8S/XN9HEFB4cW+dm70uQRQ6PE7A=; b=ANovfC89kI1yJZe79iq1er7+ujZ2323m1rqKZhTbyJsjIObILEOIWvANfINDU3aRUu XsUQoMNwABaUQdPR+TYWzJTDiQcbVOu0Ugpjmz9d7y6A7noyTA+5PKEzE5wcL0zQsb6P J5OTwM5zCWOl4INomvt4HY8NQ11moN75lVbwbCnn7NO9qQ9ni84irC2O+SMgo2qEohvL 6YighNqTOVn5m9791SxUA1rp8LdTHVD6gqHqt5a/ALO4KULf0bOzmk2d86ok0cZ8hZ44 5cNTgT7+lN3B1xcoiAd6U8a8bkrUmQwsSY3h7Cdx8q994B6N9iE0o6kx5Jy/+1DoI7FC 980g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@debian.org header.s=smtpauto.stravinsky header.b=jgS0xGKi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id d185-20020a6336c2000000b00573fd9be4bdsi9344338pga.493.2023.10.24.14.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:38:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@debian.org header.s=smtpauto.stravinsky header.b=jgS0xGKi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 1D91D80A9AA5; Tue, 24 Oct 2023 14:38:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344155AbjJXVht (ORCPT + 99 others); Tue, 24 Oct 2023 17:37:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbjJXVhr (ORCPT ); Tue, 24 Oct 2023 17:37:47 -0400 X-Greylist: delayed 1674 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 24 Oct 2023 14:37:45 PDT Received: from stravinsky.debian.org (stravinsky.debian.org [IPv6:2001:41b8:202:deb::311:108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D68BA3 for ; Tue, 24 Oct 2023 14:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description; bh=ChkYc+GULd0fN/nFw+559WVZQK+W9W42DJqglKFeScU=; b=jgS0xGKis2ZlA68GNnBZdMS9lD oXP0rqV8nrev5Hm8P6PbGRjqoO0d35X0DquI6KsdZ+2y8e7KMp/O/vw84ZSaC+FHU/kkdtK+4Oc6W tIy4SpCLEn3SOB80+ZzO/kHWQTl2R3/DiU3KrAvuJ7/p7ilBDYSFLl6rRoso34QL3qXjznQraJP9l 1Vi58fBIQUHN1ACufUi80hd+5Wfr74+TTtHf0kXwqXFGjDgR/78gXF0Ji1uuQ6wGPO/cuuyNS6f8Z GP5TmRw4MlPYFa8RqA4RHDl+w6yAJLCqy3ou5sgU2jjfcsf/7ILH2L19WF3CF6ZWQ3ZxsLfcWipzX X6BQ/EEA==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1qvOeG-00FPhY-LQ; Tue, 24 Oct 2023 21:09:12 +0000 Received: by eldamar.lan (Postfix, from userid 1000) id 9ED23BE2DE0; Tue, 24 Oct 2023 23:09:10 +0200 (CEST) Date: Tue, 24 Oct 2023 23:09:10 +0200 From: Salvatore Bonaccorso To: Timo Lindfors , 1054514@bugs.debian.org Cc: Gerd Hoffmann , Thomas Zimmermann , Dave Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, regressions@lists.linux.dev Subject: Re: Bug#1054514: linux-image-6.1.0-13-amd64: Debian VM with qxl graphics freezes frequently Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Debian-User: carnil X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 24 Oct 2023 14:38:04 -0700 (PDT) Hi Timo, On Tue, Oct 24, 2023 at 11:14:32PM +0300, Timo Lindfors wrote: > Package: src:linux > Version: 6.1.55-1 > Severity: normal > > Steps to reproduce: > 1) Install Debian 12 as a virtual machine using virt-manager, choose qxl > graphics card. You only need basic installation without wayland or X. > 2) Login from the console and save th? following to reproduce.bash: > > #!/bin/bash > > chvt 3 > for j in $(seq 80); do > echo "$(date) starting round $j" > if [ "$(journalctl --boot | grep "failed to allocate VRAM BO")" != "" ]; > then > echo "bug was reproduced after $j tries" > exit 1 > fi > for i in $(seq 100); do > dmesg > /dev/tty3 > done > done > > echo "bug could not be reproduced" > exit 0 > > > 3) Run chmod a+x reproduce.bash > 4) Run ./reproduce.bash and wait for up to 20 minutes. > > Expected results: > 4) The system prints a steady flow of text without kernel error messages > > Actual messages: > 4) At some point the text stops flowing and the script prints "bug was > reproduced". If you run "journalctl --boot" you see > > kernel: [TTM] Buffer eviction failed > kernel: qxl 0000:00:02.0: object_init failed for (3149824, 0x00000001) > kernel: [drm:qxl_alloc_bo_reserved [qxl]] *ERROR* failed to allocate VRAM BO > > > > More info: > 1) The bug does not occur if I downgrade the kernel to > linux-image-5.10.0-26-amd64_5.10.197-1_amd64.deb from Debian 11. > 2) I used the following test_linux.bash to bisect this issue against > upstream source: > > #!/bin/bash > set -x > > gitversion="$(git describe HEAD|sed 's@^v@@')" > > git checkout drivers/gpu/drm/ttm/ttm_bo.c include/drm/ttm/ttm_bo_api.h > git show bec771b5e0901f4b0bc861bcb58056de5151ae3a | patch -p1 > # Build > cp ~/kernel.config .config > # cp /boot/config-$(uname -r) .config > # scripts/config --enable LOCALVERSION_AUTO > # scripts/config --disable DEBUG_INFO > # scripts/config --disable SYSTEM_TRUSTED_KEYRING > # scripts/config --set-str SYSTEM_TRUSTED_KEYS '' > # scripts/config --disable STACKPROTECTOR_STRONG > make olddefconfig > # make localmodconfig > make -j$(nproc --all) bindeb-pkg > rc="$?" > if [ "$rc" != "0" ]; then > exit 125 > fi > git checkout drivers/gpu/drm/ttm/ttm_bo.c include/drm/ttm/ttm_bo_api.h > > package="$(ls --sort=time ../linux-image-*_amd64.deb|head -n1)" > version=$(echo $package | cut -d_ -f1|cut -d- -f3-) > > if [ "$gitversion" != "$version" ]; then > echo "Build produced version $gitversion but got $version, ignoring" > #exit 255 > fi > > # Deploy > scp $package target:a.deb > ssh target sudo apt install ./a.deb > ssh target rm -f a.deb > ssh target ./grub_set_default_version.bash $version > ssh target sudo shutdown -r now > sleep 40 > > detected_version=$(ssh target uname -r) > if [ "$detected_version" != "$version" ]; then > echo "Booted to $detected_version but expected $version" > exit 255 > fi > > # Test > exec ssh target sudo ./reproduce.bash > > > Bisect printed the following log: > > git bisect start > # bad: [ed29c2691188cf7ea2a46d40b891836c2bd1a4f5] drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v7. > git bisect bad ed29c2691188cf7ea2a46d40b891836c2bd1a4f5 > # bad: [762949bb1da78941b25e63f7e952af037eee15a9] drm: fix drm_mode_create_blob comment > git bisect bad 762949bb1da78941b25e63f7e952af037eee15a9 > # bad: [e40f97ef12772f8eb04b6a155baa1e0e2e8f3ecc] drm/gma500: Drop DRM_GMA600 config option > git bisect bad e40f97ef12772f8eb04b6a155baa1e0e2e8f3ecc > # bad: [5a838e5d5825c85556011478abde708251cc0776] drm/qxl: simplify qxl_fence_wait > git bisect bad 5a838e5d5825c85556011478abde708251cc0776 > # bad: [d2b6f8a179194de0ffc4886ffc2c4358d86047b8] Merge tag 'xfs-5.13-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux > git bisect bad d2b6f8a179194de0ffc4886ffc2c4358d86047b8 > # bad: [68a32ba14177d4a21c4a9a941cf1d7aea86d436f] Merge tag 'drm-next-2021-04-28' of git://anongit.freedesktop.org/drm/drm > git bisect bad 68a32ba14177d4a21c4a9a941cf1d7aea86d436f > # bad: [0698b13403788a646073fcd9b2294f2dce0ce429] drm/amdgpu: skip PP_MP1_STATE_UNLOAD on aldebaran > git bisect bad 0698b13403788a646073fcd9b2294f2dce0ce429 > # bad: [e1a5e6a8c48bf99ea374fb3e535661cfe226bca4] drm/doc: Add RFC section > git bisect bad e1a5e6a8c48bf99ea374fb3e535661cfe226bca4 > # bad: [ed29c2691188cf7ea2a46d40b891836c2bd1a4f5] drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v7. > git bisect bad ed29c2691188cf7ea2a46d40b891836c2bd1a4f5 > # bad: [2c8ab3339e398bbbcb0980933e266b93bedaae52] drm/i915: Pin timeline map after first timeline pin, v4. > git bisect bad 2c8ab3339e398bbbcb0980933e266b93bedaae52 > # bad: [2eb8e1a69d9f8cc9c0a75e327f854957224ba421] drm/i915/gem: Drop relocation support on all new hardware (v6) > git bisect bad 2eb8e1a69d9f8cc9c0a75e327f854957224ba421 > # bad: [b5b6f6a610127b17f20c0ca03dd27beee4ddc2b2] drm/i915/gem: Drop legacy execbuffer support (v2) > git bisect bad b5b6f6a610127b17f20c0ca03dd27beee4ddc2b2 > # bad: [06debd6e1b28029e6e77c41e59a162868f377897] Merge tag 'drm-intel-next-2021-03-16' of git://anongit.freedesktop.org/drm/drm-intel into drm-next > git bisect bad 06debd6e1b28029e6e77c41e59a162868f377897 > # good: [e19eede54240d64b4baf9b0df4dfb8191f7ae48b] Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging > git bisect good e19eede54240d64b4baf9b0df4dfb8191f7ae48b > # good: [1e28eed17697bcf343c6743f0028cc3b5dd88bf0] Linux 5.12-rc3 > git bisect good 1e28eed17697bcf343c6743f0028cc3b5dd88bf0 > # bad: [6af70eb3b40edfc8bdf2373cdc2bcf9d5a20c8c7] drm/atmel-hlcdc: Rename custom plane state variable > git bisect bad 6af70eb3b40edfc8bdf2373cdc2bcf9d5a20c8c7 > # good: [4ca77c513537700d3fae69030879f781dde1904c] drm/qxl: release shadow on shutdown > git bisect good 4ca77c513537700d3fae69030879f781dde1904c > # bad: [4a11bd1e88af130f50a72e0f54391c1c7d268e03] drm/ast: Add constants for VGACRCB register bits > git bisect bad 4a11bd1e88af130f50a72e0f54391c1c7d268e03 > # bad: [5c209d8056b9763ce544ecd7dadb3782cdaf96ed] drm/gma500: psb_spank() doesn't need it's own file > git bisect bad 5c209d8056b9763ce544ecd7dadb3782cdaf96ed > # bad: [db0c6bd2c0c0dada8927cd46a7c34c316a3a6c04] drm/gem: Export drm_gem_vmap() and drm_gem_vunmap() > git bisect bad db0c6bd2c0c0dada8927cd46a7c34c316a3a6c04 > # bad: [f4a84e165e6d58606097dd07b5b78767a94b870c] drm/qxl: allocate dumb buffers in ram > git bisect bad f4a84e165e6d58606097dd07b5b78767a94b870c > # good: [a7709b9b89a67f3ead2d188b1d0c261059b1f291] drm/qxl: handle shadow in primary destroy > git bisect good a7709b9b89a67f3ead2d188b1d0c261059b1f291 > # bad: [5a838e5d5825c85556011478abde708251cc0776] drm/qxl: simplify qxl_fence_wait > git bisect bad 5a838e5d5825c85556011478abde708251cc0776 > # good: [5f6c871fe919999774e8535ea611a6f84ee43ee4] drm/qxl: properly free qxl releases > git bisect good 5f6c871fe919999774e8535ea611a6f84ee43ee4 > # first bad commit: [5a838e5d5825c85556011478abde708251cc0776] drm/qxl: simplify qxl_fence_wait > > I took a look at > > commit 5a838e5d5825c85556011478abde708251cc0776 (refs/bisect/bad) > Author: Gerd Hoffmann > Date: Thu Feb 4 15:57:10 2021 +0100 > > drm/qxl: simplify qxl_fence_wait > > Now that we have the new release_event wait queue we can just > use that in qxl_fence_wait() and simplify the code a lot. > > Signed-off-by: Gerd Hoffmann > Acked-by: Thomas Zimmermann > Link: http://patchwork.freedesktop.org/patch/msgid/20210204145712.1531203-10-kraxel@redhat.com > > > and noticed that the bug does not occur if I boot 6.1 kernel with this patch > reverted (see attached file). Thanks for the excelent constructed report! I think it's best to forward this directly to upstream including the people for the bisected commit to get some idea. Can you reproduce the issue with 6.5.8-1 in unstable as well? If not, are you able to isolate an upstream fix which should be backported to the 6.1.y series as well? Regards, Salvatore