From patchwork Mon Nov 14 20:51:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Bragg X-Patchwork-Id: 9428371 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 3C61F6047D for ; Mon, 14 Nov 2016 20:52:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 396EE28ADC for ; Mon, 14 Nov 2016 20:52:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E62428AE3; Mon, 14 Nov 2016 20:52:20 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 BE17A28ADC for ; Mon, 14 Nov 2016 20:52:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61E4E6E50A; Mon, 14 Nov 2016 20:52:19 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id DFCB36E50A for ; Mon, 14 Nov 2016 20:52:17 +0000 (UTC) Received: by mail-pg0-x243.google.com with SMTP id e9so9458476pgc.1 for ; Mon, 14 Nov 2016 12:52:17 -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=aJeqhSfPf1dcUs+r0c01dMaDEKKi7iJiGmsCFR9fzK4=; b=XNqgeVjZZsV+4bnBaYIOjChgAG7AhgIiRm/4U2b3mJHpk299Ri2nhs6Z9y4FgkJ8pG eW9s2QokfiLN5FJU6GEZ2HYDZwPd4bHDuu7lLpb7lN9EtGMMMt/ZPTbQDm0aM0TTNQ1W uoAgQwPeEJhzikYJrpHXSs+R4MipZN2Cds0dx9fwu5ynjjpILdXsxN3D8WwA+9D40U+O nUqOEs+vO5PG628txEoanSCP3S5mZpgFR0NDHlFZv4nA9x9Dhq2BElCgCzFx/r6ZnWfk rrBozdx/54fPdZ9bO+JrzwmgjzjTbz9falI53aHMwQR1Y3ets+ZRmoeebqUSHzWJAxlw 4KBQ== 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=aJeqhSfPf1dcUs+r0c01dMaDEKKi7iJiGmsCFR9fzK4=; b=bnAcyhGdQ0SVEIflSw6vLF4tuQrjJtGivu6/7BIzej14laqZiIIO3DP2xokp0XLHO9 9dQpaLu1U1jpB/0PjwaobuwdAvbx21WgVgvalt6Z0TeYajHrdj0xlaPUhJj3na6cpRXT E0ZYx33xfp/tMmCAlNvY5hw4z6TMSUga3NOVE7+OOvkWVNTlz33AGv/B9lXodr0nEb8L RC0OEVGJCIdVgu0NyTXHym5+mJqnYoRSh4COTtWxHcZ90KCDISzitM3vc+Dio8EygHNn vUl4j+6MEWHELRhBr+20FOzvIjCFJXgCyfEGLzEAUI7ByI9feHSIzr3NsFQ8ArCzzeZu p84A== X-Gm-Message-State: ABUngvexqXVkAcF2AcDnXsK4jQE+Jtk4KhGdI0LbYMo2yhsV/7vIW34M2VcAGAox3FQf9g== X-Received: by 10.99.61.74 with SMTP id k71mr72404836pga.9.1479156737330; Mon, 14 Nov 2016 12:52:17 -0800 (PST) Received: from sixbynine.org (cpc26-heme10-2-0-cust305.9-1.cable.virginm.net. [86.3.57.50]) by smtp.gmail.com with ESMTPSA id c2sm37388508pal.42.2016.11.14.12.52.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Nov 2016 12:52:16 -0800 (PST) From: Robert Bragg To: intel-gfx@lists.freedesktop.org Date: Mon, 14 Nov 2016 20:51:22 +0000 Message-Id: <20161114205122.10742-14-robert@sixbynine.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161114205122.10742-1-robert@sixbynine.org> References: <20161114205122.10742-1-robert@sixbynine.org> Subject: [Intel-gfx] [PATCH igt v4 13/13] 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 43f25ce..cc2103a 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -485,6 +485,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, @@ -503,6 +519,15 @@ igt_main bad_lris + i, bad_lri_errno, bad_lris[i].init_val); } + + if (parser_version >= 9) { + for (int i = 0; i < ARRAY_SIZE(v9_bad_lris); i++) { + test_lri(fd, handle, + v9_bad_lris + i, + 0, + v9_bad_lris[i].init_val); + } + } } igt_fixture {