From patchwork Tue Feb 28 21:58:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Argenziano X-Patchwork-Id: 9597009 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 20282600CB for ; Tue, 28 Feb 2017 21:59:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1280328591 for ; Tue, 28 Feb 2017 21:59:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05287284FF; Tue, 28 Feb 2017 21:59:25 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 9C314284FF for ; Tue, 28 Feb 2017 21:59:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 342556E806; Tue, 28 Feb 2017 21:59:25 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 318876E806 for ; Tue, 28 Feb 2017 21:59:24 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2017 13:59:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,221,1484035200"; d="scan'208";a="829475025" Received: from relo-linux-2.fm.intel.com ([10.1.27.122]) by FMSMGA003.fm.intel.com with ESMTP; 28 Feb 2017 13:59:23 -0800 From: Antonio Argenziano To: intel-gfx@lists.freedesktop.org Date: Tue, 28 Feb 2017 13:58:24 -0800 Message-Id: <20170228215824.6423-2-antonio.argenziano@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170228215824.6423-1-antonio.argenziano@intel.com> References: <20170228215824.6423-1-antonio.argenziano@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/2] tests/gem_bad_address: Fix store address 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 The test purpose is to write at an invalid GTT location. To do so, the store instruction used in the test has been updated to use the correct value and extra unneeded flags have been removed. The batch buffer is also sent as privileged now. Signed-off-by: Antonio Argenziano --- tests/gem_bad_address.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/gem_bad_address.c b/tests/gem_bad_address.c index a970dfa4..720ab24d 100644 --- a/tests/gem_bad_address.c +++ b/tests/gem_bad_address.c @@ -38,22 +38,26 @@ #include "drm.h" #include "intel_bufmgr.h" +/* + The intent of this test is to try write an area of memory that is outside + the currently allowed boundary of the GTT. To do so it will use a batch + buffer that will run on Blitter engine as a privileged batch. +*/ + static drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; -#define BAD_GTT_DEST ((512*1024*1024)) /* past end of aperture */ - static void bad_store(void) { BEGIN_BATCH(4, 0); - OUT_BATCH(MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL | 1 << 21); - OUT_BATCH(0); - OUT_BATCH(BAD_GTT_DEST); + OUT_BATCH(MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL ); + OUT_BATCH(0); // lower part of the address (first 4 GByte = GTT size) + OUT_BATCH(0x1); //Higher part of the address (>GTT size) OUT_BATCH(0xdeadbeef); ADVANCE_BATCH(); - intel_batchbuffer_flush(batch); + intel_batchbuffer_flush_secure(batch); } igt_simple_main