All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sven Schnelle <svens@stackframe.org>,
	Helge Deller <deller@gmx.de>, Sasha Levin <sashal@kernel.org>,
	James.Bottomley@HansenPartnership.com,
	wangkefeng.wang@huawei.com, rmk+kernel@armlinux.org.uk,
	hanyihao@vivo.com, david@redhat.com, willy@infradead.org,
	linux-parisc@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 44/47] parisc: fix warning in flush_tlb_all
Date: Mon,  8 Nov 2021 12:50:28 -0500	[thread overview]
Message-ID: <20211108175031.1190422-44-sashal@kernel.org> (raw)
In-Reply-To: <20211108175031.1190422-1-sashal@kernel.org>

From: Sven Schnelle <svens@stackframe.org>

[ Upstream commit 1030d681319b43869e0d5b568b9d0226652d1a6f ]

I've got the following splat after enabling preemption:

[    3.724721] BUG: using __this_cpu_add() in preemptible [00000000] code: swapper/0/1
[    3.734630] caller is __this_cpu_preempt_check+0x38/0x50
[    3.740635] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.15.0-rc4-64bit+ #324
[    3.744605] Hardware name: 9000/785/C8000
[    3.744605] Backtrace:
[    3.744605]  [<00000000401d9d58>] show_stack+0x74/0xb0
[    3.744605]  [<0000000040c27bd4>] dump_stack_lvl+0x10c/0x188
[    3.744605]  [<0000000040c27c84>] dump_stack+0x34/0x48
[    3.744605]  [<0000000040c33438>] check_preemption_disabled+0x178/0x1b0
[    3.744605]  [<0000000040c334f8>] __this_cpu_preempt_check+0x38/0x50
[    3.744605]  [<00000000401d632c>] flush_tlb_all+0x58/0x2e0
[    3.744605]  [<00000000401075c0>] 0x401075c0
[    3.744605]  [<000000004010b8fc>] 0x4010b8fc
[    3.744605]  [<00000000401080fc>] 0x401080fc
[    3.744605]  [<00000000401d5224>] do_one_initcall+0x128/0x378
[    3.744605]  [<0000000040102de8>] 0x40102de8
[    3.744605]  [<0000000040c33864>] kernel_init+0x60/0x3a8
[    3.744605]  [<00000000401d1020>] ret_from_kernel_thread+0x20/0x28
[    3.744605]

Fix this by moving the __inc_irq_stat() into the locked section.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/parisc/mm/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 10a52664e29f0..038fcb6c76dc1 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -895,9 +895,9 @@ void flush_tlb_all(void)
 {
 	int do_recycle;
 
-	__inc_irq_stat(irq_tlb_count);
 	do_recycle = 0;
 	spin_lock(&sid_lock);
+	__inc_irq_stat(irq_tlb_count);
 	if (dirty_space_ids > RECYCLE_THRESHOLD) {
 	    BUG_ON(recycle_inuse);  /* FIXME: Use a semaphore/wait queue here */
 	    get_dirty_sids(&recycle_ndirty,recycle_dirty_array);
@@ -916,8 +916,8 @@ void flush_tlb_all(void)
 #else
 void flush_tlb_all(void)
 {
-	__inc_irq_stat(irq_tlb_count);
 	spin_lock(&sid_lock);
+	__inc_irq_stat(irq_tlb_count);
 	flush_tlb_all_local(NULL);
 	recycle_sids();
 	spin_unlock(&sid_lock);
-- 
2.33.0


  parent reply	other threads:[~2021-11-09  1:24 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 17:49 [PATCH AUTOSEL 4.19 01/47] drm: panel-orientation-quirks: Add quirk for KD Kurio Smart C15200 2-in-1 Sasha Levin
2021-11-08 17:49 ` Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 02/47] Bluetooth: sco: Fix lock_sock() blockage by memcpy_from_msg() Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 03/47] Bluetooth: fix use-after-free error in lock_sock_nested() Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 04/47] platform/x86: wmi: do not fail if disabling fails Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 05/47] MIPS: lantiq: dma: add small delay after reset Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 06/47] MIPS: lantiq: dma: reset correct number of channel Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 07/47] locking/lockdep: Avoid RCU-induced noinstr fail Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 08/47] net: sched: update default qdisc visibility after Tx queue cnt changes Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 09/47] smackfs: Fix use-after-free in netlbl_catmap_walk() Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 10/47] NET: IPV4: fix error "do not initialise globals to 0" Sasha Levin
2021-11-09  1:49   ` Joe Perches
2021-11-14 14:13     ` Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 11/47] x86: Increase exception stack sizes Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 12/47] mwifiex: Run SET_BSS_MODE when changing from P2P to STATION vif-type Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 13/47] mwifiex: Properly initialize private structure on interface type changes Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 14/47] media: mt9p031: Fix corrupted frame after restarting stream Sasha Levin
2021-11-08 17:49 ` [PATCH AUTOSEL 4.19 15/47] media: netup_unidvb: handle interrupt properly according to the firmware Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 16/47] media: uvcvideo: Set capability in s_param Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 17/47] media: uvcvideo: Return -EIO for control errors Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 18/47] media: s5p-mfc: fix possible null-pointer dereference in s5p_mfc_probe() Sasha Levin
2021-11-08 17:50   ` Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 19/47] media: s5p-mfc: Add checking to s5p_mfc_probe() Sasha Levin
2021-11-08 17:50   ` Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 20/47] media: mceusb: return without resubmitting URB in case of -EPROTO error Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 21/47] ia64: don't do IA64_CMPXCHG_DEBUG without CONFIG_PRINTK Sasha Levin
2021-11-08 17:50   ` Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 22/47] media: rcar-csi2: Add checking to rcsi2_start_receiver() Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 23/47] ACPICA: Avoid evaluating methods too early during system resume Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 24/47] media: usb: dvd-usb: fix uninit-value bug in dibusb_read_eeprom_byte() Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 25/47] tracefs: Have tracefs directories not set OTH permission bits by default Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 26/47] ath: dfs_pattern_detector: Fix possible null-pointer dereference in channel_detector_create() Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 27/47] ACPI: battery: Accept charges over the design capacity as full Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 28/47] leaking_addresses: Always print a trailing newline Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 29/47] memstick: r592: Fix a UAF bug when removing the driver Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 30/47] lib/xz: Avoid overlapping memcpy() with invalid input with in-place decompression Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 31/47] lib/xz: Validate the value before assigning it to an enum variable Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 32/47] workqueue: make sysfs of unbound kworker cpumask more clever Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 33/47] tracing/cfi: Fix cmp_entries_* functions signature mismatch Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 34/47] mwl8k: Fix use-after-free in mwl8k_fw_state_machine() Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 35/47] PM: hibernate: Get block device exclusively in swsusp_check() Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 36/47] iwlwifi: mvm: disable RX-diversity in powersave Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 37/47] smackfs: use __GFP_NOFAIL for smk_cipso_doi() Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 38/47] ARM: clang: Do not rely on lr register for stacktrace Sasha Levin
2021-11-08 17:50   ` Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 39/47] gre/sit: Don't generate link-local addr if addr_gen_mode is IN6_ADDR_GEN_MODE_NONE Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 40/47] ARM: 9136/1: ARMv7-M uses BE-8, not BE-32 Sasha Levin
2021-11-08 17:50   ` Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 41/47] arm64/sve: Add stub for sve_max_virtualisable_vl() Sasha Levin
2021-11-08 17:50   ` Sasha Levin
2021-11-09 13:20   ` Catalin Marinas
2021-11-09 13:20     ` Catalin Marinas
2021-11-14 14:04     ` Sasha Levin
2021-11-14 14:04       ` Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 42/47] spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qspi_probe() Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 43/47] x86/hyperv: Protect set_hv_tscchange_cb() against getting preempted Sasha Levin
2021-11-08 17:50 ` Sasha Levin [this message]
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 45/47] task_stack: Fix end_of_stack() for architectures with upwards-growing stack Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 46/47] parisc/unwind: fix unwinder when CONFIG_64BIT is enabled Sasha Levin
2021-11-08 17:50 ` [PATCH AUTOSEL 4.19 47/47] parisc/kgdb: add kgdb_roundup() to make kgdb work with idle polling Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211108175031.1190422-44-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=david@redhat.com \
    --cc=deller@gmx.de \
    --cc=hanyihao@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=stable@vger.kernel.org \
    --cc=svens@stackframe.org \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.