From patchwork Fri Nov 23 08:53:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10695239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6494E1709 for ; Fri, 23 Nov 2018 08:53:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53FDB2C6B9 for ; Fri, 23 Nov 2018 08:53:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4833A2C707; Fri, 23 Nov 2018 08:53:19 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 EEC0E2C6B9 for ; Fri, 23 Nov 2018 08:53:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E5A816E23C; Fri, 23 Nov 2018 08:53:17 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BDC56E120 for ; Fri, 23 Nov 2018 08:53:15 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id y56so9617135edd.11 for ; Fri, 23 Nov 2018 00:53:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bOsVneP7REu0++5dw5NsHQAuAMoFIhsS86Oz/MTsGjw=; b=EZFFz8s71aKsUKXkW8Z9d4LgH6chjJywA/+qKHWNwYXr0UYrH8XvYs9MWDqRKgtzsX gCR8xCvixhDDfn9rTCwZXNm0HYer4+AeXx62E57c2UgXEPWJWFsd23Y1nOt8c8g9bTsU DfwkAxw7a5+87s3CLFNtWFwFY5GjDSR7ykCeApvf/xWnUAY2Jp+b8AGp0BpOSHXeutNh ZEKnAYAhht0IzxB7AfV6hIoeNr+scmA/9C0Embn4MapJq7AnWl6k0EymAO7W+KBKBL0Y sTx+SO7/Zw8B+lPXWcpYbdpqdwpUpdxY76kDIL12oXj1o6FRCGL41N46gOhHaDoeWZ52 cUUA== X-Gm-Message-State: AA+aEWbG+MNvtedLju8EGtLLXKCbwFAXecXC9gF1TLI0wTX8z3UulunA e32Q9H3sm+UF4oxIVB4L+06yilZ8c2k= X-Google-Smtp-Source: AFSGD/XRiPrgbz0SQXrez3tOiQk1Eo4swmvyYnb47YSSojqgDQkOVpjxZVgAe02vFE3gAuEq7PdhDg== X-Received: by 2002:a05:6402:643:: with SMTP id u3mr12334104edx.276.1542963193855; Fri, 23 Nov 2018 00:53:13 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id x10sm7273914edb.58.2018.11.23.00.53.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 00:53:12 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 23 Nov 2018 09:53:07 +0100 Message-Id: <20181123085307.13304-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122163526.16873-1-daniel.vetter@ffwll.ch> References: <20181122163526.16873-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] HAX FOR CI: Enable cross-release X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Only way to convince our CI to enable stuff that's new and defaulting to off. Obviously not for merging. v2: Also enable fullstack backtraces. v3: Try to chase this elusive stack trace corruption CI is seeing. v4: Make it compile. Silly me. Signed-off-by: Daniel Vetter --- kernel/locking/lockdep.c | 13 +++++++++++++ lib/Kconfig.debug | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index e74add63f317..1ceb97cc6ec0 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -4841,8 +4841,15 @@ static void add_xhlock(struct held_lock *hlock) xhlock->trace.entries = xhlock->trace_entries; if (crossrelease_fullstack) { + int i; + xhlock->trace.skip = 3; save_stack_trace(&xhlock->trace); + + for (i = 0; i < xlock->trace.nr_entries; i++) { + if (xlock->trace.entries[i] == 0x6b6b6b6b6b6b6b6bUL) + print_lockdep_off("BUG: list poison in add_xlock!"); + } } else { xhlock->trace.nr_entries = 1; xhlock->trace.entries[0] = hlock->acquire_ip; @@ -4950,12 +4957,18 @@ static int copy_trace(struct stack_trace *trace) unsigned long *buf = stack_trace + nr_stack_trace_entries; unsigned int max_nr = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries; unsigned int nr = min(max_nr, trace->nr_entries); + int i; trace->nr_entries = nr; memcpy(buf, trace->entries, nr * sizeof(trace->entries[0])); trace->entries = buf; nr_stack_trace_entries += nr; + for (i = 0; i < trace->nr_entries; i++) { + if (trace->entries[i] == 0x6b6b6b6b6b6b6b6bUL) + print_lockdep_off("BUG: list poison in copy_trace!"); + } + if (nr_stack_trace_entries >= MAX_STACK_TRACE_ENTRIES-1) { if (!debug_locks_off_graph_unlock()) return 0; diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 6074fa3463ac..8e1c30e3face 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1095,6 +1095,7 @@ config LOCKDEP_CROSSRELEASE bool "Enable cross-release checking" depends on PROVE_LOCKING select LOCKDEP_COMPLETIONS + default y help This makes lockdep work for crosslock which is a lock allowed to be released in a different context from the acquisition context. @@ -1208,7 +1209,7 @@ config LOCKDEP_COMPLETIONS config BOOTPARAM_LOCKDEP_CROSSRELEASE_FULLSTACK bool "Enable the boot parameter, crossrelease_fullstack" depends on LOCKDEP_CROSSRELEASE - default n + default y help The lockdep "cross-release" feature needs to record stack traces (of calling functions) for all acquisitions, for eventual later