From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF59CC433F5 for ; Sat, 13 Nov 2021 17:07:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C17FF60F6B for ; Sat, 13 Nov 2021 17:07:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235849AbhKMRKD (ORCPT ); Sat, 13 Nov 2021 12:10:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232586AbhKMRKC (ORCPT ); Sat, 13 Nov 2021 12:10:02 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EA59C061766 for ; Sat, 13 Nov 2021 09:07:09 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id v11so51329694edc.9 for ; Sat, 13 Nov 2021 09:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nRHTN+KJ/0jakG/3S1m86FduFSvoZNR/waj5CoABhhY=; b=AI5EgBuhXv3ifPQ/QJGAcgXo9vjiG/by8UhhOa7KCZNrvEzzpepwyfZxQwC1UOwsTg 3NZXmVOf8DUa+Rt2QZOWgxDJuoswYf8qCtbhrV+XAj0eYtpUMzeJaj3aEp1I532no0eE 8qsaWz4Ud04P5QaZPk1SnPlYrcPiAhAz2LsOE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nRHTN+KJ/0jakG/3S1m86FduFSvoZNR/waj5CoABhhY=; b=PCudyzcJ+wavFZR3ONMe1JLpLK1XTrFHk799jR4EAMKrKvIRhLJ/cWNVTTRGQ5MoSm MygzhaPp2/ZbfMxEB93LR4BId7vlnpTG1Wa0LNWzC/3DHQe/jrBrd5+MiN0ib9fOivt4 hrmcf8TA6C8EdI7Pxk0J+SYOXZcsqbHUOD58tT2K8aXVNMnJAOhzyRl4IXf/XduTVaqT 6HbGx01ZtJmDWEWEg/Ut5lgmUZIfsx2rNg/xtO2vbc4/4vzo+Ctc0kDf/LSJn6JQvfDt JHwf1gxArp7eABoFsLA1l+02mQsE9Z16nqeJGn7WA05cRTPDEyqRenPiqc6EVDt9pkh5 hraw== X-Gm-Message-State: AOAM532T2eUgtANm1Lv14m0FuQSCnbkbdf078jWJptHK55qzgcmM7t6d D8WiZc8IpIVPqKKhJG9LBP0oAjcQv6Ohi7XT4wPRLA== X-Google-Smtp-Source: ABdhPJwGP1iH54aBaYVC33bjqbgQctUZp4Pi4rXKBOfxyi1+bPS5kw2APZGmPTqMUBDICCtmS9pO8y+RNk0rZrzATh4= X-Received: by 2002:a05:6402:5146:: with SMTP id n6mr24252309edd.126.1636823228182; Sat, 13 Nov 2021 09:07:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Sat, 13 Nov 2021 09:06:57 -0800 Message-ID: Subject: Re: regression with mainline kernel To: Sudip Mukherjee Cc: linux-kernel , Gurchetan Singh , Nicholas Verne , Gerd Hoffmann , dri-devel , "open list:VIRTIO GPU DRIVER" , Daniel Vetter Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Hmm. This email was marked as spam for me. I see no obvious reason for it being marked as spam, but it happens.. ] On Thu, Nov 11, 2021 at 12:52 PM Sudip Mukherjee wrote: > > # first bad commit: [cd7f5ca33585918febe5e2f6dc090a21cfa775b0] > drm/virtio: implement context init: add virtio_gpu_fence_event Hmm. Judging from your automated screenshots, the login never appears. > And, indeed reverting cd7f5ca33585 on top of debe436e77c7 has fixed > the problem I was seeing on my qemu test of x86_64. The qemu image is > based on Ubuntu. Presumably either that commit is somehow buggy in itself - or it does exactly what it means to do, and the new poll() semantics just confuses the heck out of the X server (or wayland or whatever). And honestly, if I read that thing correctly, the patch is entirely broken. The new poll function (virtio_gpu_poll()) will unconditionally remove the first event from the event list, and then report "Yeah, I had events". This is completely bogus for a few reasons: - poll() really should be idempotent, because the poll function gets called multiple times - it doesn't even seem to check that the event that it removes is the new VIRTGPU_EVENT_FENCE_SIGNALED_INTERNAL kind of event, so it will unconditionally just remove random events. - it does seem to check the "vfpriv->ring_idx_mask" and do the old thing if that is zero, but I see absolutely no reason for that (and that check itself has caused problems, see below) Honestly, my reaction to this all is that that commit is fundamentally broken and probably should be reverted regardless as "this commit does bad things". HOWEVER - it has had a fix for a NULL pointer dereference in the meantime - can you check whether the current top of tree happens to work for you? Maybe your problem isn't due to "that commit does unnatural things", but simply due to the bug fixed in d89c0c8322ec ("drm/virtio: Fix NULL dereference error in virtio_gpu_poll"). And if it's still broken with that commit, I'll happily revert it and people need to go back to the drawing board. In fact, I would really suggest that people look at that virtio_gpu_poll() function regardless. That odd "let's unconditionally just drop events in the poll function is really REALLY broken behavior. Linus From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90609C433EF for ; Sat, 13 Nov 2021 17:07:15 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E55F60F6B for ; Sat, 13 Nov 2021 17:07:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2E55F60F6B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id EE83F40282; Sat, 13 Nov 2021 17:07:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LE-hGh3iMQ15; Sat, 13 Nov 2021 17:07:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4E57A40281; Sat, 13 Nov 2021 17:07:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 30C92C002E; Sat, 13 Nov 2021 17:07:13 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2713FC0012 for ; Sat, 13 Nov 2021 17:07:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0218D605AD for ; Sat, 13 Nov 2021 17:07:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=linux-foundation.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id njmSnRuFqZem for ; Sat, 13 Nov 2021 17:07:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by smtp3.osuosl.org (Postfix) with ESMTPS id E3441605AB for ; Sat, 13 Nov 2021 17:07:09 +0000 (UTC) Received: by mail-ed1-x530.google.com with SMTP id e3so14856552edu.4 for ; Sat, 13 Nov 2021 09:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nRHTN+KJ/0jakG/3S1m86FduFSvoZNR/waj5CoABhhY=; b=AI5EgBuhXv3ifPQ/QJGAcgXo9vjiG/by8UhhOa7KCZNrvEzzpepwyfZxQwC1UOwsTg 3NZXmVOf8DUa+Rt2QZOWgxDJuoswYf8qCtbhrV+XAj0eYtpUMzeJaj3aEp1I532no0eE 8qsaWz4Ud04P5QaZPk1SnPlYrcPiAhAz2LsOE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nRHTN+KJ/0jakG/3S1m86FduFSvoZNR/waj5CoABhhY=; b=1piweKvafqaya8388l1i5bvXzNDAvCtn5I8hMiq/SxnhuttHWpDk6mABaX6vX8IKqG CPzUpX+f5Uh0FBM2VrTXXrhpVbzUfFrcRJWg28Oj9twHOQc1E2DCHJddsEbWtLkk3i8m e6bdNgvBb+LH0xKBqR0YyYmh1FowyrAD/9CaPKWCCwtudZHI6wtPCkj+hL4CDa992TrD zMOpJiTFlMdF7Ka/Yt+yxIWqNEEPQXpwuz0L2XBqsXxzfAZgUpBmlU0J/1/JbA0SA7IV JLcatX0YKM68btIcPndWSHhoSBtYpMS0I7whsoO9LjVyAJqrdMrQ5EQJXe3uMwq7lz7C m6wQ== X-Gm-Message-State: AOAM5334b23n6GZgyNguSO5HPwZ7nq/qd0MV5Hze0EFYaV+fVYuPXS3K bIhmU3FJulLwVwUg0Ssnz5knjSw/y6CC5LjdJYBGhkbN X-Google-Smtp-Source: ABdhPJwGP1iH54aBaYVC33bjqbgQctUZp4Pi4rXKBOfxyi1+bPS5kw2APZGmPTqMUBDICCtmS9pO8y+RNk0rZrzATh4= X-Received: by 2002:a05:6402:5146:: with SMTP id n6mr24252309edd.126.1636823228182; Sat, 13 Nov 2021 09:07:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Sat, 13 Nov 2021 09:06:57 -0800 Message-ID: Subject: Re: regression with mainline kernel To: Sudip Mukherjee Cc: linux-kernel , Nicholas Verne , dri-devel , "open list:VIRTIO GPU DRIVER" , Daniel Vetter , Gurchetan Singh X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" [ Hmm. This email was marked as spam for me. I see no obvious reason for it being marked as spam, but it happens.. ] On Thu, Nov 11, 2021 at 12:52 PM Sudip Mukherjee wrote: > > # first bad commit: [cd7f5ca33585918febe5e2f6dc090a21cfa775b0] > drm/virtio: implement context init: add virtio_gpu_fence_event Hmm. Judging from your automated screenshots, the login never appears. > And, indeed reverting cd7f5ca33585 on top of debe436e77c7 has fixed > the problem I was seeing on my qemu test of x86_64. The qemu image is > based on Ubuntu. Presumably either that commit is somehow buggy in itself - or it does exactly what it means to do, and the new poll() semantics just confuses the heck out of the X server (or wayland or whatever). And honestly, if I read that thing correctly, the patch is entirely broken. The new poll function (virtio_gpu_poll()) will unconditionally remove the first event from the event list, and then report "Yeah, I had events". This is completely bogus for a few reasons: - poll() really should be idempotent, because the poll function gets called multiple times - it doesn't even seem to check that the event that it removes is the new VIRTGPU_EVENT_FENCE_SIGNALED_INTERNAL kind of event, so it will unconditionally just remove random events. - it does seem to check the "vfpriv->ring_idx_mask" and do the old thing if that is zero, but I see absolutely no reason for that (and that check itself has caused problems, see below) Honestly, my reaction to this all is that that commit is fundamentally broken and probably should be reverted regardless as "this commit does bad things". HOWEVER - it has had a fix for a NULL pointer dereference in the meantime - can you check whether the current top of tree happens to work for you? Maybe your problem isn't due to "that commit does unnatural things", but simply due to the bug fixed in d89c0c8322ec ("drm/virtio: Fix NULL dereference error in virtio_gpu_poll"). And if it's still broken with that commit, I'll happily revert it and people need to go back to the drawing board. In fact, I would really suggest that people look at that virtio_gpu_poll() function regardless. That odd "let's unconditionally just drop events in the poll function is really REALLY broken behavior. Linus _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3686C433F5 for ; Sat, 13 Nov 2021 17:07:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78AB66054E for ; Sat, 13 Nov 2021 17:07:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 78AB66054E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 643F3730C2; Sat, 13 Nov 2021 17:07:10 +0000 (UTC) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by gabe.freedesktop.org (Postfix) with ESMTPS id AA0A9730C2 for ; Sat, 13 Nov 2021 17:07:09 +0000 (UTC) Received: by mail-ed1-x529.google.com with SMTP id r12so51308008edt.6 for ; Sat, 13 Nov 2021 09:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nRHTN+KJ/0jakG/3S1m86FduFSvoZNR/waj5CoABhhY=; b=AI5EgBuhXv3ifPQ/QJGAcgXo9vjiG/by8UhhOa7KCZNrvEzzpepwyfZxQwC1UOwsTg 3NZXmVOf8DUa+Rt2QZOWgxDJuoswYf8qCtbhrV+XAj0eYtpUMzeJaj3aEp1I532no0eE 8qsaWz4Ud04P5QaZPk1SnPlYrcPiAhAz2LsOE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nRHTN+KJ/0jakG/3S1m86FduFSvoZNR/waj5CoABhhY=; b=24ueAgQtSsFPhwDhsVON+QHxuulK/Hov13Eg2uoQa8LWsRQOaTzSsl/eCQUTP24Nvs U8yVOXvLwarvmwK+Y808zgUUwDiQ2NuD6CEzBG4s1WIV5Z+9bKx4PswXucKxARi5bhgU /0WOiKOgGae8weIee0Bn0B6PsUqhK6uo1LSqqD93swiZ1KF/uP1PGbl0wgiBYmyrraG/ 6+sKFWTHDpWyBeKZ1qgNt6cFGTpOTx52bPEfkDgjyroojiADhYPMuPEtswqQE/7WUU1w raRczsfdirY52bCm0Yz467hchIQtWf/5oj8pmPmw4/FypZyTFKdnAAK9p/3cOXQoeoR+ jhYA== X-Gm-Message-State: AOAM531xNwtvzJfhXBj/6C2SuRZ9b6bwMs2lT5RztIwSWJLMo51WUjrV dAwGxL3k5mdJ+XbmmcDAGu05SR+WbqXiBaPWVRqbUA== X-Google-Smtp-Source: ABdhPJwGP1iH54aBaYVC33bjqbgQctUZp4Pi4rXKBOfxyi1+bPS5kw2APZGmPTqMUBDICCtmS9pO8y+RNk0rZrzATh4= X-Received: by 2002:a05:6402:5146:: with SMTP id n6mr24252309edd.126.1636823228182; Sat, 13 Nov 2021 09:07:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Sat, 13 Nov 2021 09:06:57 -0800 Message-ID: Subject: Re: regression with mainline kernel To: Sudip Mukherjee Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel , Nicholas Verne , dri-devel , "open list:VIRTIO GPU DRIVER" , Gerd Hoffmann , Gurchetan Singh Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" [ Hmm. This email was marked as spam for me. I see no obvious reason for it being marked as spam, but it happens.. ] On Thu, Nov 11, 2021 at 12:52 PM Sudip Mukherjee wrote: > > # first bad commit: [cd7f5ca33585918febe5e2f6dc090a21cfa775b0] > drm/virtio: implement context init: add virtio_gpu_fence_event Hmm. Judging from your automated screenshots, the login never appears. > And, indeed reverting cd7f5ca33585 on top of debe436e77c7 has fixed > the problem I was seeing on my qemu test of x86_64. The qemu image is > based on Ubuntu. Presumably either that commit is somehow buggy in itself - or it does exactly what it means to do, and the new poll() semantics just confuses the heck out of the X server (or wayland or whatever). And honestly, if I read that thing correctly, the patch is entirely broken. The new poll function (virtio_gpu_poll()) will unconditionally remove the first event from the event list, and then report "Yeah, I had events". This is completely bogus for a few reasons: - poll() really should be idempotent, because the poll function gets called multiple times - it doesn't even seem to check that the event that it removes is the new VIRTGPU_EVENT_FENCE_SIGNALED_INTERNAL kind of event, so it will unconditionally just remove random events. - it does seem to check the "vfpriv->ring_idx_mask" and do the old thing if that is zero, but I see absolutely no reason for that (and that check itself has caused problems, see below) Honestly, my reaction to this all is that that commit is fundamentally broken and probably should be reverted regardless as "this commit does bad things". HOWEVER - it has had a fix for a NULL pointer dereference in the meantime - can you check whether the current top of tree happens to work for you? Maybe your problem isn't due to "that commit does unnatural things", but simply due to the bug fixed in d89c0c8322ec ("drm/virtio: Fix NULL dereference error in virtio_gpu_poll"). And if it's still broken with that commit, I'll happily revert it and people need to go back to the drawing board. In fact, I would really suggest that people look at that virtio_gpu_poll() function regardless. That odd "let's unconditionally just drop events in the poll function is really REALLY broken behavior. Linus