Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3004673ybi; Mon, 17 Jun 2019 14:29:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfz8gkQvc/VgoolbboN89tlJ/PeoHW08vUm5gAkcuTFWYp3MjXiGfIYXdczjLCHD7QcaiD X-Received: by 2002:a17:902:be10:: with SMTP id r16mr47682233pls.294.1560806992788; Mon, 17 Jun 2019 14:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560806992; cv=none; d=google.com; s=arc-20160816; b=UitSLFyYAF5TUAIkA+kWV1Wf3NCYbXvngZO2Y8QjBidSVsqfEz3qC9GOd3y55v25vw BugeZ3LfO7xK7BevD8hUgA5sbVe9z5oA23iVRFjaQsAoy2pA5QxlrZgSjl64y7ZVEkn4 W1IVXQX6XNJcJXzMF2+kNvb9lxzlcARbLYCqX2i2VOHBlBVHlaJ0g2xts7fC5BHwNIi5 q1zmua7YGchszipt/7sgY9g0nvd8g2+klnFyFTHkfqfTmvx4t/oBZU13P4bsPLltIz7h SlxxxGf/JDAcd8/sKII0JKLKLQ7hMQmFUCzvSuy/zcEzbTHNTFK5FTq50Jq1gNBx7YYX 9Yug== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OsXsg1YTLnypRbIqoaAjRS9qWLU83JvCMqWJJLBygMU=; b=n5IvjATmuvhjKD7VsptFY58OuW7//oJ+NfOXHqee6+ndvHFjzmOEoABWLGUiqPpstQ BLQGzhrGAV5q9GSFu4q36SD2+nr3rhLVT2mfXF9yFhlsLx7fY7C2ROVsSYFEDPCY6ryw /J2Ue1dJeDPBMJdrj37S2qAqIzlPOIPv1rhz7VqO8666ZQUG4OT61RgnHb/Myl31eCU8 SFm6BQQ/tu0b+1oiUEab+euRSLf3VClA8nvjmTtkiAJXM8O0lDPxZgne60cVXXEPGNE7 qzT0LHGa+l444q9943fDfSfKH/BBsopc3sHJpA+CylY7wHEBu0T4xmwm/1c1NH4U2OAR 12pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0BQdI0mQ; 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 k71si389562pje.29.2019.06.17.14.29.37; Mon, 17 Jun 2019 14:29:52 -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=@kernel.org header.s=default header.b=0BQdI0mQ; 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 S1730445AbfFQV1s (ORCPT + 99 others); Mon, 17 Jun 2019 17:27:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:54812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730107AbfFQV1q (ORCPT ); Mon, 17 Jun 2019 17:27:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C99002070B; Mon, 17 Jun 2019 21:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560806865; bh=x/C2d2mxfXgIw/4tYqINkyi/w6w4KJi8gRh9kImqzYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0BQdI0mQRIc6bzc/xkFXgJAU7Hr4Xksx/yTyBj0+iUMjtJxyTYOiL/1k9MaP0eOnR 9doL1KTwBYXak0a3rlfjM3qCPhx9BfYKrdkTUX63Fqdb31MbdyRrWvazXJIhfb/AiA bIzRRD7tEfhP5vmqHM+1o0fYbsatbn1VW4P5twNQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vetter , Dave Airlie Subject: [PATCH 4.14 01/53] drm/nouveau: add kconfig option to turn off nouveau legacy contexts. (v3) Date: Mon, 17 Jun 2019 23:09:44 +0200 Message-Id: <20190617210745.290194666@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210745.104187490@linuxfoundation.org> References: <20190617210745.104187490@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 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 From: Dave Airlie commit b30a43ac7132cdda833ac4b13dd1ebd35ace14b7 upstream. There was a nouveau DDX that relied on legacy context ioctls to work, but we fixed it years ago, give distros that have a modern DDX the option to break the uAPI and close the mess of holes that legacy context support is. Full context of the story: commit 0e975980d435d58df2d430d688b8c18778b42218 Author: Peter Antoine Date: Tue Jun 23 08:18:49 2015 +0100 drm: Turn off Legacy Context Functions The context functions are not used by the i915 driver and should not be used by modeset drivers. These driver functions contain several bugs and security holes. This change makes these functions optional can be turned on by a setting, they are turned off by default for modeset driver with the exception of the nouvea driver that may require them with an old version of libdrm. The previous attempt was commit 7c510133d93dd6f15ca040733ba7b2891ed61fd1 Author: Daniel Vetter Date: Thu Aug 8 15:41:21 2013 +0200 drm: mark context support as a legacy subsystem but this had to be reverted commit c21eb21cb50d58e7cbdcb8b9e7ff68b85cfa5095 Author: Dave Airlie Date: Fri Sep 20 08:32:59 2013 +1000 Revert "drm: mark context support as a legacy subsystem" v2: remove returns from void function, and formatting (Daniel Vetter) v3: - s/Nova/nouveau/ in the commit message, and add references to the previous attempts - drop the part touching the drm hw lock, that should be a separate patch. Signed-off-by: Peter Antoine (v2) Cc: Peter Antoine (v2) Reviewed-by: Peter Antoine Signed-off-by: Daniel Vetter v2: move DRM_VM dependency into legacy config. v3: fix missing dep (kbuild robot) Cc: stable@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/Kconfig | 13 ++++++++++++- drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +++++-- 2 files changed, 17 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/nouveau/Kconfig +++ b/drivers/gpu/drm/nouveau/Kconfig @@ -16,10 +16,21 @@ config DRM_NOUVEAU select INPUT if ACPI && X86 select THERMAL if ACPI && X86 select ACPI_VIDEO if ACPI && X86 - select DRM_VM help Choose this option for open-source NVIDIA support. +config NOUVEAU_LEGACY_CTX_SUPPORT + bool "Nouveau legacy context support" + depends on DRM_NOUVEAU + select DRM_VM + default y + help + There was a version of the nouveau DDX that relied on legacy + ctx ioctls not erroring out. But that was back in time a long + ways, so offer a way to disable it now. For uapi compat with + old nouveau ddx this should be on by default, but modern distros + should consider turning it off. + config NOUVEAU_PLATFORM_DRIVER bool "Nouveau (NVIDIA) SoC GPUs" depends on DRM_NOUVEAU && ARCH_TEGRA --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -967,8 +967,11 @@ nouveau_driver_fops = { static struct drm_driver driver_stub = { .driver_features = - DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER | - DRIVER_KMS_LEGACY_CONTEXT, + DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER +#if defined(CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT) + | DRIVER_KMS_LEGACY_CONTEXT +#endif + , .load = nouveau_drm_load, .unload = nouveau_drm_unload,