From patchwork Wed Nov 9 16:16:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Bragg X-Patchwork-Id: 9419759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA500601C0 for ; Wed, 9 Nov 2016 16:17:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF673289E5 for ; Wed, 9 Nov 2016 16:17:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D462D28AD0; Wed, 9 Nov 2016 16:17:45 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham 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 965ED289E5 for ; Wed, 9 Nov 2016 16:17:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B13B6E6F3; Wed, 9 Nov 2016 16:17:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id ECBF76E6F3 for ; Wed, 9 Nov 2016 16:17:42 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id u144so30217555wmu.0 for ; Wed, 09 Nov 2016 08:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=z2Hn/WV567r7EysMrPt1PARjNjdyCC5gIMkc4yWJfaI=; b=hwT19JKoYHTmMbDY+zOTlXVRczx0vNfLt6u4cUP21N72JBVYXruiwO2LSFYlNDJYNt oXmJmeHCycAvbUsKMifjPC1htCP8oKbKYeaiqCda3RanDhOpsfsjeTiq7zGS+LVMG9ju jbafY9LRSIAf/RwN3cqSL1piDvNbCYFJMHRMLlwBzamGMeZUeodhn541wyvn9HRlYTfs T1oas0rZNLivHVEy8YSiSxEYtgTZc/v8EYSSTBDRmplE3KEs5EE4NAw0+PWH3myEE5jh E9U/63e78N1iG+ql2byTYQo/viqkVBWMaSIa+tNBGPQdhchXqV99iadzbALMESvfeTyb eMUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=z2Hn/WV567r7EysMrPt1PARjNjdyCC5gIMkc4yWJfaI=; b=IVJKEgXp0Kxxk7SLIwf8SrvmoUcZmCQM+UDtxAB0DNVJD7Lby8/f45+srn0+AnLoc5 TzHaSPNpLIIjk9in9UWHo6CtQZaK+gRBchmVQH2rRLGqsLlcYdFkWLFPRuteadTVnbc4 KmFtCKcXPS99BOcpJbUYrWqSu/02veaJ2lTXr5HZQGIPlvi797UVxcCREOubJc82unix sRBYzIz2Vvy+WZODZTomyS7snJ1IB4nPSvg5C8bvi4Z/IGab1BprN2EnxudDm0Gs3IC7 IST63ekX1xcAU16znMu0JmIPh3Cg8fFAkQYTQL3TU/nb7Vonazi3lcuugqv235kXrM3J 5v+g== X-Gm-Message-State: ABUngvedMDS1jafuZBxG6sMMCnTMLGj0VF3RbJ5xXBtUGlnyXhD0UfnRXVVDdK3aXzKKeg== X-Received: by 10.28.54.97 with SMTP id d94mr1079665wma.28.1478708261550; Wed, 09 Nov 2016 08:17:41 -0800 (PST) Received: from sixbynine.org (82-132-216-223.dab.02.net. [82.132.216.223]) by smtp.gmail.com with ESMTPSA id wh3sm267466wjb.49.2016.11.09.08.17.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Nov 2016 08:17:40 -0800 (PST) From: Robert Bragg To: intel-gfx@lists.freedesktop.org Date: Wed, 9 Nov 2016 16:16:02 +0000 Message-Id: <20161109161602.2402-12-robert@sixbynine.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161109161602.2402-1-robert@sixbynine.org> References: <20161109161602.2402-1-robert@sixbynine.org> Subject: [Intel-gfx] [PATCH igt v3 11/11] igt/gem_exec_parse: check oacontrol lri bad for >= v9 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-Virus-Scanned: ClamAV using ClamSMTP OACONTROL is no longer white listed in the command parser so this checks at attempted LRI will be disallowed and (more importantly) checks that userspace doesn't get an EINVAL error for an attempted OACONTROL LRI. This is important becase Mesa application attempt OACONTROL LRIs while initializing and will abort for any execbuf error. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- tests/gem_exec_parse.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index 0fa3af8..702b6f4 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -457,6 +457,22 @@ igt_main /* dummy head pointer */ { OASTATUS2, 0xffffff80, 0xdeadf000, 0xbeeff000 } }; + struct test_lri v9_bad_lris[] = { + /* It's really important for us to check that + * an LRI to OACONTROL doesn't result in an + * EINVAL error because Mesa attempts writing + * to OACONTROL to determine what extensions to + * expose and will abort() for execbuffer() + * errors. + * + * Mesa can gracefully recognise and handle the + * LRI becoming a NOOP. + * + * The test values represent dummy context IDs + * while leaving the OA unit disabled + */ + { OACONTROL, 0xfffff000, 0xfeed0000, 0x31337000 } + }; struct test_lri ok_lris[] = { /* NB: [1:0] MBZ */ { SO_WRITE_OFFSET_0, 0xfffffffc, @@ -475,6 +491,15 @@ igt_main bad_lris + i, bad_lri_errno, bad_lris[i].init_val); } + + if (parser_version >= 9) { + for (int i = 0; i < ARRAY_LEN(v9_bad_lris); i++) { + test_lri(fd, handle, + v9_bad_lris + i, + 0, + v9_bad_lris[i].init_val); + } + } } igt_fixture {