Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5000664ybi; Tue, 11 Jun 2019 17:06:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxG2y/Rj5tpzSrwhPjeqLkawrfwyjadmAFUmogiG/eAzcS2iPd47/mf9EV8cMiOiEJYj0Y/ X-Received: by 2002:a17:90a:6505:: with SMTP id i5mr28516103pjj.13.1560297961654; Tue, 11 Jun 2019 17:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560297961; cv=none; d=google.com; s=arc-20160816; b=XKwEfCsIzVAB4csxICXK5iNQhMe+0RSStOAWBaxyU6SvF9/F+ZF0n2p5ho2YelAmdS EhXzX2gn9T/YLRzmKcdnjPvPOxRbDfyGobDXi3ryHqRoxLYnfvI8gMWqXqgzMranWjQR T0EZtfAFbKV44NakoiMgMRAvRZXo2g276/u5WWddCo5CAEdOQqLR4wndiOO7QvA2VpxN h/l7d9gmfjQnEO3WqH//a4msMxv625zliyrp3GpPEm1mnEB/pNYsiKwDTeWV+ZOD32kI hp04bIAf4NrZdn2i1i1ejBppy0QkFpnhtif09HPMqCy/Yhmbc+hmBLGtGpIF+QffA7wZ 0oTw== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=b0CipaHb6QgdqMnFO5rkJaZeOdwG16158x+y5hKGxe4=; b=jObsf2UwizsSkvs7X8zqp//WESAbO/00Gn2ERA+SJGzkYrbIJ83H6Ya2Tv8tvCOAJF uPvFRDYleTfvsXzFMTBEOvleN4bfWgC8HKGKUZHk+lrJaghli+K25OTRuW/g+WlqYMxT dcBD6Wk/m2R0BtsSLVQl1XbltjXIEjSFl8wE7c3GlNGWtsMGoTf4eLSDlQc4JhvbMQrf a6LB9S265euqbVgxXu+MUzHIRW8dw+78LOJHSC1hXP2jv5Kzv7mNjIohcnEJK6siQ+P6 nief4u99/745ZZ2NL8UvCjM1MLQpCC5NT9QSD3v/r/Cqxi+A3og9PvXdJ2sR9ObscB9x io0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=cpKcN5pb; 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 f17si13416131plr.333.2019.06.11.17.05.46; Tue, 11 Jun 2019 17:06:01 -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=fail header.i=@ffwll.ch header.s=google header.b=cpKcN5pb; 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 S2406228AbfFKTmt (ORCPT + 99 others); Tue, 11 Jun 2019 15:42:49 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:35084 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405764AbfFKTmt (ORCPT ); Tue, 11 Jun 2019 15:42:49 -0400 Received: by mail-ed1-f68.google.com with SMTP id p26so17777366edr.2 for ; Tue, 11 Jun 2019 12:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=b0CipaHb6QgdqMnFO5rkJaZeOdwG16158x+y5hKGxe4=; b=cpKcN5pbblt721RTSYss5mgbiy40j+AaFpeQV1/k0rGoCsdNuzKannb0XMmuiyDKwX +hOXMt2D2wRYv7RqTkZCy8PrEQ7hwh1S15lxDKn3txtW8FS5lrDBQ8mcumiKzkLMIVQo MXWgp+gBFRCAuJee1OfwplnngxQG325Nb/FIo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=b0CipaHb6QgdqMnFO5rkJaZeOdwG16158x+y5hKGxe4=; b=gq8ao12pUk9fNOrQ/3ZDu999MsFt/GZYGNhGdsKrKmUeFm9BA3DO25YCRSs3NH4pCW yaC5EglyFasqIRDv3+vVfQJsaVuaqDijMF6BAGN1CM7Oh6blbZ3Lp3Bqd018lFV1gv9B aQh4w+Qv21UMaKOYB963qgHZ/DaBeOGPBw/bJ8Jf96AODBqk6i7V89tyGSueieqOrmR4 NjMYY8By51ZGuWfp2Ds8VttXqbo/rOcXoJnqQaB5IEhTnZxyhyGEG0S5paqebFgnBvC7 KmfK/ikKzC1jPjdwx4oNoJJ/SxcMIrMOpv91NtpiFJ+EwOkRmtIPAYybXmM5zcCd4me7 5xEw== X-Gm-Message-State: APjAAAWoXPwtwowTelN4AN7cSWe5JAcxDQMkVEaVI0CAIkcof92JvMls KfnoEFHcXJTSTAlIi/EMTd/ldw== X-Received: by 2002:a50:a941:: with SMTP id m1mr84856398edc.157.1560282166973; Tue, 11 Jun 2019 12:42:46 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id l38sm608854eda.1.2019.06.11.12.42.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 11 Jun 2019 12:42:46 -0700 (PDT) Date: Tue, 11 Jun 2019 21:42:43 +0200 From: Daniel Vetter To: Thomas Backlund Cc: Greg Kroah-Hartman , Daniel Vetter , Sven Joachim , stable , Linux Kernel Mailing List , Dave Airlie Subject: Re: Linux 5.1.9 build failure with CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT=n Message-ID: <20190611194243.GM2458@phenom.ffwll.local> Mail-Followup-To: Thomas Backlund , Greg Kroah-Hartman , Sven Joachim , stable , Linux Kernel Mailing List , Dave Airlie References: <87k1dsjkdo.fsf@turtle.gmx.de> <20190611153656.GA5084@kroah.com> <20190611174006.GB31662@kroah.com> <11b2d815-d0c0-1f68-557d-144166c4a1a7@mageia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11b2d815-d0c0-1f68-557d-144166c4a1a7@mageia.org> X-Operating-System: Linux phenom 4.14.0-3-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 11, 2019 at 10:08:10PM +0300, Thomas Backlund wrote: > Den 11-06-2019 kl. 20:40, skrev Greg Kroah-Hartman: > > On Tue, Jun 11, 2019 at 07:33:16PM +0200, Daniel Vetter wrote: > > > On Tue, Jun 11, 2019 at 5:37 PM Greg Kroah-Hartman > > > wrote: > > > > On Tue, Jun 11, 2019 at 03:56:35PM +0200, Sven Joachim wrote: > > > > > Commit 1e07d63749 ("drm/nouveau: add kconfig option to turn off nouveau > > > > > legacy contexts. (v3)") has caused a build failure for me when I > > > > > actually tried that option (CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT=n): > > > > > > > > > > ,---- > > > > > | Kernel: arch/x86/boot/bzImage is ready (#1) > > > > > | Building modules, stage 2. > > > > > | MODPOST 290 modules > > > > > | ERROR: "drm_legacy_mmap" [drivers/gpu/drm/nouveau/nouveau.ko] undefined! > > > > > | scripts/Makefile.modpost:91: recipe for target '__modpost' failed > > > > > `---- > > > > > > Calling drm_legacy_mmap is definitely not a great idea. I think either > > > we need a custom patch to remove that out on older kernels, or maybe > > > even #ifdef if you want to be super paranoid about breaking stuff ... > > > > > > > > Upstream does not have that problem, as commit bed2dd8421 ("drm/ttm: > > > > > Quick-test mmap offset in ttm_bo_mmap()") has removed the use of > > > > > drm_legacy_mmap from nouveau_ttm.c. Unfortunately that commit does not > > > > > apply in 5.1.9. > > > > > > > > > > Most likely 4.19.50 and 4.14.125 are also affected, I haven't tested > > > > > them yet. > > > > > > > > They probably are. > > > > > > > > Should I just revert this patch in the stable tree, or add some other > > > > patch (like the one pointed out here, which seems an odd patch for > > > > stable...) > > > > > > ... or backport the above patch, that should be save to do too. Not > > > sure what stable folks prefer? > > > > The above patch does not apply to all of the stable branches, so how > > about I just revert this? People can live with this option not able to > > turn off for now, and if they really want it, they can use a newer > > kernel, right? > > > > Or add the simple fix suggested by Daniel (if I understand correctly): > > > From: Thomas Backlund > > Setting CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT=n (added by commit: b30a43ac7132) > causes the build to fail with: > > ERROR: "drm_legacy_mmap" [drivers/gpu/drm/nouveau/nouveau.ko] undefined! > > Fix that by adding check for CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT around > the code using drm_legacy_mmap() > > Fixes: b30a43ac7132 drm/nouveau: add kconfig option to turn off nouveau > legacy contexts. (v3) > Signed-off-by: Thomas Backlund Reviewed-by: Daniel Vetter Not-entirely-upstream-sha1-but-equivalent: bed2dd8421 ("drm/ttm: Quick-test mmap offset in ttm_bo_mmap()") Cheers, Daniel > > --- > drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 ++ > 1 file changed, 2 insertions(+) > > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c > @@ -168,8 +168,10 @@ nouveau_ttm_mmap(struct file *filp, stru > struct drm_file *file_priv = filp->private_data; > struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev); > > +#if defined(CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT) > if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) > return drm_legacy_mmap(filp, vma); > +#endif > > return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); > } > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch