From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 050992C181 for ; Tue, 31 Dec 2024 15:48:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.161 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735660094; cv=none; b=aJWVhQBFhpc0EqNfpe2z27n6xvS24rQ2AiG4ihLIEQWuAGZVIQTW20eEyGWZf78WSqePPSbycz3Ge1s0s3cDB4MTAnJRzAqIY9U5kBNN33myoOnv/qiTMk9RQRD+HffCI8t/eCU1mBQ4qopR+sn7veh9mC67McbJp6P/7ZdRlPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735660094; c=relaxed/simple; bh=RCKWZUS/JxPR+A3pK/SkdmUkXmA9VgfHmsTkfJA/XK0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=onwfI2eoB6TsF3jEUnkAq3WP13E9lVR9JxML4Dp7kOXZ2rOvshN63SrgBGTIlvrxoRupQgjT6L1qXhRorUqHcuB6egySd8u9Hyav4tKdjxQ7synFhUMk1Q70e3kAEkXbQiv2q43+pHCmc+9sRHm1uMZCtswkQAvoYH7eIj2B5/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=wIaB3fTc; arc=none smtp.client-ip=80.241.56.161 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="wIaB3fTc" Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4YMxw42lmVz9sWt; Tue, 31 Dec 2024 16:39:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1735659540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gjzUutZ1aueIJ5ypggWx8wPwFiQAxaJcq/asA1rwMKA=; b=wIaB3fTcuExyL7XXvbsWCIxfOlrNe3lkYRQ5QSU53cZnkBO5x0jbUO24lGM9IFsyuoU6NS eBpRs4zU06jtL8sprNNQ8Yt3QLMgAVv/wpcmCC8Rjx1BtamW38/1zfQZSyCLWFrsUKh6eJ f+0Oxm61OnnL/cvbdm1dhC2tlytlDTCCFGmGM9q0LSbRSyLfXUhVmkFoVERwOcaAXTBpH2 Bff9R15uAndCQJrZoZCv27Ae4Bi+8Orws4OmNAVt9vmiAP9O7HDaIm1Qa8Z36WV6peI7C6 TGbbEQUcqo39hjKzv1Q+Le5THyrBUKZtlR6hRngVqRZv/bN3kzU1w1lH+h+lTQ== Date: Tue, 31 Dec 2024 16:38:57 +0100 From: Erhard Furtner To: linux-kernel@vger.kernel.org, linux@dominikbrodowski.net, mail@brodo.de Cc: x86@kernel.org Subject: Re: "WARNING: CPU: 0 PID: 67 at arch/x86/mm/ioremap.c:461 iounmap+0xda/0xe0" at initializing PCMCIA serial card (Thinkpad T60, v6.12-rc2) Message-ID: <20241231163857.42bbbbb5@yea> In-Reply-To: <20241009191507.7ed7511b@yea> References: <20241009191507.7ed7511b@yea> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/NGoypenmkFOzo3Lz3wcbxCo" X-MBO-RS-ID: 399d31ebe203182e2a8 X-MBO-RS-META: s3nofko7jjqiaqycn8oscefasgg1zfyw --MP_/NGoypenmkFOzo3Lz3wcbxCo Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, 9 Oct 2024 19:15:07 +0200 Erhard Furtner wrote: > On kernel v6.12-rc2 this warning shows up when my PCMCIA serial card gets initialized on my Thinkpad T60: > > [...] > pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0 > pcmcia_socket pcmcia_socket0: cs: memory probe 0xe46d0000-0xe7ffffff: > ------------[ cut here ]------------ > WARNING: CPU: 0 PID: 67 at arch/x86/mm/ioremap.c:461 iounmap+0xda/0xe0 > Modules linked in: > CPU: 0 UID: 0 PID: 67 Comm: pccardd Tainted: G W 6.12.0-rc2-P3 #3 > Tainted: [W]=WARN > Hardware name: LENOVO 2007F2G/2007F2G, BIOS 79ETE7WW (2.27 ) 03/21/2011 > EIP: iounmap+0xda/0xe0 > Code: c7 75 2b 89 f8 e8 6a 27 16 00 5e 5f 5b 5d 31 c0 31 c9 31 d2 c3 56 68 9c 8e 92 c9 e8 e8 c3 73 00 83 c4 08 e8 3c 33 74 00 eb e0 <0f> 0b eb dc 0f 0b 55 89 e5 56 89 c6 25 00 f0 ff ff 31 d2 b9 00 10 > EAX: f7dfe000 EBX: c1b7b578 ECX: 00000000 EDX: 00000000 > ESI: 00000000 EDI: c1a95e40 EBP: c1a95e10 ESP: c1a95e04 > DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010286 > CR0: 80050033 CR2: ffbff000 CR3: 09b7c000 CR4: 000006f0 > Call Trace: > ? show_regs+0x4e/0x5c > ? __warn+0x87/0xdc > ? iounmap+0xda/0xe0 > ? report_bug+0x94/0x108 > ? exc_overflow+0x3c/0x3c > ? handle_bug+0x41/0x60 > ? exc_invalid_op+0x17/0x40 > ? handle_exception+0x101/0x101 > ? exc_overflow+0x3c/0x3c > ? iounmap+0xda/0xe0 > ? exc_overflow+0x3c/0x3c > ? iounmap+0xda/0xe0 > readable+0x69/0xb8 > ? do_mem_probe+0x190/0x190 > do_validate_mem+0x8a/0x154 > do_mem_probe+0xa8/0x190 > ? do_mem_probe+0x190/0x190 > pcmcia_nonstatic_validate_mem+0x45/0x80 > ? do_mem_probe+0x190/0x190 > ? readable+0xb8/0xb8 > pcmcia_validate_mem+0x14/0x1c > pcmcia_card_add+0x3c/0xb0 > pcmcia_bus_add+0x3a/0x44 > socket_insert+0xc7/0xcc > pccardd+0x143/0x370 > kthread+0xc4/0xd0 > ? pcmcia_register_socket+0x28c/0x28c > ? kthread_blkcg+0x24/0x24 > ? kthread_blkcg+0x24/0x24 > ret_from_fork+0x31/0x3c > ret_from_fork_asm+0x12/0x18 > entry_INT80_32+0xf0/0xf0 > ---[ end trace 0000000000000000 ]--- > excluding 0xe4df4000-0xe5185fff 0xe5fce000-0xe635ffff 0xe6e16000-0xe71a7fff 0xe7ff0000-0xe8381fff > pcmcia (null): pcmcia: registering new device pcmcia(null) (IRQ: 16) > serial_cs 0.0: trying to set up [0x0279:0x950b] (pfc: 0, multi: 2, quirk: c980f7c0) > 0.0: ttyS4 at I/O 0xa108 (irq = 16, base_baud = 115200) is a 16450 > [...] This shows up on stable v6.12.x and on v6.13-rc too, so more people might get this warning. I bisected the issue to "50c6dbdfd16e312382842198a7919341ad480e05 x86/ioremap: Improve iounmap() address range checks", realizing only later that the commit itself does not cause the issue but only imposes a more strict range check. The commit message says "Restrict iounmap() to addresses in the ioremap region, by using is_ioremap_addr(). This aligns x86 closer to the generic iounmap() implementation. Additionally, add a warning in case there is an attempt to iounmap() invalid memory. This replaces an existing silent return and will help alert folks to any incorrect usage of iounmap()." So technically speaking it's no regression but a hint that yenta_cardbus and other pcmcia drivers may have been checking a wrong range from the start. And it seems a general problem on x86. In my case it's an ExSys EX-1352 PCMCIA RS-232 card, providing 2x serial ports as my Thinkpad T60 got none. Some data about the hardware: # lspci -s 15:00.0 -vv 15:00.0 CardBus bridge: Texas Instruments PCI1510 PC card Cardbus Controller Subsystem: Lenovo ThinkPad T60/R60 series Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Reset+ 16bInt- PostWrite+ 16-bit legacy interface ports at 0001 Capabilities: [a0] Power Management version 2 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Bridge: PM+ B3- Kernel driver in use: yenta_cardbus # pccardctl info PRODID_1="PC CARD " PRODID_2="GENERIC " PRODID_3="" PRODID_4="" MANFID=0279,950b FUNCID=2 # pccardctl status Socket 0: 3.3V 16-bit PC Card Subdevice 0 (function 0) bound to driver "serial_cs" I know PCMCIA SUBSYSTEM is listed as "Odd Fixes" only in Maintainers but perhaps a not too invasive fix is possible for someone knowledgeable. I could help with the testing on my system. Regards, Erhard --MP_/NGoypenmkFOzo3Lz3wcbxCo Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bisect_pcmcia.txt git bisect start # status: waiting for both good and bad commits # good: [ffc253263a1375a65fa6c9f62a893e9767fbebfa] Linux 6.6 git bisect good ffc253263a1375a65fa6c9f62a893e9767fbebfa # status: waiting for bad commit, 1 good commit known # bad: [fc033cf25e612e840e545f8d5ad2edd6ba613ed5] Linux 6.13-rc5 git bisect bad fc033cf25e612e840e545f8d5ad2edd6ba613ed5 # good: [b850dc206a57ae272c639e31ac202ec0c2f46960] Merge tag 'firewire-updates-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 git bisect good b850dc206a57ae272c639e31ac202ec0c2f46960 # good: [bcd138b179f2701459d404880d018d065a958fc9] Merge branch 'various-cleanups' git bisect good bcd138b179f2701459d404880d018d065a958fc9 # bad: [71e0ad345163c150ea15434b37036b0678d5f6f4] Merge tag 'wireless-next-2024-10-25' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next git bisect bad 71e0ad345163c150ea15434b37036b0678d5f6f4 # bad: [1868f9d0260e9afaf7c6436d14923ae12eaea465] Merge tag 'for-linux-6.12-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux git bisect bad 1868f9d0260e9afaf7c6436d14923ae12eaea465 # bad: [395b15778e8f1b580334c558c9a6e9f1b28fcc76] Merge tag 'linux_kselftest-nolibc-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest git bisect bad 395b15778e8f1b580334c558c9a6e9f1b28fcc76 # good: [3a4d319a8fb5a9bbdf5b31ef32841eb286b1dcc2] Merge tag 'for-6.12/io_uring-20240913' of git://git.kernel.dk/linux git bisect good 3a4d319a8fb5a9bbdf5b31ef32841eb286b1dcc2 # good: [168c3e0d443599dd370710243fbf5c815fad7890] Merge tag 'sunxi-dt-for-6.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into soc/dt git bisect good 168c3e0d443599dd370710243fbf5c815fad7890 # good: [6df928086070b4db8cadc31a4424524f57c584ae] Merge tag 'regulator-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator git bisect good 6df928086070b4db8cadc31a4424524f57c584ae # good: [b62800736f61521547d50fd8cc332cf9b74cbaff] Merge tag 'memory-controller-drv-6.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers git bisect good b62800736f61521547d50fd8cc332cf9b74cbaff # good: [0279aa780df4362f218b5645c07e5265859937f6] Merge tag 'x86-cleanups-2024-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip git bisect good 0279aa780df4362f218b5645c07e5265859937f6 # bad: [8202cc803f3d0a0a7f7e4c08ce575634a0220406] Merge tag 'm68k-for-v6.12-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k git bisect bad 8202cc803f3d0a0a7f7e4c08ce575634a0220406 # good: [b136021126b99072da705f693a8be07c6285e47c] Merge tag 'x86-fred-2024-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip git bisect good b136021126b99072da705f693a8be07c6285e47c # bad: [a3233da6c014b421f16dce27955fa4a803b50474] Merge tag 'x86-platform-2024-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip git bisect bad a3233da6c014b421f16dce27955fa4a803b50474 # good: [6998a73efbb8a87f4dd0bddde90b7f5b0d47b5e0] selftests/mm: Add new testcases for pkeys git bisect good 6998a73efbb8a87f4dd0bddde90b7f5b0d47b5e0 # good: [1aa0c92f816b3a136cc3a31ef184206a19fc3c03] x86/mm: Remove unused NX related declarations git bisect good 1aa0c92f816b3a136cc3a31ef184206a19fc3c03 # bad: [50c6dbdfd16e312382842198a7919341ad480e05] x86/ioremap: Improve iounmap() address range checks git bisect bad 50c6dbdfd16e312382842198a7919341ad480e05 # good: [d4245fd4a62931aebd1c5e6b7b6f51b6ef7ad087] x86/mm: Remove duplicate check from build_cr3() git bisect good d4245fd4a62931aebd1c5e6b7b6f51b6ef7ad087 # first bad commit: [50c6dbdfd16e312382842198a7919341ad480e05] x86/ioremap: Improve iounmap() address range checks --MP_/NGoypenmkFOzo3Lz3wcbxCo--