From patchwork Fri Nov 23 13:24:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10695779 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 2AC9413BF for ; Fri, 23 Nov 2018 13:24:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 173632AF6F for ; Fri, 23 Nov 2018 13:24:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F15452C4E7; Fri, 23 Nov 2018 13:24:36 +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 9C7442AF6F for ; Fri, 23 Nov 2018 13:24:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2892F6E67D; Fri, 23 Nov 2018 13:24:36 +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 E38F06E67D for ; Fri, 23 Nov 2018 13:24:34 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id o10so10221067edt.13 for ; Fri, 23 Nov 2018 05:24:34 -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=U/YSZ+V6tO/x+hjgD5ESw0p6arCS6/meYLuBogGhvco=; b=g/N4YFNhVMddxWIijyo5N4wIf92hDP65xI0962bVR1VbIE9sgDUTCLFpaQSWrfLrPX VRI8WdNWIMqcPeEVtTuTde2wgqjMGAQ0bTRrA9OIPx/RoEQwcTJN6kn8cU67nEraOwpP rTqulO4HvfomoaQutEawXt3u78B2Oke/5qWwIdl3XOhwc/UEk+K5ebnlEasYsH9xxeI0 eYKJc3X4aVc0PK1P8SFQt05cjdORDqVGQ0w8q0FxtxWHydtxvDf58KeMuRM0pA+uD7gY x/HJmHButBAJrOKLY+dJqXfP7W24c0L3JUjyJyDgyML7mHylRlwXc4XpKE13CDDMTpht 67cw== X-Gm-Message-State: AA+aEWZ4Gq3vqS/Lhna/lbBXJEq41uVcDTpevxWtmOALnlO0pQ6AdEi2 h7k3qJnSVKV7Ryh9bEKn326n50Esy40= X-Google-Smtp-Source: AFSGD/US3F+cdLqNHBeJKwjIHCIHoVC1ackf5ojOFLK0a3O1Mj49T8FSnQW5HoDS820XzQsdsc5PbA== X-Received: by 2002:a50:f489:: with SMTP id s9mr13152585edm.101.1542979473214; Fri, 23 Nov 2018 05:24:33 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id s12sm13582049edb.43.2018.11.23.05.24.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 05:24:32 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 23 Nov 2018 14:24:27 +0100 Message-Id: <20181123132427.10955-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123124545.1974-1-daniel.vetter@ffwll.ch> References: <20181123124545.1974-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. v5: Even sillier me. v6: Still confused. Signed-off-by: Daniel Vetter --- kernel/locking/lockdep.c | 13 +++++++++++++ kernel/stacktrace.c | 6 ++++++ lib/Kconfig.debug | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index e74add63f317..3fea5e0a1c12 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 < xhlock->trace.nr_entries; i++) { + if (xhlock->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/kernel/stacktrace.c b/kernel/stacktrace.c index f8edee9c792d..b66d60cc6bfa 100644 --- a/kernel/stacktrace.c +++ b/kernel/stacktrace.c @@ -20,6 +20,12 @@ void print_stack_trace(struct stack_trace *trace, int spaces) for (i = 0; i < trace->nr_entries; i++) printk("%*c%pS\n", 1 + spaces, ' ', (void *)trace->entries[i]); + + for (i = 0; i < trace->nr_entries; i++) { + if (trace->entries[i] == 0x6b6b6b6b6b6b6b6bUL) + printk("BUG: list poison in print_trace!"); + } + } EXPORT_SYMBOL_GPL(print_stack_trace); 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