Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp503965imm; Mon, 1 Oct 2018 13:33:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Q2m63F0gjK6m1gye83rUPS8CxqRFdup28SZnnvy3xQBMl2K36KlSm8nhNHDftc5Kt8jRz X-Received: by 2002:a62:5f82:: with SMTP id t124-v6mr12987430pfb.223.1538426035052; Mon, 01 Oct 2018 13:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538426035; cv=none; d=google.com; s=arc-20160816; b=boVMM/JDUA/N2eWJZ9I9iHuddRgyidO0Qd7zX/x0RmC/fs+9dKbWdKzcdblaLenXUs YNQ1x3wBCSEMEhDuTcUHpTaPq4wGw8CgJNCdUBdvl6yFN/6X3Jat4h5LUMg060N1sFqr 72W4nEJFAaCaU+dVKmYVg14QDHF0bin2AOlfItaEJvMB+Tke9snD9H5T5oQuy2/8P6W0 jCCSQTyoTfkPSbyNqF72rm0JtnLka2dcjPOQ9O0Gihk80boeIhKZZ30qGqRQyOnISQlG Gk8hzN8u23RhfguOJD+jqZ0wW8wYTiFCw0o1Y9jcUSDw4PXmE2frjW0Dz53hjRMUMpS8 GuIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Y6YtAD6ADXrdmCPvMzc9LbfDtmn7HgMxAsgO2DjahEs=; b=YjOI+/RqHpmucHd9DILDz+YvTehdgeA7oxARRFqu5XGR6pxQlbSTasguPJxyYsQIao p0xs9R4r8nyq6XqKK1GgKvtqmnFZgsIxLLZGw+Ymovoj9TGsgJXFsmp3QH/AYXGIk3a6 WImz1hfzxzcD1621te1AaPA5P/gSsa/t0IsUhYpqhgPCpkLPY7h8sA1E2y2224ncIrpH v3TJ7ihs3ALxzYEtjGec2+Boh27yf2OvEX+aNLkHhL1UsULahiMggpaANXoJV1zpcFIW l559C8zOvqfUFP/Z4QHS6+1UonGQhVr4HbWFY5xRxfr/JvWbq09sbcwtlMVnpUb+dLEH 0d3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lekensteyn.nl header.s=s2048-2015-q1 header.b=M1Ne70Sf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p17-v6si10932129pgk.58.2018.10.01.13.33.40; Mon, 01 Oct 2018 13:33:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lekensteyn.nl header.s=s2048-2015-q1 header.b=M1Ne70Sf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726304AbeJBDNH (ORCPT + 99 others); Mon, 1 Oct 2018 23:13:07 -0400 Received: from lekensteyn.nl ([178.21.112.251]:40409 "EHLO lekensteyn.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbeJBDNH (ORCPT ); Mon, 1 Oct 2018 23:13:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lekensteyn.nl; s=s2048-2015-q1; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=Y6YtAD6ADXrdmCPvMzc9LbfDtmn7HgMxAsgO2DjahEs=; b=M1Ne70Sf688pUnhNcO5yzE8jpqN+eE7fMAkuELBwkNVgnHNPKpf5J6S0ODrpzFKUae3Ib2pmkAM2dt1o7za1HkD4k9MUVfI9gB0FtCFCebXskeSBJkPWjlzbjyyu5FIUDtVf5IONSn6kCG2o9wNyXDOhBBGM67R/lb3I1IyzHE89Me25ohhWSrjxLSEFNgJ0xnUjhW5KTmUIRbU/O6wYaxS+VO4q+BhAHeVkTS/0hMj1jHCqFhsrRltmti5KfZ+i+o83iXJ3P5g73IQXU2OeElj+sWsZojgEAqbeMYyjLFlI8W6RdLbpT6BoPeU4hoN5x4V+o7rgJyJWeUw6zaJnPA==; Received: by lekensteyn.nl with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1g74sf-0006MY-9R; Mon, 01 Oct 2018 22:33:26 +0200 Date: Mon, 1 Oct 2018 22:33:22 +0200 From: Peter Wu To: Fubo Chen Cc: airlied@redhat.com, kraxel@redhat.com, alan.christopher.jenkins@gmail.com, virtualization@lists.linux-foundation.org, dri-devel@lists.freedesktop.org, Linux Kernel Subject: Re: [PATCH] qxl: fix null-pointer crash during suspend Message-ID: <20181001203322.GA13696@al> References: <20180904202747.14968-1-peter@lekensteyn.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Score: -0.0 (/) X-Spam-Status: No, hits=-0.0 required=5.0 tests=NO_RELAYS=-0.001 autolearn=no autolearn_force=no Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 01, 2018 at 01:13:59PM -0700, Fubo Chen wrote: > On Tue, Sep 4, 2018 at 2:10 PM Peter Wu wrote: > > > > "crtc->helper_private" is not initialized by the QXL driver and thus the > > "crtc_funcs->disable" call would crash (resulting in suspend failure). > > Fix this by converting the suspend/resume functions to use the > > drm_mode_config_helper_* helpers. > > > > Tested system sleep with QEMU 3.0 using "echo mem > /sys/power/state". > > During suspend the following message is visible from QEMU: > > > > spice/server/display-channel.c:2425:display_channel_validate_surface: canvas address is 0x7fd05da68308 for 0 (and is NULL) > > spice/server/display-channel.c:2426:display_channel_validate_surface: failed on 0 > > > > This seems to be triggered by QXL_IO_NOTIFY_CMD after > > QXL_IO_DESTROY_PRIMARY_ASYNC, but aside from the warning things still > > seem to work (tested with both the GTK and -spice options). > > > > Signed-off-by: Peter Wu > > Is this a new issue or something that was introduced a long time ago? > In the latter case, please consider adding a "Cc: > " tag to this patch. I am not sure exactly when the issue was introduced, but the original code was added in v3.10-rc7-800-gd84300bf7934 while the new drm_mode_config_helper_suspend API was added in 4.16. The intended call chain to initialize the private object seems to be: drm_crtc_helper_add <- qdev_crtc_init <- qxl_modeset_init <- qxl_pci_probe If any error occurs along the callchain, then the helper_private pointer will remain NULL. Or if the crtc is obtained in a different way (not sure how). Not sure if it is worth backporting, suspend/resume does not seem an important use case for VMs using QXL and the fix was not validated for older kernels. -- Kind regards, Peter Wu https://lekensteyn.nl