From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA701C3DA49 for ; Tue, 16 Jul 2024 16:37:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E4516B0082; Tue, 16 Jul 2024 12:37:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 56D1C6B0088; Tue, 16 Jul 2024 12:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40E356B0089; Tue, 16 Jul 2024 12:37:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 20ADC6B0082 for ; Tue, 16 Jul 2024 12:37:42 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9DBA01C05C0 for ; Tue, 16 Jul 2024 16:37:41 +0000 (UTC) X-FDA: 82346171922.02.8BB7ABB Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf18.hostedemail.com (Postfix) with ESMTP id 3CC2B1C0025 for ; Tue, 16 Jul 2024 16:37:37 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Y8p1OCvj; spf=pass (imf18.hostedemail.com: domain of jic23@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jic23@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721147821; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2rVkCQX9GtSuXfh40OIDgCxbgRZwfABItc+Kzbgic/I=; b=Yd1BmA1QoCHzsuRoDsc1H6h3JDkr91Y730SIbeD/GvXqF/Sg+hXC14rGmhecyUXg/6tbP7 Ueve8rnv0uKf5szRpYCoVntfjnw4+rGMpQ8SchqmzYTO6+p+nyt3zuI1O9cGn6o8KxOEEU AG2g4fX7sC9aOriXiEOfFBEM86Fjenw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721147821; a=rsa-sha256; cv=none; b=A3XKDBF4nmhDENGX23ukAKeVp0lc7x25uWoIcy2fMA8wqjhncaRXLXPKmKN64ELVnffv+q G+B7Uj7rxqKnD2+oqh6399iNiXCGA8lF4SccF6bSfg3K/KWiukjLulJONc3zwiirpCL7AY +9TUnGDjMWNHbRJqCZmGJYzXpQW5XK4= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Y8p1OCvj; spf=pass (imf18.hostedemail.com: domain of jic23@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jic23@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 0A38FCE1320; Tue, 16 Jul 2024 16:37:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04514C116B1; Tue, 16 Jul 2024 16:37:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721147852; bh=vK7Gyxxt2pqmgNDEvXOM+qGxAkW9bXhQSQBiN5GtWFo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Y8p1OCvjiMLG5mQY3dWb54Zh8iTNLFBxMGZg3SFx+x2ecNBsslAkPksPz0KHgULuZ XdTACUQvwbRBsh7m+iHmjjc86Nyt4InNWsDTKk9QteTVxunpH1Fga/YDUUm/+k3tJN vDnF7Ygs6C+KtW8Fi5glY+SL245X96Bq9GhOhU0gAq2Qgxul24cPXPDP68FWy5Jzuu cErXlOfRpLaAK8QlSLEBrTE5OFckAmn4f9QeZoMDNrwGYnGmdPD9p+Hu36Sn1263il JErILZ6Rmaw0j+PQBlFQYrthk/zE1QwdAe8vg/bygFs3ujTYuD4WLySJKA2hTq4te4 i7UJsyb3dEA4w== Date: Tue, 16 Jul 2024 17:37:22 +0100 From: Jonathan Cameron To: kernel test robot Cc: Nuno Sa , , , Linux Memory Management List , Jonathan Cameron , , "Borislav Petkov (AMD)" , Paul Menzel , Marco Elver , Masahiro Yamada Subject: Re: [linux-next:master] [iio] 8d61d01cde: WARNING:at_arch/x86/kernel/cpu/bugs.c:#__warn_thunk Message-ID: <20240716173722.5e582581@jic23-huawei> In-Reply-To: <202407161520.ee3d9347-lkp@intel.com> References: <202407161520.ee3d9347-lkp@intel.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3CC2B1C0025 X-Stat-Signature: jx736ptoqcuh1z8wb1hb9nkhm61k67mp X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1721147857-479965 X-HE-Meta: U2FsdGVkX19WFI40PaDiyZapx9FwPK0Pizf6AVUDaXfHk7uMFGTxhoEU5dteeH228qVLAfqJ/y7qx/8co74lLKVVHE/HJGuTDfSPrR8PqIRDXURoWwnRGwYiYVP/NxoCJzS0LuDLYaAUCZzH9Jz3nQ9w8HSJ+G3OaPhLjfzcnS0ywZ3s59KEYYJ1M0mWu/SMC9LlYg+V+4b4Xg/8biT3QoJ/PAe8FUktxPQyWfFeqj75T9jypdsHcUNnVwDin9zgIaUnG/qYGYG5Kaj2mctHx8/u78y1sGJ8LB1EYRFCj+qJOBCw09rb9R8p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.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, 16 Jul 2024 15:59:12 +0800 kernel test robot wrote: > Hello, > > kernel test robot noticed "WARNING:at_arch/x86/kernel/cpu/bugs.c:#__warn_thunk" on: > > commit: 8d61d01cdec275719b70295e98e4d45c5f284f29 ("iio: gyro: adis16260: make use of the new lock helpers") > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master > > [test failed on linux-next/master 91e3b24eb7d297d9d99030800ed96944b8652eaf] > > in testcase: rcutorture > version: > with following parameters: > > runtime: 300s > test: cpuhotplug > torture_type: trivial > > > > compiler: clang-18 > test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G > > (please refer to attached dmesg/kmsg for entire log/backtrace) > > > +-----------------------------------------------------+------------+------------+ > | | ccd52641f9 | 8d61d01cde | > +-----------------------------------------------------+------------+------------+ > | WARNING:at_arch/x86/kernel/cpu/bugs.c:#__warn_thunk | 0 | 30 | > | RIP:__warn_thunk | 0 | 30 | > +-----------------------------------------------------+------------+------------+ Hi All. I'm struggling to have any idea what this is reporting. The code is question must be the use of adis_dev_autoscoped_lock() which is very straight forward. adis_dev_auto_scoped_lock(adis) { if (t >= 0x0A) adis->spi->max_speed_hz = ADIS16260_SPI_SLOW; else adis->spi->max_speed_hz = ADIS16260_SPI_FAST; return __adis_write_reg_8(adis, ADIS16260_SMPL_PRD, t); } unreachable(); //needed because not all compilers seem to be able to tell //that a scoped_guard() always runs. where the definition is simply #define adis_dev_auto_scoped_lock(adis) \ scoped_guard(mutex, &(adis)->state_lock) Looks like there was some fun with ksan earlier in the year that smells superficially similar but that is long resolved? (+CC some of the folk involved in solving that). Any thoughts? Jonathan > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-lkp/202407161520.ee3d9347-lkp@intel.com > > > [ 6.698254][ T1] ------------[ cut here ]------------ > [ 6.698774][ T1] Unpatched return thunk in use. This should not happen! > [ 6.699377][ T1] WARNING: CPU: 0 PID: 1 at arch/x86/kernel/cpu/bugs.c:3023 __warn_thunk (arch/x86/kernel/cpu/bugs.c:3023) > [ 6.699604][ T1] Modules linked in: > [ 6.699937][ T1] CPU: 0 PID: 1 Comm: swapper Not tainted 6.10.0-rc4-00198-g8d61d01cdec2 #1 > [ 6.700668][ T1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 > [ 6.701548][ T1] RIP: 0010:__warn_thunk (arch/x86/kernel/cpu/bugs.c:3023) > [ 6.701983][ T1] Code: 1f 44 00 00 80 3d dd fb e3 03 00 74 08 31 ff c3 cc cc cc cc cc c6 05 cc fb e3 03 01 90 48 c7 c7 40 b0 a1 83 e8 76 c6 13 00 90 <0f> 0b 90 90 31 ff c3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc b8 > All code > ======== > 0: 1f (bad) > 1: 44 00 00 add %r8b,(%rax) > 4: 80 3d dd fb e3 03 00 cmpb $0x0,0x3e3fbdd(%rip) # 0x3e3fbe8 > b: 74 08 je 0x15 > d: 31 ff xor %edi,%edi > f: c3 ret > 10: cc int3 > 11: cc int3 > 12: cc int3 > 13: cc int3 > 14: cc int3 > 15: c6 05 cc fb e3 03 01 movb $0x1,0x3e3fbcc(%rip) # 0x3e3fbe8 > 1c: 90 nop > 1d: 48 c7 c7 40 b0 a1 83 mov $0xffffffff83a1b040,%rdi > 24: e8 76 c6 13 00 call 0x13c69f > 29: 90 nop > 2a:* 0f 0b ud2 <-- trapping instruction > 2c: 90 nop > 2d: 90 nop > 2e: 31 ff xor %edi,%edi > 30: c3 ret > 31: cc int3 > 32: cc int3 > 33: cc int3 > 34: cc int3 > 35: cc int3 > 36: cc int3 > 37: cc int3 > 38: cc int3 > 39: cc int3 > 3a: cc int3 > 3b: cc int3 > 3c: cc int3 > 3d: cc int3 > 3e: cc int3 > 3f: b8 .byte 0xb8 > > Code starting with the faulting instruction > =========================================== > 0: 0f 0b ud2 > 2: 90 nop > 3: 90 nop > 4: 31 ff xor %edi,%edi > 6: c3 ret > 7: cc int3 > 8: cc int3 > 9: cc int3 > a: cc int3 > b: cc int3 > c: cc int3 > d: cc int3 > e: cc int3 > f: cc int3 > 10: cc int3 > 11: cc int3 > 12: cc int3 > 13: cc int3 > 14: cc int3 > 15: b8 .byte 0xb8 > [ 6.703602][ T1] RSP: 0000:ffffc9000001fe88 EFLAGS: 00010246 > [ 6.704116][ T1] RAX: 0000000000000000 RBX: ffffffff856a96a0 RCX: 0000000000000000 > [ 6.704787][ T1] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 > [ 6.705462][ T1] RBP: ffffc9000001fed8 R08: 0000000000000000 R09: 0000000000000000 > [ 6.706134][ T1] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 > [ 6.706804][ T1] R13: 0000000000000000 R14: dffffc0000000000 R15: ffffffff856a96a0 > [ 6.707476][ T1] FS: 0000000000000000(0000) GS:ffffffff844a7000(0000) knlGS:0000000000000000 > [ 6.707601][ T1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [ 6.708157][ T1] CR2: ffff88843ffff000 CR3: 000000000446c000 CR4: 00000000000406f0 > [ 6.708834][ T1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > [ 6.709505][ T1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > [ 6.710174][ T1] Call Trace: > [ 6.710452][ T1] > [ 6.710701][ T1] ? __warn (kernel/panic.c:239 kernel/panic.c:693) > [ 6.711054][ T1] ? __warn_thunk (arch/x86/kernel/cpu/bugs.c:3023) > [ 6.711434][ T1] ? __warn_thunk (arch/x86/kernel/cpu/bugs.c:3023) > [ 6.711604][ T1] ? report_bug (lib/bug.c:?) > [ 6.711991][ T1] ? handle_bug (arch/x86/kernel/traps.c:239) > [ 6.712357][ T1] ? exc_invalid_op (arch/x86/kernel/traps.c:260) > [ 6.712759][ T1] ? asm_exc_invalid_op (arch/x86/include/asm/idtentry.h:621) > [ 6.713193][ T1] ? __warn_thunk (arch/x86/kernel/cpu/bugs.c:3023) > [ 6.713575][ T1] ? __warn_thunk (arch/x86/kernel/cpu/bugs.c:3023) > [ 6.713956][ T1] warn_thunk_thunk (arch/x86/entry/entry.S:48) > [ 6.714352][ T1] ? __cfi_asan.module_ctor (main.c:?) > [ 6.714810][ T1] do_basic_setup (init/main.c:1126 init/main.c:1363) > [ 6.715194][ T1] kernel_init_freeable (init/main.c:1582) > [ 6.715602][ T1] ? __cfi_kernel_init (init/main.c:1459) > [ 6.716022][ T1] kernel_init (init/main.c:1469) > [ 6.716389][ T1] ret_from_fork (arch/x86/kernel/process.c:153) > [ 6.716769][ T1] ? __cfi_kernel_init (init/main.c:1459) > [ 6.717187][ T1] ret_from_fork_asm (arch/x86/entry/entry_64.S:257) > [ 6.717600][ T1] > [ 6.717856][ T1] irq event stamp: 14123 > [ 6.718213][ T1] hardirqs last enabled at (14131): console_unlock (arch/x86/include/asm/irqflags.h:42 arch/x86/include/asm/irqflags.h:77 arch/x86/include/asm/irqflags.h:135 kernel/printk/printk.c:341 kernel/printk/printk.c:2746 kernel/printk/printk.c:3065) > [ 6.719011][ T1] hardirqs last disabled at (14138): console_unlock (kernel/printk/printk.c:339) > [ 6.719601][ T1] softirqs last enabled at (2244): irq_exit_rcu (kernel/softirq.c:651) > [ 6.720366][ T1] softirqs last disabled at (2235): irq_exit_rcu (kernel/softirq.c:651) > [ 6.721120][ T1] ---[ end trace 0000000000000000 ]--- > > > > The kernel config and materials to reproduce are available at: > https://download.01.org/0day-ci/archive/20240716/202407161520.ee3d9347-lkp@intel.com > > >