From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DEFFC11F68 for ; Fri, 2 Jul 2021 11:57:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3647761402 for ; Fri, 2 Jul 2021 11:57:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3647761402 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 301E56E145; Fri, 2 Jul 2021 11:57:55 +0000 (UTC) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E23C6E145; Fri, 2 Jul 2021 11:57:54 +0000 (UTC) Received: by mail-qt1-x830.google.com with SMTP id v10so6387680qto.1; Fri, 02 Jul 2021 04:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7OuZt5fA+Ly0GbEZTGNMa0tAD8B8PBqS3n928BlHp6o=; b=lJBGLVygbnM58I8P9oIuXKUixthhjsfzHZgnCAk2Q+lXUdCeYqefBLNQwjPxMekfVq wZFp70KbRUgPcVNeHHmFflsnV5e+9OjnFGt4s548zZ9G/5ffcfcMv2J7OG2hGbqTQaAJ w5dnFRdgdgTmuWSX9zrVi0nXl7VqjybKEvGzzYEH7sSO85BFFWkz6meYJGnlzyVpKVRO 4HNa300pLU/80hCRjC/gjYmloD72C4m4pISC0RB0jRp0rPLYyYoVdK+HzL/V2DdXjkVA 2w+tWl5t0Z3G7/+JnQLDfjBh3c40g6rzxQXfJyI1jFr4a84mADv86zQRR21cIcOgGtNk RgiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7OuZt5fA+Ly0GbEZTGNMa0tAD8B8PBqS3n928BlHp6o=; b=cJTOTsDKisaoMamSbn/9gjswarbNWztNLBiP/V/4SE2Odvz1wfW0HCbqR4DGkuK99h vojGozkHCpeE3IuTti+yMbCyicem+OqqenO+d7nrhS0qqMx7M7Ar5jf7gUAUaJKHF5+c BfFJKBdDA95Hh6mzFP5c+U1S48SoI6F9jrgzGibpCOf8/0uufSnrhhDQ2uYF06BGyUFJ 08vfeKlbe3yoSRvbJj/NrsShhZT52vVoLMBaRtVORGXF79i1eJKo/OlB3kLW3RgEaOCe 3uJ/kzHme1RoKRu8qoDP6DcF1zfEDHFK2qvU9qHQo8WGgC9bEY9gMyLjYtzotLWso8pr Oq0w== X-Gm-Message-State: AOAM531ysS0JQhTcV21S6suGalZuRNISxsZJQrpq0U7+CsXRtn/IJi9H ituh7VdHz9VDYu9PfzcD3RL0wwjiPoFkzRmjalQ= X-Google-Smtp-Source: ABdhPJz72AcMhhZNMLoknpfoERQVAra24ONLKqPzI4c4yG6N7fqyc3XoX+RP4+SOft1z31N4RvoBehT5zTVlcJs9chs= X-Received: by 2002:ac8:5c8c:: with SMTP id r12mr4616918qta.265.1625227073418; Fri, 02 Jul 2021 04:57:53 -0700 (PDT) MIME-Version: 1.0 References: <202107020708.XXwacDfG-lkp@intel.com> <20210702110727.GT1983@kadam> <20210702111344.GV1983@kadam> In-Reply-To: <20210702111344.GV1983@kadam> From: Matthew Auld Date: Fri, 2 Jul 2021 12:57:26 +0100 Message-ID: Subject: Re: [Intel-gfx] [drm-intel:drm-intel-gt-next 8/14] drivers/gpu/drm/i915/gt/selftest_migrate.c:102 copy() error: uninitialized symbol 'rq'. To: Dan Carpenter Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= , kbuild-all@lists.01.org, kbuild@lists.01.org, ML dri-devel , Chris Wilson , Matthew Auld , Intel Graphics Development Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 2 Jul 2021 at 12:14, Dan Carpenter wrote: > > On Fri, Jul 02, 2021 at 02:07:27PM +0300, Dan Carpenter wrote: > > On Fri, Jul 02, 2021 at 11:32:45AM +0100, Matthew Auld wrote: > > > On Fri, 2 Jul 2021 at 09:45, Dan Carpenter wrote: > > > > cf586021642d80 Chris Wilson 2021-06-17 84 > > > > cf586021642d80 Chris Wilson 2021-06-17 85 err = fn(migrate, &ww, src, dst, &rq); > > > > cf586021642d80 Chris Wilson 2021-06-17 86 if (!err) > > > > cf586021642d80 Chris Wilson 2021-06-17 87 continue; > > > > > > > > Does fn() initialize "rq" on the success path? Anyway Smatch would > > > > complain anyway because it thinks the list could be empty or that we > > > > might hit and early continue for everything. > > > > > > The fn() will always first initialize the rq to NULL. If it returns > > > success then rq will always be a valid rq. If it returns an err then > > > the rq might be NULL, or a valid rq depending on how far the copy/fn > > > got. > > > > > > And for_i915_gem_ww() will always run at least once, since ww->loop = > > > true, so this looks like a false positive? > > > > You don't think i915_gem_object_lock(), i915_gem_object_pin_map() or > > i915_gem_object_pin_map() can fail? > > Btw, I sincerely hope that we will re-enable GCC's uninitialized > variable checks. Will GCC be able to verify that this is initialized? 34b07d47dd00 ("drm/i915: Enable -Wuninitialized") GCC doesn't complain AFAIK. > > regards, > dan carpenter > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DC7CC11F68 for ; Fri, 2 Jul 2021 11:58:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33CAD6141D for ; Fri, 2 Jul 2021 11:58:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33CAD6141D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A300B6E147; Fri, 2 Jul 2021 11:57:55 +0000 (UTC) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E23C6E145; Fri, 2 Jul 2021 11:57:54 +0000 (UTC) Received: by mail-qt1-x830.google.com with SMTP id v10so6387680qto.1; Fri, 02 Jul 2021 04:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7OuZt5fA+Ly0GbEZTGNMa0tAD8B8PBqS3n928BlHp6o=; b=lJBGLVygbnM58I8P9oIuXKUixthhjsfzHZgnCAk2Q+lXUdCeYqefBLNQwjPxMekfVq wZFp70KbRUgPcVNeHHmFflsnV5e+9OjnFGt4s548zZ9G/5ffcfcMv2J7OG2hGbqTQaAJ w5dnFRdgdgTmuWSX9zrVi0nXl7VqjybKEvGzzYEH7sSO85BFFWkz6meYJGnlzyVpKVRO 4HNa300pLU/80hCRjC/gjYmloD72C4m4pISC0RB0jRp0rPLYyYoVdK+HzL/V2DdXjkVA 2w+tWl5t0Z3G7/+JnQLDfjBh3c40g6rzxQXfJyI1jFr4a84mADv86zQRR21cIcOgGtNk RgiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7OuZt5fA+Ly0GbEZTGNMa0tAD8B8PBqS3n928BlHp6o=; b=cJTOTsDKisaoMamSbn/9gjswarbNWztNLBiP/V/4SE2Odvz1wfW0HCbqR4DGkuK99h vojGozkHCpeE3IuTti+yMbCyicem+OqqenO+d7nrhS0qqMx7M7Ar5jf7gUAUaJKHF5+c BfFJKBdDA95Hh6mzFP5c+U1S48SoI6F9jrgzGibpCOf8/0uufSnrhhDQ2uYF06BGyUFJ 08vfeKlbe3yoSRvbJj/NrsShhZT52vVoLMBaRtVORGXF79i1eJKo/OlB3kLW3RgEaOCe 3uJ/kzHme1RoKRu8qoDP6DcF1zfEDHFK2qvU9qHQo8WGgC9bEY9gMyLjYtzotLWso8pr Oq0w== X-Gm-Message-State: AOAM531ysS0JQhTcV21S6suGalZuRNISxsZJQrpq0U7+CsXRtn/IJi9H ituh7VdHz9VDYu9PfzcD3RL0wwjiPoFkzRmjalQ= X-Google-Smtp-Source: ABdhPJz72AcMhhZNMLoknpfoERQVAra24ONLKqPzI4c4yG6N7fqyc3XoX+RP4+SOft1z31N4RvoBehT5zTVlcJs9chs= X-Received: by 2002:ac8:5c8c:: with SMTP id r12mr4616918qta.265.1625227073418; Fri, 02 Jul 2021 04:57:53 -0700 (PDT) MIME-Version: 1.0 References: <202107020708.XXwacDfG-lkp@intel.com> <20210702110727.GT1983@kadam> <20210702111344.GV1983@kadam> In-Reply-To: <20210702111344.GV1983@kadam> From: Matthew Auld Date: Fri, 2 Jul 2021 12:57:26 +0100 Message-ID: To: Dan Carpenter Subject: Re: [Intel-gfx] [drm-intel:drm-intel-gt-next 8/14] drivers/gpu/drm/i915/gt/selftest_migrate.c:102 copy() error: uninitialized symbol 'rq'. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= , kbuild-all@lists.01.org, kbuild@lists.01.org, ML dri-devel , Chris Wilson , Matthew Auld , Intel Graphics Development Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 2 Jul 2021 at 12:14, Dan Carpenter wrote: > > On Fri, Jul 02, 2021 at 02:07:27PM +0300, Dan Carpenter wrote: > > On Fri, Jul 02, 2021 at 11:32:45AM +0100, Matthew Auld wrote: > > > On Fri, 2 Jul 2021 at 09:45, Dan Carpenter wrote: > > > > cf586021642d80 Chris Wilson 2021-06-17 84 > > > > cf586021642d80 Chris Wilson 2021-06-17 85 err = fn(migrate, &ww, src, dst, &rq); > > > > cf586021642d80 Chris Wilson 2021-06-17 86 if (!err) > > > > cf586021642d80 Chris Wilson 2021-06-17 87 continue; > > > > > > > > Does fn() initialize "rq" on the success path? Anyway Smatch would > > > > complain anyway because it thinks the list could be empty or that we > > > > might hit and early continue for everything. > > > > > > The fn() will always first initialize the rq to NULL. If it returns > > > success then rq will always be a valid rq. If it returns an err then > > > the rq might be NULL, or a valid rq depending on how far the copy/fn > > > got. > > > > > > And for_i915_gem_ww() will always run at least once, since ww->loop = > > > true, so this looks like a false positive? > > > > You don't think i915_gem_object_lock(), i915_gem_object_pin_map() or > > i915_gem_object_pin_map() can fail? > > Btw, I sincerely hope that we will re-enable GCC's uninitialized > variable checks. Will GCC be able to verify that this is initialized? 34b07d47dd00 ("drm/i915: Enable -Wuninitialized") GCC doesn't complain AFAIK. > > regards, > dan carpenter > _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8805486661230920052==" MIME-Version: 1.0 From: Matthew Auld To: kbuild-all@lists.01.org Subject: Re: [Intel-gfx] [drm-intel:drm-intel-gt-next 8/14] drivers/gpu/drm/i915/gt/selftest_migrate.c:102 copy() error: uninitialized symbol 'rq'. Date: Fri, 02 Jul 2021 12:57:26 +0100 Message-ID: In-Reply-To: <20210702111344.GV1983@kadam> List-Id: --===============8805486661230920052== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Fri, 2 Jul 2021 at 12:14, Dan Carpenter wro= te: > > On Fri, Jul 02, 2021 at 02:07:27PM +0300, Dan Carpenter wrote: > > On Fri, Jul 02, 2021 at 11:32:45AM +0100, Matthew Auld wrote: > > > On Fri, 2 Jul 2021 at 09:45, Dan Carpenter wrote: > > > > cf586021642d80 Chris Wilson 2021-06-17 84 > > > > cf586021642d80 Chris Wilson 2021-06-17 85 err =3D fn(= migrate, &ww, src, dst, &rq); > > > > cf586021642d80 Chris Wilson 2021-06-17 86 if (!err) > > > > cf586021642d80 Chris Wilson 2021-06-17 87 con= tinue; > > > > > > > > Does fn() initialize "rq" on the success path? Anyway Smatch would > > > > complain anyway because it thinks the list could be empty or that we > > > > might hit and early continue for everything. > > > > > > The fn() will always first initialize the rq to NULL. If it returns > > > success then rq will always be a valid rq. If it returns an err then > > > the rq might be NULL, or a valid rq depending on how far the copy/fn > > > got. > > > > > > And for_i915_gem_ww() will always run at least once, since ww->loop = =3D > > > true, so this looks like a false positive? > > > > You don't think i915_gem_object_lock(), i915_gem_object_pin_map() or > > i915_gem_object_pin_map() can fail? > > Btw, I sincerely hope that we will re-enable GCC's uninitialized > variable checks. Will GCC be able to verify that this is initialized? 34b07d47dd00 ("drm/i915: Enable -Wuninitialized") GCC doesn't complain AFAIK. > > regards, > dan carpenter > --===============8805486661230920052==--