From patchwork Fri Aug 2 12:39:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 11073309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A73814DB for ; Fri, 2 Aug 2019 12:40:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88A7228826 for ; Fri, 2 Aug 2019 12:40:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CAFF2882C; Fri, 2 Aug 2019 12:40:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4073928826 for ; Fri, 2 Aug 2019 12:40:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 95B496E02C; Fri, 2 Aug 2019 12:40:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A9B96E029; Fri, 2 Aug 2019 12:40:15 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id w24so33610203plp.2; Fri, 02 Aug 2019 05:40:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UNi/nnM9HHWKbRYhA5SJtV0WOL7aCQ6fgci+sI44rYk=; b=NbM7UofzAJf8g+Gv5VweX9bJR+gZW86V20vWH5LS7Gwxtyh3io9udj39lgXt1ZZKI8 HI6124j1QE37bnRDWbdYlI9OQ/pcPHrvliWdEATcqZA+YVFp1etX5QBUWtOiJX4rY4mg 0F6y7YVrSolWYe/NCQij6FE4Z6MOuv1OSWmqoM09oJ3OwL7IgOpzgCe1uPlX8gbzjjoA FTK9YcFwq8YNciIOq60TayRXyYZ+l4sBT45DxFUb0SXt0P35mEfAs1DRcARIQCPaR9ue +hrATZ/op/th/G6nSYHUTAUVAH8AtknU3eUAO5C2eDuk8SIK8vEhD9qoO0kwQ6Ii12l3 6VLg== X-Gm-Message-State: APjAAAUeYPZEirvkGwhhPTTwrNVIIw6jbyARhDMtOhiJkZbgk+4vdYP9 Rrhb3Gns9DRfyzZ7aQbIrcoyCzhI X-Google-Smtp-Source: APXvYqwLpuv8Zki5rxd/68GLoAJDtswRFf3FJLONOZgTh1nMnm+lQT6IbCFFFW/QgYstRBcGrM/HVg== X-Received: by 2002:a17:902:2ac7:: with SMTP id j65mr132309416plb.242.1564749614370; Fri, 02 Aug 2019 05:40:14 -0700 (PDT) Received: from localhost.localdomain ([121.137.63.184]) by smtp.gmail.com with ESMTPSA id o3sm3978851pje.1.2019.08.02.05.40.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 05:40:12 -0700 (PDT) From: Sergey Senozhatsky To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Chris Wilson Date: Fri, 2 Aug 2019 21:39:55 +0900 Message-Id: <20190802123956.2450-1-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UNi/nnM9HHWKbRYhA5SJtV0WOL7aCQ6fgci+sI44rYk=; b=VuFcTKxPiFikoaOaeaN3wnXTgdC/BrSU7WHN/INuG6RZYN5YDsvvKzcXg8IiYRKKyA F2+x1riP9LCT2SOrRYETDLkypkQAa2yYEMMTRRvBgJtpRf3L9YiLnwJpuzGXvgJOl4t/ 3ln3++H3r9Q6kn25Eju2mIvCELCFHrk2Ix6IfZzeDm7oe7YWiAcc+l5ZpHeUTVBtcXUh Q/V2DKB7GUmAzrleqpuvFnFik1pBAemExEdZwx3V7nD/9jS6Ah0t0CCA3gAjItR+IqXq yUia08u4zRiHbUCqBqxY79YKl4bl/Yzs0febAaa3LmTHBfROyJz9SqxmQsR8hSDn5iNQ ULOg== Subject: [Intel-gfx] [PATCH 1/2] i915: convert to new mount API X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sergey Senozhatsky Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP tmpfs does not set ->remount_fs() anymore and its users need to be converted to new mount API. BUG: kernel NULL pointer dereference, address: 0000000000000000 PF: supervisor instruction fetch in kernel mode PF: error_code(0x0010) - not-present page RIP: 0010:0x0 Code: Bad RIP value. Call Trace: i915_gemfs_init+0x6e/0xa0 [i915] i915_gem_init_early+0x76/0x90 [i915] i915_driver_probe+0x30a/0x1640 [i915] ? kernfs_activate+0x5a/0x80 ? kernfs_add_one+0xdd/0x130 pci_device_probe+0x9e/0x110 really_probe+0xce/0x230 driver_probe_device+0x4b/0xc0 device_driver_attach+0x4e/0x60 __driver_attach+0x47/0xb0 ? device_driver_attach+0x60/0x60 bus_for_each_dev+0x61/0x90 bus_add_driver+0x167/0x1b0 driver_register+0x67/0xaa Signed-off-by: Sergey Senozhatsky Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/gem/i915_gemfs.c | 28 ++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gemfs.c b/drivers/gpu/drm/i915/gem/i915_gemfs.c index 099f3397aada..cf05ba72df9d 100644 --- a/drivers/gpu/drm/i915/gem/i915_gemfs.c +++ b/drivers/gpu/drm/i915/gem/i915_gemfs.c @@ -7,14 +7,17 @@ #include #include #include +#include #include "i915_drv.h" #include "i915_gemfs.h" int i915_gemfs_init(struct drm_i915_private *i915) { + struct fs_context *fc = NULL; struct file_system_type *type; struct vfsmount *gemfs; + bool ok = true; type = get_fs_type("tmpfs"); if (!type) @@ -36,18 +39,29 @@ int i915_gemfs_init(struct drm_i915_private *i915) struct super_block *sb = gemfs->mnt_sb; /* FIXME: Disabled until we get W/A for read BW issue. */ char options[] = "huge=never"; - int flags = 0; - int err; - err = sb->s_op->remount_fs(sb, &flags, options); - if (err) { - kern_unmount(gemfs); - return err; + fc = fs_context_for_reconfigure(sb->s_root, 0, 0); + if (IS_ERR(fc)) { + ok = false; + goto out; } + + if (!fc->ops->parse_monolithic || + fc->ops->parse_monolithic(fc, options)) { + ok = false; + goto out; + } + + if (!fc->ops->reconfigure || fc->ops->reconfigure(fc)) + ok = false; } +out: + if (!ok) + pr_err("i915 gemfs reconfiguration failed\n"); + if (!IS_ERR_OR_NULL(fc)) + put_fs_context(fc); i915->mm.gemfs = gemfs; - return 0; } From patchwork Fri Aug 2 12:39:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 11073313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 36B051398 for ; Fri, 2 Aug 2019 12:40:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 246AB28826 for ; Fri, 2 Aug 2019 12:40:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1857B2882C; Fri, 2 Aug 2019 12:40:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D1A5D28826 for ; Fri, 2 Aug 2019 12:40:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05EB56E02E; Fri, 2 Aug 2019 12:40:21 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id ADBA96E02D; Fri, 2 Aug 2019 12:40:19 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id i2so33635046plt.1; Fri, 02 Aug 2019 05:40:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QLZJUYtz9c/vneBc7snc3K+WGGpV37J3xyW0EJcXsTs=; b=I+KGn593iVMGrcG331+c2mMyraBbJPoANnF262/K30KqEVuwK3M9z0qyhdnmqgGddA YTwivirRAPuAB7aFtAJLE1mHHBEwoixwxwHF+Vu2O/Q2aIUmBJek4j9L6on7OtuWBUlY dzJoLMXRWq5oq1xKLuI8kjgQEwNM86J4j9IWfXBe4ElLB+ht7OaxWZ2V/XBb4B5Liym1 6AJn4Lg8t8SQb7UIC52pIto6NNXip6z5RYWrRfV7Oae9q1vu8HgTbvLfasvxXG9AnvPV e00H9As1NIDG3vkVmFc9HvowCN9pl2xdG+0POYYmF7Jg44jUi9Oc9s8Q4BRI6hupaR9H cq9w== X-Gm-Message-State: APjAAAXQ6v9hDxPOH1UN3Vuyava4CW5zglwB2AbFP8BvTlN/Ofc8fHc/ ReysVFYUrayJnFs1MKb17ug= X-Google-Smtp-Source: APXvYqxrnjH7ex/6pEQR0PP0CJ0wiDiHlzBBFCGaYn7H9aYWDBJ6+jUqjBc53T0gjKH8X9W0YZFvqA== X-Received: by 2002:a17:902:110b:: with SMTP id d11mr136803582pla.213.1564749619024; Fri, 02 Aug 2019 05:40:19 -0700 (PDT) Received: from localhost.localdomain ([121.137.63.184]) by smtp.gmail.com with ESMTPSA id o3sm3978851pje.1.2019.08.02.05.40.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 05:40:18 -0700 (PDT) From: Sergey Senozhatsky To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Chris Wilson Date: Fri, 2 Aug 2019 21:39:56 +0900 Message-Id: <20190802123956.2450-2-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802123956.2450-1-sergey.senozhatsky@gmail.com> References: <20190802123956.2450-1-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QLZJUYtz9c/vneBc7snc3K+WGGpV37J3xyW0EJcXsTs=; b=RYCawBcHwmBhNKJ7E51R+JhmS7cqBiAMsH+ORnvToU1cvZinsI1MQ5+jXqzzbnRB8M nPDfFLI4awk40v+XJ/+nPo1Ut8Jf/rR6OWWq4XETJLbS9D8hz6NlE3ZptyYko33HjzJB aqocmNA+PWtlfhC1OGBOX2lcE+HxTPdI2UCtGjTiH/J5ozrr0E3rUMdFtgvJ1VmLlrUl SrHGJ9M6nDRjSb0EdBc6ZSYM7+dcYi8NHw88D3bmcqOq9gAoLqyEzgJP969+NFuaoTsK JqfaF//eB/BtHClNldO9worDkC15RpdVqNXD+QNFWpBTZty6PzqVXXVfyrPLUhIiA14W XGFg== Subject: [Intel-gfx] [PATCH 2/2] i915: do not leak module ref counter X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sergey Senozhatsky Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP put_filesystem() before i915_gemfs_init() deals with kern_mount() error. Signed-off-by: Sergey Senozhatsky --- drivers/gpu/drm/i915/gem/i915_gemfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gemfs.c b/drivers/gpu/drm/i915/gem/i915_gemfs.c index cf05ba72df9d..d437188d1736 100644 --- a/drivers/gpu/drm/i915/gem/i915_gemfs.c +++ b/drivers/gpu/drm/i915/gem/i915_gemfs.c @@ -24,8 +24,10 @@ int i915_gemfs_init(struct drm_i915_private *i915) return -ENODEV; gemfs = kern_mount(type); - if (IS_ERR(gemfs)) + if (IS_ERR(gemfs)) { + put_filesystem(type); return PTR_ERR(gemfs); + } /* * Enable huge-pages for objects that are at least HPAGE_PMD_SIZE, most