From patchwork Wed Sep 9 10:29:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Thierry X-Patchwork-Id: 7145661 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 52AE49F326 for ; Wed, 9 Sep 2015 10:30:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DDE32087F for ; Wed, 9 Sep 2015 10:29:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5738F20873 for ; Wed, 9 Sep 2015 10:29:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3FC326E085; Wed, 9 Sep 2015 03:29:56 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id E06AC6E085 for ; Wed, 9 Sep 2015 03:29:54 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 09 Sep 2015 03:29:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,496,1437462000"; d="scan'208";a="765370814" Received: from michelth-linux2.isw.intel.com ([10.102.226.189]) by orsmga001.jf.intel.com with ESMTP; 09 Sep 2015 03:29:53 -0700 From: Michel Thierry To: intel-gfx@lists.freedesktop.org Date: Wed, 9 Sep 2015 11:29:52 +0100 Message-Id: <1441794592-2775-1-git-send-email-michel.thierry@intel.com> X-Mailer: git-send-email 2.5.1 Subject: [Intel-gfx] [RFC] drm/i915: Handle E2BIG error in i915_gem_fault X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP i915_gem_object_bind_to_vm returns -E2BIG when the user tries to bind an object larger than the aperture, but i915_gem_fault does not handle this return code: [501906.530985] gem_mmap_gtt: starting subtest big-bo-tiledX [501906.541992] gem_mmap_gtt (22362): drop_caches: 3 [501906.610774] WARNING: CPU: 2 PID: 22362 at drivers/gpu/drm/i915/i915_gem.c:1880 i915_gem_fault+0x24f/0x470 [i915]() [501906.623568] unhandled error in i915_gem_fault: -7 [501906.825115] Call Trace: [501906.830322] [] dump_stack+0x45/0x57 [501906.838589] [] warn_slowpath_common+0x8a/0xc0 [501906.847846] [] warn_slowpath_fmt+0x46/0x50 [501906.856776] [] i915_gem_fault+0x24f/0x470 [i915] [501906.866276] [] __do_fault+0x3d/0xa0 [501906.874464] [] ? pte_alloc_one+0x30/0x50 [501906.883169] [] handle_mm_fault+0xe27/0x1810 [501906.892202] [] ? security_mmap_file+0xca/0xe0 [501906.900389] [] ? do_vfs_ioctl+0x2cd/0x4b0 [501906.908143] [] __do_page_fault+0x19a/0x430 [501906.916024] [] do_page_fault+0x22/0x30 [501906.923532] [] page_fault+0x28/0x30 RFC about the error code that should be returned by i915_gem_fault. Testcase: igt/gem_mmap_gtt/big-bo-tiledXY Reported-by: Daniele Ceraolo Spurio Signed-off-by: Michel Thierry --- drivers/gpu/drm/i915/i915_gem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 352ccd5..3e00f72 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1869,6 +1869,7 @@ out: */ ret = VM_FAULT_NOPAGE; break; + case -E2BIG: case -ENOMEM: ret = VM_FAULT_OOM; break;