From patchwork Fri Nov 23 12:45:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10695757 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 D03875A4 for ; Fri, 23 Nov 2018 12:45:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C02712BE1A for ; Fri, 23 Nov 2018 12:45:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B43842C126; Fri, 23 Nov 2018 12:45:54 +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 6309F2BE1A for ; Fri, 23 Nov 2018 12:45:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ACF956E0FB; Fri, 23 Nov 2018 12:45:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACD356E0FB for ; Fri, 23 Nov 2018 12:45:52 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id x30so10187573edx.2 for ; Fri, 23 Nov 2018 04:45:52 -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=I4yhIlWVsDVs2w6BzYEYVdHfmm9dY1LtcCjmpKu2YQg=; b=YlGepLU6j58LN5goOeV5IJsSvEzFb9d4Dpx6ahZ/1ivFoRCmNhKCerFIAfgPgYQ/is HZ/tBV9N3l1gGAq6jzX0hPulOjphFVdWuyqcY2QBgH3S3/4HQgVh1PnSv5NEOfG3FTxG iO89SSe6bWz/N5KThvZ9LHSzqrI+4mr+8PojFNEzQyXYgKzw2JpesgTS5KNaOD65ydtj 7zskOtirObYYgOUuA4fJH5F7746qT0/7bB5amrqcyCPDvdqC4pwUPfR1D2oh1N/C2Q3V Pe5YS03VRjNGvFzjiimzuFXnNFHYQ3jPGbIZ4V3rI3KZzro58D1gfb6ig7+BTmRw8err 1exg== X-Gm-Message-State: AGRZ1gJhf08MjxhIPaavFObF7j3WshvCsoDVlMqA5UHJj7SQvOI4aBN9 pcQnOz8dNBFjIf7H1NZRh4JtsmlW2Vc= X-Google-Smtp-Source: AJdET5eYbycTlUZg6fP54xDe+XoxtFURcHkpvL6mhwx9SAHoGWGpKVw+YylgOlpXyINfZQOUJ6CA5A== X-Received: by 2002:a17:906:4447:: with SMTP id i7-v6mr11437629ejp.190.1542977150905; Fri, 23 Nov 2018 04:45:50 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id s3-v6sm6629074ejq.37.2018.11.23.04.45.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 04:45:50 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 23 Nov 2018 13:45:45 +0100 Message-Id: <20181123124545.1974-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123085307.13304-1-daniel.vetter@ffwll.ch> References: <20181123085307.13304-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. 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..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/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