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 3C732C433FE for ; Mon, 15 Nov 2021 14:25:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27BCB61882 for ; Mon, 15 Nov 2021 14:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231634AbhKOO2b (ORCPT ); Mon, 15 Nov 2021 09:28:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236353AbhKOO1t (ORCPT ); Mon, 15 Nov 2021 09:27:49 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 645B7C0613B9 for ; Mon, 15 Nov 2021 06:24:53 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id g14so72742236edz.2 for ; Mon, 15 Nov 2021 06:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=XzW2ROAlPRz9ydv9L/AshSNhxbtWQbbcjLTS7Atescc=; b=jqY7XD2SmwV3T9FBCXsO0foOKIJt8O1+RCuaDdyjfa0As1sIs2dZbe7iyhw2GZXnNX eTdf11/29Tly1vIeVz9wOAo82uVZaUcTq59iK9BDv9EaQSfmSPqd2D2sW9xIJatoMnkf 5eZqw7jyTM8ju/xQp+bpGviSfGYQzviLspbrs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=XzW2ROAlPRz9ydv9L/AshSNhxbtWQbbcjLTS7Atescc=; b=6CHHJ2z408Wb3IAyak0gxWE2UG/1FCWmhf8t8g0VdvWxWDHfwLgzHma29w7IgomhgX 2kS8q7Rs+5DMRUhy2beTyi3YPXcb0qTnJpqpdm4EQA+WTgVDYVA7rgy5D3RUsZSfOqhM 6e7r0kjp4TgbY5oLIHDbYM5dbpNKBR+lotkDaEt9ZZn3rsbpEGyb98J+w0AF0cNz6Ghe xxzoqSvtx/ytBc75M3Wc+fmfM52gGYXk2w8HistxSZqGqG9BUz/FolnGHfF0d8p8WcKO WOipUrnNcOrCzDy6qVPCRR5uxKVd9EucAKr8F74LGKvs9UB1vY5XJiIAHYxGy+vbNKIC TuPw== X-Gm-Message-State: AOAM531CPJSAhK+q8Bk8CaMUgzwFFDRAGpJK8YtLEN92CS3pPYkS0uww fdc+UzajJ1n4u5tBJcq3S/dltjLChRv2cA== X-Google-Smtp-Source: ABdhPJw5ZxU4iCIzOsNPKcXBw6KrI77E95CzPk/ozBQVETPduv7gf3e6d9dDX1FVXIzpayyJ7jBTzg== X-Received: by 2002:a05:6402:5158:: with SMTP id n24mr19430190edd.230.1636986292018; Mon, 15 Nov 2021 06:24:52 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l11sm7651319edb.28.2021.11.15.06.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 06:24:51 -0800 (PST) Date: Mon, 15 Nov 2021 15:24:49 +0100 From: Daniel Vetter To: Linus Torvalds Cc: Sudip Mukherjee , linux-kernel , Gurchetan Singh , Nicholas Verne , Gerd Hoffmann , dri-devel , "open list:VIRTIO GPU DRIVER" , Daniel Vetter Subject: Re: regression with mainline kernel Message-ID: Mail-Followup-To: Linus Torvalds , Sudip Mukherjee , linux-kernel , Gurchetan Singh , Nicholas Verne , Gerd Hoffmann , dri-devel , "open list:VIRTIO GPU DRIVER" References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.10.0-8-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 13, 2021 at 09:06:57AM -0800, Linus Torvalds wrote: > [ 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. Greg also reported a regression, plus I looked at the commit and had questions too. > > 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. Tbh I haven't looked at the poll implementation, but it's fishy on principles as in drm drivers shouldn't reinvent them. The commit message cites vmwgfx as example for a private driver drm_event, but that works perfectly fine with standard drm_poll (and is meant to work perfectly fine with standard drm_poll). So if it's buggy on top of questionable I think revert might be the right choice irrespective of whether there's some fixes in-flight. So if you end up pushing that revert: References: https://lore.kernel.org/dri-devel/YZJrutLaiwozLfSw@phenom.ffwll.local/ Acked-by: Daniel Vetter Plus credit Greg too and all that ofc. But lets wait a bit for virtio folks to chime in, it's only Monday :-) Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch