From patchwork Tue Jul 28 18:14:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SGFubm8gQsODwrZjaw==?= X-Patchwork-Id: 6887811 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 2AD3A9F380 for ; Tue, 28 Jul 2015 18:14:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47DC820755 for ; Tue, 28 Jul 2015 18:14:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C12FB2071C for ; Tue, 28 Jul 2015 18:14:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0F5F6EA9F; Tue, 28 Jul 2015 11:14:18 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from zucker2.schokokeks.org (zucker2.schokokeks.org [178.63.68.90]) by gabe.freedesktop.org (Postfix) with ESMTPS id D55E66E078 for ; Tue, 28 Jul 2015 11:14:17 -0700 (PDT) Received: from pc1 ([::ffff:76.14.62.119]) (AUTH: LOGIN hanno-default@schokokeks.org, TLS: TLSv1/SSLv3, 128bits, ECDHE-RSA-AES128-GCM-SHA256) by zucker.schokokeks.org with ESMTPSA; Tue, 28 Jul 2015 20:14:13 +0200 id 0000000000000019.0000000055B7C675.00007190 Date: Tue, 28 Jul 2015 11:14:19 -0700 From: Hanno =?UTF-8?B?QsO2Y2s=?= To: Daniel Vetter Message-ID: <20150728111419.38b36358@pc1> In-Reply-To: <20150728081451.GC16722@phenom.ffwll.local> References: <20150725185620.6c22c90a@pc1> <20150727085945.GA7300@nuc-i3427.alporthouse.com> <20150727211532.646ba446@pc1> <20150728074551.GB27074@nuc-i3427.alporthouse.com> <20150728081451.GC16722@phenom.ffwll.local> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-pc-linux-gnu) Mime-Version: 1.0 Cc: intel-gfx@lists.freedesktop.org Subject: Re: [Intel-gfx] Error in inner loop in validate_cmds_sorted / out of bounds issue 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=-5.6 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 Hi, On Tue, 28 Jul 2015 10:14:51 +0200 Daniel Vetter wrote: > > Indeed, nice catch. Could you please read > > Documentation/SubmittingPatches and apply your Signed-off-by and > > then we can accept this patch under your authorship. > > > > Preferrably this is two patches, (a) fix the tables, (b) fix the > > validator. That way we can delay enabling the validator if we need > > to fix the tables for others. I think I have checked all tables, not just the ones used on my gpu, they should be fine. But I've splittet the patch. > Also can you please add signed-off-by lines to your patch when > resubmitting? See Documentation/SubmittingPatches for all the details. The patch already had a "Signed-off-by" line. The checkpatch script complains that it doesn't like the formatting of the CMD command. However I won't change that in this patch, as this is how the whole file is formatted. If this is wanted I can submit a patch changing the formatting afterwards, but I think this is an unrelated change. Please apply. Reviewed-by: Chris Wilson Reviewed-by: Chris Wilson Fix loop checking cmd tables. Signed-off-by: Hanno Boeck diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c index 306d9e4..3a53bf3 100644 --- a/drivers/gpu/drm/i915/i915_cmd_parser.c +++ b/drivers/gpu/drm/i915/i915_cmd_parser.c @@ -564,7 +564,7 @@ static bool validate_cmds_sorted(struct intel_engine_cs *ring, for (j = 0; j < table->count; j++) { const struct drm_i915_cmd_descriptor *desc = - &table->table[i]; + &table->table[j]; u32 curr = desc->cmd.value & desc->cmd.mask; if (curr < previous) {