From patchwork Mon Jun 29 10:59:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 6688381 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 BCCAD9F3D1 for ; Mon, 29 Jun 2015 11:00:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D33942045E for ; Mon, 29 Jun 2015 11:00:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C09D120328 for ; Mon, 29 Jun 2015 11:00:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C8B86E7EF; Mon, 29 Jun 2015 04:00:13 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 242816E7EF for ; Mon, 29 Jun 2015 04:00:12 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 29 Jun 2015 04:00:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,698,1427785200"; d="scan'208";a="752405341" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 29 Jun 2015 04:00:10 -0700 Received: from mwiniars-desk1.igk.intel.com (172.28.173.140) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server id 14.3.224.2; Mon, 29 Jun 2015 12:00:09 +0100 From: =?UTF-8?q?Micha=C5=82=20Winiarski?= To: Date: Mon, 29 Jun 2015 12:59:51 +0200 Message-ID: <1435575591-3510-1-git-send-email-michal.winiarski@intel.com> X-Mailer: git-send-email 2.4.3 MIME-Version: 1.0 X-Originating-IP: [172.28.173.140] Subject: [Intel-gfx] [PATCH] tests/gem_userptr_blits: subtests for MAP_FIXED mappings of regular bo 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 When the the memory backing the userptr object is freed by the user, it's possible to trigger recursive deadlock caused by operations done on different BO mapped in that region, triggering invalidate. Signed-off-by: Micha? Winiarski --- tests/gem_userptr_blits.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c index 1f2cc96..3fe8f90 100644 --- a/tests/gem_userptr_blits.c +++ b/tests/gem_userptr_blits.c @@ -640,6 +640,80 @@ static void test_forked_access(int fd) free(ptr2); } +static int test_map_fixed_invalidate(int fd, bool overlap) +{ + void *ptr; + void *map; + int i; + int num_handles = overlap ? 2 : 1; + uint32_t handle[num_handles]; + uint32_t mmap_handle; + struct drm_i915_gem_mmap_gtt mmap_arg; + + igt_assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE) == 0); + for (i=0; i