Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp919231ybv; Thu, 20 Feb 2020 09:34:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyh8wt2K8heHsle3GnnzPSD1mrv+ctubYtpGGbsdrYSph8eg04iBFZQKhKFSU+XIw9J9Dtc X-Received: by 2002:a9d:7c99:: with SMTP id q25mr24947363otn.105.1582220078859; Thu, 20 Feb 2020 09:34:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582220078; cv=none; d=google.com; s=arc-20160816; b=orOF7xh1nkQ2Sh4WTuaWKgqAgum+DaQARWSssXxYxquuWCMBDW8MQhLNxJsTiqQMzG fKLERV8hLE+aG31HyVZRQ7CSCcGs9mf5X+r+ihL7hIfLdRKgkQxIx4nkz/7XGC3vWtg7 b8HjCsf68n9Y6wkDAOoz3WJjtX85ebcMM3uKGgzTQWgqpgwmBVOM//dTTJmTz3uTKlxh N4+i9pUdo7DzeyMAvDOHpEkquQgyLfGkPjgYKX4T1FUAnvrpPhZCZ+tZ0+QjL0439to1 1bEfZFIgjjZsdT8UHiuyG4mSo+/fmHClhplxHIN86e69UjtKtdja+/vr0Q/BM8F9uZK7 iHdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=GxQMjbknXnAw5+IPk8H5Itv6R3pAFIg3gxY5ie0b0po=; b=YMpi35DqK/t5cZi2b4V1N/eo0wY/9JdcFPe0Lu/ADi+gQ0wJiW/+8rqNmgt9oN8OMp g///u2qGRBbdCsDaIXy3MP5hvStFU8SGBIygvE6kHjixyl42VmTeIJl6uFjDn2NTwCId ofUDLOXdXAEsjV3KsRXau5sdgAveWgvAFHPzYxLNgJh69ggxGAmCD3837NE6BBzRk1FS m+ei9lEa4M2AWzVk+FKrwboMriWs6t6wmR11xBeKkkYz3uuPPKChmf7Wb5NVgpsvhdgt O3aQ6VzBCjp27i5rBaN+/kfc8enSEO/O+WyjsRyQFWSs7TjbUADr/3TnkfxdzlTuNyLx siOw== ARC-Authentication-Results: i=1; mx.google.com; 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 h14si3494779oie.130.2020.02.20.09.34.26; Thu, 20 Feb 2020 09:34:38 -0800 (PST) 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; 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 S1728823AbgBTRc6 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 20 Feb 2020 12:32:58 -0500 Received: from mail-vs1-f68.google.com ([209.85.217.68]:32850 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726959AbgBTRc5 (ORCPT ); Thu, 20 Feb 2020 12:32:57 -0500 Received: by mail-vs1-f68.google.com with SMTP id n27so3229077vsa.0 for ; Thu, 20 Feb 2020 09:32:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FQc9DcjywetNpCF4Lbw4T0x+cYC+tfLtotoC3/DL5NA=; b=t1SVsJ6ptsGzlQQe8yAvc5y7R4/NMISZ1HD4UF8nZgaWq2bLbf+l1QKOfkKIzaxxK7 0qk4vWX0RG1EylGWqR38mCXxs/0YkXsfMzQdcg7pMrCGU2V6KHdGDFTxi6ywwFjGuYS7 wbIItvVnDpsnjKw/Hp+wYgnWTks2i1cdoEspclp2vs5zZ4xwleolPY2d//ziTnU8nDmy zENWK7Kjsfm6gRPoHR+D7CdZFQZ15d1dAVSE8MZZw6pjmUYZVzPAUSJ/MGMiJUzenpt3 hrQVTjNYYcQ98K/f9FQYH7NU7s6sodRDuoj26+SGCDs9qUQMspb9F52S+8pKgEF/lc+S zRjg== X-Gm-Message-State: APjAAAUMNV7S0CM8bRwmdUYbAEkjglqZkM2bpF3fjxCYnHwOnr/SJ10d 7xeJY2Cs7Yz45QZ6z71FJJPIBNhdy43wf3XVSKyokdkz X-Received: by 2002:a67:f412:: with SMTP id p18mr18444585vsn.207.1582219976717; Thu, 20 Feb 2020 09:32:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ilia Mirkin Date: Thu, 20 Feb 2020 12:32:45 -0500 Message-ID: Subject: Re: [Nouveau] [PATCH] nv50_disp_chan_mthd: ensure mthd is not NULL To: =?UTF-8?B?RnLDqWTDqXJpYyBQaWVycmV0?= Cc: Ben Skeggs , David Airlie , Daniel Vetter , dri-devel , nouveau , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Frédéric, It appears Ben made his own version of this patch (probably based on the one you added to the kernel bz), and it's already upstream: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.6-rc2&id=0e6176c6d286316e9431b4f695940cfac4ffe6c2 Cheers, -ilia On Thu, Feb 20, 2020 at 12:19 PM Frédéric Pierret wrote: > > Hi, > Is anything missing here? How can I get this merged? > > Best regards, > Frédéric Pierret > > On 2020-02-08 20:43, Frédéric Pierret wrote: > > Pointer to structure array is assumed not NULL by default. It has > > the consequence to raise a kernel panic when it's not the case. > > > > Basically, running at least a RTX2080TI on Xen makes a bad mmio error > > which causes having 'mthd' pointer to be NULL in 'channv50.c'. From the > > code, it's assumed to be not NULL by accessing directly 'mthd->data[0]' > > which is the reason of the kernel panic. Simply check if the pointer > > is not NULL before continuing. > > > > BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206299 > > Cc: stable@vger.kernel.org > > Signed-off-by: Frédéric Pierret (fepitre) > > --- > > drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c > > index bcf32d92ee5a..50e3539f33d2 100644 > > --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c > > +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c > > @@ -74,6 +74,8 @@ nv50_disp_chan_mthd(struct nv50_disp_chan *chan, int debug) > > > > if (debug > subdev->debug) > > return; > > + if (!mthd) > > + return; > > > > for (i = 0; (list = mthd->data[i].mthd) != NULL; i++) { > > u32 base = chan->head * mthd->addr; > > > > _______________________________________________ > Nouveau mailing list > Nouveau@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau