Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3662470ybt; Sun, 5 Jul 2020 02:50:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzktWFJn4R49EnptOH4sZn4o2oNf5q8du8jRDOYeG1jxJmtrxefc9Nz6jjlNut38aJV/mvA X-Received: by 2002:a17:906:eb4b:: with SMTP id mc11mr38630108ejb.5.1593942615968; Sun, 05 Jul 2020 02:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593942615; cv=none; d=google.com; s=arc-20160816; b=WMtsx/34rwdFrGuZU4Crj+WXebWO490aEAW46liXLmJYHUpaGQOe2eQdWZ2fxAPGl2 8uRBylofo1gBhi2FLGMqP611GTgth9IYG2Iy60pjsauF4udAzVn5v3rquz0X6v+yGaXB jcGjc4Q3XNmYcvTZDz/aFnSIyj46yxvp4/99knZbW7VAYB+3WpQP2aRmw0CI5Y57vros oaHk8TqM/lQwWVaCGnA7nZ2fXFt8pnOuY3TWFIHVL1yhtPmFGEJjDC1nELVsDrQanxop 3DFnznzio8YThsg/4EQAWRi0JNCWwaA3VjtUwY6bUmbQD7z12qbJV7mswrvEhvVA6mxo kQFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tHnpC71hcfA/vez1Cww9W5B4TSyANtAeNM8bwdPbQkw=; b=JRhpmk59oa6u2IyPnFIPftXOD7gWLvhDzXCbGEgF8DXCfkF8vQqnu0bCqvUnYjfIgL OgUHbxfJ52TAqP4w9xmKaXDZRxlr01Z8Ows5N+wdiIORBfI+D8xiOKoL7W6ZEsmLcSzj 9KUJmwObJoLVmLp8HeyKEcFJRRn9b0rrrldu3eC+GdwEDVETlj5gAsmSfenUoa3PUDHr tjoa3w+2nSKhND34gRWUpOlKBF2gCvo7GMlu6WzfHgL5X1ToAMIYB6W1lH9Tjy6fvi91 AtUXQxIqxCsTJGp5DR35j/OSY9zk9vy59oquhR984WvjkTJgVexXSqQ8UQdUIxuqusF/ ETaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r14si10493423eds.270.2020.07.05.02.49.53; Sun, 05 Jul 2020 02:50:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbgGEJtn (ORCPT + 99 others); Sun, 5 Jul 2020 05:49:43 -0400 Received: from elvis.franken.de ([193.175.24.41]:49396 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbgGEJtn (ORCPT ); Sun, 5 Jul 2020 05:49:43 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1js1HF-0002u8-01; Sun, 05 Jul 2020 11:49:37 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id EAED3C077D; Sun, 5 Jul 2020 11:48:11 +0200 (CEST) Date: Sun, 5 Jul 2020 11:48:11 +0200 From: Thomas Bogendoerfer To: Xingxing Su Cc: Huacai Chen , Jiaxun Yang , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li , Tiezhu Yang Subject: Re: [PATCH] MIPS: Do not use smp_processor_id() in preemptible code Message-ID: <20200705094811.GB4064@alpha.franken.de> References: <1593749518-16722-1-git-send-email-suxingxing@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1593749518-16722-1-git-send-email-suxingxing@loongson.cn> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 03, 2020 at 12:11:58PM +0800, Xingxing Su wrote: > Use preempt_disable() to fix the following bug under CONFIG_DEBUG_PREEMPT. > > [ 21.915305] BUG: using smp_processor_id() in preemptible [00000000] code: qemu-system-mip/1056 > [ 21.923996] caller is do_ri+0x1d4/0x690 > [ 21.927921] CPU: 0 PID: 1056 Comm: qemu-system-mip Not tainted 5.8.0-rc2 #3 > [ 21.934913] Stack : 0000000000000001 ffffffff81370000 ffffffff8071cd60 a80f926d5ac95694 > [ 21.942984] a80f926d5ac95694 0000000000000000 98000007f0043c88 ffffffff80f2fe40 > [ 21.951054] 0000000000000000 0000000000000000 0000000000000001 0000000000000000 > [ 21.959123] ffffffff802d60cc 98000007f0043dd8 ffffffff81f4b1e8 ffffffff81f60000 > [ 21.967192] ffffffff81f60000 ffffffff80fe0000 ffff000000000000 0000000000000000 > [ 21.975261] fffffffff500cce1 0000000000000001 0000000000000002 0000000000000000 > [ 21.983331] ffffffff80fe1a40 0000000000000006 ffffffff8077f940 0000000000000000 > [ 21.991401] ffffffff81460000 98000007f0040000 98000007f0043c80 000000fffba8cf20 > [ 21.999471] ffffffff8071cd60 0000000000000000 0000000000000000 0000000000000000 > [ 22.007541] 0000000000000000 0000000000000000 ffffffff80212ab4 a80f926d5ac95694 > [ 22.015610] ... > [ 22.018086] Call Trace: > [ 22.020562] [] show_stack+0xa4/0x138 > [ 22.025732] [] dump_stack+0xf0/0x150 > [ 22.030903] [] check_preemption_disabled+0xf4/0x100 > [ 22.037375] [] do_ri+0x1d4/0x690 > [ 22.042198] [] handle_ri_int+0x44/0x5c > [ 24.359386] BUG: using smp_processor_id() in preemptible [00000000] code: qemu-system-mip/1072 > [ 24.368204] caller is do_ri+0x1a8/0x690 > [ 24.372169] CPU: 4 PID: 1072 Comm: qemu-system-mip Not tainted 5.8.0-rc2 #3 > [ 24.379170] Stack : 0000000000000001 ffffffff81370000 ffffffff8071cd60 a80f926d5ac95694 > [ 24.387246] a80f926d5ac95694 0000000000000000 98001007ef06bc88 ffffffff80f2fe40 > [ 24.395318] 0000000000000000 0000000000000000 0000000000000001 0000000000000000 > [ 24.403389] ffffffff802d60cc 98001007ef06bdd8 ffffffff81f4b818 ffffffff81f60000 > [ 24.411461] ffffffff81f60000 ffffffff80fe0000 ffff000000000000 0000000000000000 > [ 24.419533] fffffffff500cce1 0000000000000001 0000000000000002 0000000000000000 > [ 24.427603] ffffffff80fe0000 0000000000000006 ffffffff8077f940 0000000000000020 > [ 24.435673] ffffffff81460020 98001007ef068000 98001007ef06bc80 000000fffbbbb370 > [ 24.443745] ffffffff8071cd60 0000000000000000 0000000000000000 0000000000000000 > [ 24.451816] 0000000000000000 0000000000000000 ffffffff80212ab4 a80f926d5ac95694 > [ 24.459887] ... > [ 24.462367] Call Trace: > [ 24.464846] [] show_stack+0xa4/0x138 > [ 24.470029] [] dump_stack+0xf0/0x150 > [ 24.475208] [] check_preemption_disabled+0xf4/0x100 > [ 24.481682] [] do_ri+0x1a8/0x690 > [ 24.486509] [] handle_ri_int+0x44/0x5c > > Signed-off-by: Xingxing Su > --- > arch/mips/kernel/traps.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) applied to mips-fixes. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]